Class ConnAckPacket
- java.lang.Object
-
- software.amazon.awssdk.crt.mqtt5.packets.ConnAckPacket
-
public class ConnAckPacket extends Object
Data model of an MQTT5 CONNACK packet.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ConnAckPacket.ConnectReasonCode
Server return code for connect attempts.
-
Constructor Summary
Constructors Constructor Description ConnAckPacket()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getAssignedClientIdentifier()
Returns a client identifier assigned to this connection by the server.Long
getMaximumPacketSize()
Returns the maximum packet size, in bytes, that the server is willing to accept.QOS
getMaximumQOS()
Returns the maximum message delivery quality of service that the server will allow on this connection.ConnAckPacket.ConnectReasonCode
getReasonCode()
Returns an indicator that is either success or the reason for failure for the connection attempt.String
getReasonString()
Returns additional diagnostic information about the result of the connection attempt.Integer
getReceiveMaximum()
Returns the maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once.String
getResponseInformation()
Returns a value that can be used in the creation of a response topic associated with this connection.Boolean
getRetainAvailable()
Returns an indicator whether the server supports retained messages.Integer
getServerKeepAlive()
Deprecated.prefer getServerKeepAliveSecondsInteger
getServerKeepAliveSeconds()
Returns server-requested override of the keep alive interval, in seconds.String
getServerReference()
Returns property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint.Long
getSessionExpiryInterval()
Deprecated.prefer getSessionExpiryIntervalSecondsLong
getSessionExpiryIntervalSeconds()
Returns a time interval, in seconds, that the server will persist this connection's MQTT session state for.boolean
getSessionPresent()
Returns true if the client rejoined an existing session on the server, false otherwise.Boolean
getSharedSubscriptionsAvailable()
Returns whether the server supports shared subscription topic filters.Boolean
getSubscriptionIdentifiersAvailable()
Returns whether the server supports subscription identifiers.Integer
getTopicAliasMaximum()
Returns the maximum topic alias value that the server will accept from the client.List<UserProperty>
getUserProperties()
Returns a list of MQTT5 user properties included with the packet.Boolean
getWildcardSubscriptionsAvailable()
Returns whether the server supports wildcard subscriptions.
-
-
-
Method Detail
-
getSessionPresent
public boolean getSessionPresent()
Returns true if the client rejoined an existing session on the server, false otherwise. See MQTT5 Session Present- Returns:
- True if the client rejoined an existing session on the server, false otherwise.
-
getReasonCode
public ConnAckPacket.ConnectReasonCode getReasonCode()
Returns an indicator that is either success or the reason for failure for the connection attempt. See MQTT5 Connect Reason Code- Returns:
- Code indicating either success or the reason for failure for the connection attempt.
-
getSessionExpiryIntervalSeconds
public Long getSessionExpiryIntervalSeconds()
Returns a time interval, in seconds, that the server will persist this connection's MQTT session state for. If present, this value overrides any session expiry specified in the preceding ConnectPacket. See MQTT5 Session Expiry Interval- Returns:
- A time interval, in seconds, that the server will persist this connection's MQTT session state for.
-
getSessionExpiryInterval
public Long getSessionExpiryInterval()
Deprecated.prefer getSessionExpiryIntervalSecondsReturns a time interval, in seconds, that the server will persist this connection's MQTT session state for. If present, this value overrides any session expiry specified in the preceding ConnectPacket. See MQTT5 Session Expiry Interval- Returns:
- A time interval, in seconds, that the server will persist this connection's MQTT session state for.
-
getReceiveMaximum
public Integer getReceiveMaximum()
Returns the maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once. If omitted or null, the limit is based on the valid MQTT packet id space (65535). See MQTT5 Receive Maximum- Returns:
- The maximum amount of in-flight QoS 1 or 2 messages that the server is willing to handle at once.
-
getMaximumQOS
public QOS getMaximumQOS()
Returns the maximum message delivery quality of service that the server will allow on this connection. See MQTT5 Maximum QoS- Returns:
- The maximum message delivery quality of service that the server will allow on this connection.
-
getRetainAvailable
public Boolean getRetainAvailable()
Returns an indicator whether the server supports retained messages. If null, retained messages are supported. See MQTT5 Retain Available- Returns:
- Whether the server supports retained messages
-
getMaximumPacketSize
public Long getMaximumPacketSize()
Returns the maximum packet size, in bytes, that the server is willing to accept. If null, there is no limit beyond what is imposed by the MQTT spec itself. See MQTT5 Maximum Packet Size- Returns:
- The maximum packet size, in bytes, that the server is willing to accept.
-
getAssignedClientIdentifier
public String getAssignedClientIdentifier()
Returns a client identifier assigned to this connection by the server. Only valid when the client id of the preceding ConnectPacket was left empty. See MQTT5 Assigned Client Identifier- Returns:
- Client identifier assigned to this connection by the server
-
getTopicAliasMaximum
public Integer getTopicAliasMaximum()
Returns the maximum topic alias value that the server will accept from the client. See MQTT5 Topic Alias Maximum- Returns:
- maximum allowed topic alias value
-
getReasonString
public String getReasonString()
Returns additional diagnostic information about the result of the connection attempt. See MQTT5 Reason String- Returns:
- Additional diagnostic information about the result of the connection attempt.
-
getUserProperties
public List<UserProperty> getUserProperties()
Returns a list of MQTT5 user properties included with the packet. See MQTT5 User Property- Returns:
- List of MQTT5 user properties included with the packet.
-
getWildcardSubscriptionsAvailable
public Boolean getWildcardSubscriptionsAvailable()
Returns whether the server supports wildcard subscriptions. If null, wildcard subscriptions are supported. See MQTT5 Wildcard Subscriptions Available- Returns:
- Whether the server supports wildcard subscriptions.
-
getSubscriptionIdentifiersAvailable
public Boolean getSubscriptionIdentifiersAvailable()
Returns whether the server supports subscription identifiers. If null, subscription identifiers are supported. See MQTT5 Subscription Identifiers Available- Returns:
- whether the server supports subscription identifiers.
-
getSharedSubscriptionsAvailable
public Boolean getSharedSubscriptionsAvailable()
Returns whether the server supports shared subscription topic filters. If null, shared subscriptions are supported. See MQTT5 Shared Subscriptions Available- Returns:
- whether the server supports shared subscription topic filters.
-
getServerKeepAliveSeconds
public Integer getServerKeepAliveSeconds()
Returns server-requested override of the keep alive interval, in seconds. If null, the keep alive value sent by the client should be used. See MQTT5 Server Keep Alive- Returns:
- Server-requested override of the keep alive interval, in seconds
-
getServerKeepAlive
public Integer getServerKeepAlive()
Deprecated.prefer getServerKeepAliveSecondsReturns server-requested override of the keep alive interval, in seconds. If null, the keep alive value sent by the client should be used. See MQTT5 Server Keep Alive- Returns:
- Server-requested override of the keep alive interval, in seconds
-
getResponseInformation
public String getResponseInformation()
Returns a value that can be used in the creation of a response topic associated with this connection. MQTT5-based request/response is outside the purview of the MQTT5 spec and this client. See MQTT5 Response Information- Returns:
- A value that can be used in the creation of a response topic associated with this connection.
-
getServerReference
public String getServerReference()
Returns property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint. Will only be set if the reason code indicates another server may be used (ServerMoved, UseAnotherServer). See MQTT5 Server Reference- Returns:
- Property indicating an alternate server that the client may temporarily or permanently attempt to connect to instead of the configured endpoint.
-
-