Class MqttSubscriptionRefusedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.mqtt4j.hato.MqttException
org.mqtt4j.hato.MqttSubscriptionRefusedException
- All Implemented Interfaces:
Serializable
The broker refused a subscription, or would refuse it. A refusal arrives in SUBACK with a
reason code of 0x80 or greater; the MQTT 3.1.1 failure (
0x80) is represented by
ReasonCode.UNSPECIFIED_ERROR. A subscription that the broker announced it does not support
is not sent and fails with the reason code that the broker would use:
ReasonCode.WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED without
ConnAck.wildcardSubscriptionAvailable(), and
ReasonCode.SHARED_SUBSCRIPTIONS_NOT_SUPPORTED without
ConnAck.sharedSubscriptionAvailable(), and ReasonCode.PACKET_TOO_LARGE when its SUBSCRIBE
would be larger than ConnAck.maximumPacketSize(). Either way the failed subscription is
removed locally, and the connection goes on.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMqttSubscriptionRefusedException(ReasonCode reasonCode) A refusal without an explanation, such as the one that the client makes itself.MqttSubscriptionRefusedException(ReasonCode reasonCode, @Nullable String reasonString) A refusal with the broker's explanation, if the broker sent one. -
Method Summary
Modifier and TypeMethodDescriptionReturns the reason for the refusal, received in SUBACK, or the one that the broker would use for a subscription that it announced it does not support.Returns the broker's explanation for people diagnosing the refusal, received in SUBACK, or empty when the broker sent none or the client refused without sending.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MqttSubscriptionRefusedException
A refusal without an explanation, such as the one that the client makes itself.- Parameters:
reasonCode- the reason for the refusal
-
MqttSubscriptionRefusedException
A refusal with the broker's explanation, if the broker sent one.- Parameters:
reasonCode- the reason for the refusalreasonString- the broker's explanation, or null when it sent none
-
-
Method Details
-
reasonCode
Returns the reason for the refusal, received in SUBACK, or the one that the broker would use for a subscription that it announced it does not support.- Returns:
- the reason for the refusal, received in SUBACK, or the one that the broker would use for a subscription that it announced it does not support
-
reasonString
Returns the broker's explanation for people diagnosing the refusal, received in SUBACK, or empty when the broker sent none or the client refused without sending.- Returns:
- the broker's explanation for people diagnosing the refusal, received in SUBACK, or empty when the broker sent none or the client refused without sending
-