-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Red1L/plugin_update
Mqtt client information available through a plugin Facet
- Loading branch information
Showing
10 changed files
with
335 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.seedstack.mqtt.fixtures; | ||
|
||
import com.google.common.collect.Lists; | ||
import com.google.inject.AbstractModule; | ||
import io.nuun.kernel.api.plugin.InitState; | ||
import io.nuun.kernel.api.plugin.context.InitContext; | ||
import io.nuun.kernel.core.AbstractPlugin; | ||
import org.seedstack.mqtt.internal.MqttPlugin; | ||
import org.seedstack.mqtt.spi.MqttInfo; | ||
|
||
import java.util.Collection; | ||
|
||
public class DummyPlugin extends AbstractPlugin { | ||
|
||
private MqttInfo mqttInfo; | ||
|
||
@Override | ||
public String name() { | ||
return "DummyMqttPlugin"; | ||
} | ||
|
||
@Override | ||
public InitState init(InitContext initContext) { | ||
mqttInfo = initContext.dependency(MqttInfo.class); | ||
return InitState.INITIALIZED; | ||
} | ||
|
||
@Override | ||
public Collection<Class<?>> requiredPlugins() { | ||
return Lists.<Class<?>>newArrayList(MqttInfo.class); | ||
} | ||
|
||
@Override | ||
public Object nativeUnitModule() { | ||
return new AbstractModule() { | ||
@Override | ||
protected void configure() { | ||
bind(MqttInfo.class).toInstance(mqttInfo); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
org.seedstack.mqtt.fixtures.DummyPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
src/main/java/org/seedstack/mqtt/spi/MqttClientInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.seedstack.mqtt.spi; | ||
|
||
/** | ||
* Information related to an Mqtt client. Can be used for monitoring purpose. | ||
*/ | ||
public class MqttClientInfo { | ||
|
||
private String clientId; | ||
|
||
private String[] topicFilters; | ||
|
||
private String mqttReconnectionMode; | ||
|
||
private MqttPoolConfiguration mqttPoolConfiguration; | ||
|
||
private int reconnectionInterval; | ||
|
||
public String uri; | ||
|
||
private int keepAliveInterval; | ||
|
||
private boolean cleanSession; | ||
|
||
private int mqttVersion; | ||
|
||
private int connectionTimeout; | ||
|
||
public String getClientId() { | ||
return clientId; | ||
} | ||
|
||
public void setClientId(String clientId) { | ||
this.clientId = clientId; | ||
} | ||
|
||
public String[] getTopicFilters() { | ||
return topicFilters; | ||
} | ||
|
||
public void setTopicFilters(String[] topicFilters) { | ||
this.topicFilters = topicFilters; | ||
} | ||
|
||
public String getMqttReconnectionMode() { | ||
return mqttReconnectionMode; | ||
} | ||
|
||
public void setMqttReconnectionMode(String mqttReconnectionMode) { | ||
this.mqttReconnectionMode = mqttReconnectionMode; | ||
} | ||
|
||
public MqttPoolConfiguration getMqttPoolConfiguration() { | ||
return mqttPoolConfiguration; | ||
} | ||
|
||
public void setMqttPoolConfiguration(MqttPoolConfiguration mqttPoolConfiguration) { | ||
this.mqttPoolConfiguration = mqttPoolConfiguration; | ||
} | ||
|
||
public int getReconnectionInterval() { | ||
return reconnectionInterval; | ||
} | ||
|
||
public void setReconnectionInterval(int reconnectionInterval) { | ||
this.reconnectionInterval = reconnectionInterval; | ||
} | ||
|
||
public void setUri(String uri) { | ||
this.uri = uri; | ||
} | ||
|
||
public String getUri() { | ||
return uri; | ||
} | ||
|
||
public int getKeepAliveInterval() { | ||
return keepAliveInterval; | ||
} | ||
|
||
public void setKeepAliveInterval(int keepAliveInterval) { | ||
this.keepAliveInterval = keepAliveInterval; | ||
} | ||
|
||
public boolean isCleanSession() { | ||
return cleanSession; | ||
} | ||
|
||
public void setCleanSession(boolean cleanSession) { | ||
this.cleanSession = cleanSession; | ||
} | ||
|
||
public int getMqttVersion() { | ||
return mqttVersion; | ||
} | ||
|
||
public void setMqttVersion(int mqttVersion) { | ||
this.mqttVersion = mqttVersion; | ||
} | ||
|
||
public int getConnectionTimeout() { | ||
return connectionTimeout; | ||
} | ||
|
||
public void setConnectionTimeout(int connectionTimeout) { | ||
this.connectionTimeout = connectionTimeout; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) 2013-2016, The SeedStack authors <http://seedstack.org> | ||
* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package org.seedstack.mqtt.spi; | ||
|
||
public class MqttClientStats { | ||
} |
Oops, something went wrong.