Class MQTTSessionState
- java.lang.Object
-
- org.apache.activemq.artemis.core.protocol.mqtt.MQTTSessionState
-
public class MQTTSessionState extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMQTTSessionState.OutboundStorestatic classMQTTSessionState.WillStatus
-
Field Summary
Fields Modifier and Type Field Description static MQTTSessionStateDEFAULT
-
Constructor Summary
Constructors Constructor Description MQTTSessionState(String clientId, MQTTStateManager stateManager)MQTTSessionState(org.apache.activemq.artemis.core.message.impl.CoreMessage message, MQTTStateManager stateManager)This constructor deserializes session data from a message.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegeraddServerTopicAlias(String topicName)booleanaddSubscription(io.netty.handler.codec.mqtt.MqttTopicSubscription subscription, WildcardConfiguration wildcardConfiguration, Integer subscriptionIdentifier)voidclear()voidclearTopicAliases()StringgetClientId()intgetClientMaxPacketSize()intgetClientSessionExpiryInterval()StringgetClientTopicAlias(Integer alias)IntegergetClientTopicAliasMaximum()longgetDisconnectedTime()List<Integer>getMatchingSubscriptionIdentifiers(String address)MQTTSessionState.OutboundStoregetOutboundStore()Set<Integer>getPubRec()IntegergetServerTopicAlias(String topicName)MQTTSessiongetSession()io.netty.handler.codec.mqtt.MqttTopicSubscriptiongetSubscription(String address)Pair<io.netty.handler.codec.mqtt.MqttTopicSubscription,Integer>getSubscriptionPlusID(String address)Collection<io.netty.handler.codec.mqtt.MqttTopicSubscription>getSubscriptions()Collection<Pair<io.netty.handler.codec.mqtt.MqttTopicSubscription,Integer>>getSubscriptionsPlusID()longgetWillDelayInterval()io.netty.buffer.ByteBufgetWillMessage()intgetWillQoSLevel()MQTTSessionState.WillStatusgetWillStatus()StringgetWillTopic()List<? extends io.netty.handler.codec.mqtt.MqttProperties.MqttProperty>getWillUserProperties()booleanisAttached()booleanisFailed()booleanisWill()booleanisWillRetain()voidputClientTopicAlias(Integer alias, String topicName)voidremoveSubscription(String address)voidsetAttached(boolean attached)voidsetClientMaxPacketSize(int clientMaxPacketSize)voidsetClientSessionExpiryInterval(int sessionExpiryInterval)voidsetClientTopicAliasMaximum(Integer clientTopicAliasMaximum)voidsetDisconnectedTime(long disconnectedTime)voidsetFailed(boolean failed)voidsetSession(MQTTSession session)voidsetWill(boolean will)voidsetWillDelayInterval(long willDelayInterval)voidsetWillMessage(io.netty.buffer.ByteBuf willMessage)voidsetWillQoSLevel(int willQoSLevel)voidsetWillRetain(boolean willRetain)voidsetWillStatus(MQTTSessionState.WillStatus willStatus)voidsetWillTopic(String willTopic)voidsetWillUserProperties(List<? extends io.netty.handler.codec.mqtt.MqttProperties.MqttProperty> userProperties)StringtoString()
-
-
-
Field Detail
-
DEFAULT
public static final MQTTSessionState DEFAULT
-
-
Constructor Detail
-
MQTTSessionState
public MQTTSessionState(String clientId, MQTTStateManager stateManager)
-
MQTTSessionState
public MQTTSessionState(org.apache.activemq.artemis.core.message.impl.CoreMessage message, MQTTStateManager stateManager)This constructor deserializes session data from a message. The format is as follows. - byte: version - int: subscription count There may be 0 or more subscriptions. The subscription format is as follows. - String: topic name - int: QoS - boolean: no-local - boolean: retain as published - int: retain handling - int (nullable): subscription identifier- Parameters:
message- the message holding the MQTT session datastateManager- the manager used to add and remove sessions from storage
-
-
Method Detail
-
getSession
public MQTTSession getSession()
-
setSession
public void setSession(MQTTSession session)
-
getOutboundStore
public MQTTSessionState.OutboundStore getOutboundStore()
-
isAttached
public boolean isAttached()
-
setAttached
public void setAttached(boolean attached)
-
getSubscriptions
public Collection<io.netty.handler.codec.mqtt.MqttTopicSubscription> getSubscriptions()
-
getSubscriptionsPlusID
public Collection<Pair<io.netty.handler.codec.mqtt.MqttTopicSubscription,Integer>> getSubscriptionsPlusID()
-
addSubscription
public boolean addSubscription(io.netty.handler.codec.mqtt.MqttTopicSubscription subscription, WildcardConfiguration wildcardConfiguration, Integer subscriptionIdentifier) throws Exception- Throws:
Exception
-
removeSubscription
public void removeSubscription(String address) throws Exception
- Throws:
Exception
-
getSubscription
public io.netty.handler.codec.mqtt.MqttTopicSubscription getSubscription(String address)
-
getSubscriptionPlusID
public Pair<io.netty.handler.codec.mqtt.MqttTopicSubscription,Integer> getSubscriptionPlusID(String address)
-
getMatchingSubscriptionIdentifiers
public List<Integer> getMatchingSubscriptionIdentifiers(String address)
-
getClientId
public String getClientId()
-
getDisconnectedTime
public long getDisconnectedTime()
-
setDisconnectedTime
public void setDisconnectedTime(long disconnectedTime)
-
getClientSessionExpiryInterval
public int getClientSessionExpiryInterval()
-
setClientSessionExpiryInterval
public void setClientSessionExpiryInterval(int sessionExpiryInterval)
-
isWill
public boolean isWill()
-
setWill
public void setWill(boolean will)
-
getWillMessage
public io.netty.buffer.ByteBuf getWillMessage()
-
setWillMessage
public void setWillMessage(io.netty.buffer.ByteBuf willMessage)
-
getWillTopic
public String getWillTopic()
-
setWillTopic
public void setWillTopic(String willTopic)
-
getWillQoSLevel
public int getWillQoSLevel()
-
setWillQoSLevel
public void setWillQoSLevel(int willQoSLevel)
-
isWillRetain
public boolean isWillRetain()
-
setWillRetain
public void setWillRetain(boolean willRetain)
-
getWillDelayInterval
public long getWillDelayInterval()
-
setWillDelayInterval
public void setWillDelayInterval(long willDelayInterval)
-
setWillUserProperties
public void setWillUserProperties(List<? extends io.netty.handler.codec.mqtt.MqttProperties.MqttProperty> userProperties)
-
getWillUserProperties
public List<? extends io.netty.handler.codec.mqtt.MqttProperties.MqttProperty> getWillUserProperties()
-
getWillStatus
public MQTTSessionState.WillStatus getWillStatus()
-
setWillStatus
public void setWillStatus(MQTTSessionState.WillStatus willStatus)
-
isFailed
public boolean isFailed()
-
setFailed
public void setFailed(boolean failed)
-
getClientMaxPacketSize
public int getClientMaxPacketSize()
-
setClientMaxPacketSize
public void setClientMaxPacketSize(int clientMaxPacketSize)
-
getClientTopicAliasMaximum
public Integer getClientTopicAliasMaximum()
-
setClientTopicAliasMaximum
public void setClientTopicAliasMaximum(Integer clientTopicAliasMaximum)
-
clearTopicAliases
public void clearTopicAliases()
-
-