Interface SubscribePacket
@DoNotImplement public interface SubscribePacket
Represents a SUBSCRIBE packet.
Contains all values of an MQTT 5 SUBSCRIBE, but will also be used to represent MQTT 3 subscribe messages.
- Since:
- 4.2.0, CE 2020.1
-
Method Summary
Modifier and Type Method Description intgetPacketId()The packet identifier of the SUBSCRIBE packet.@NotNull Optional<Integer>getSubscriptionIdentifier()If this property is present, it contains the subscription identifier for the SUBSCRIBE packet.@Immutable @NotNull List<Subscription>getSubscriptions()The list of unmodifiable subscriptions of the SUBSCRIBE.@Immutable @NotNull UserPropertiesgetUserProperties()The user properties from the SUBSCRIBE packet.
-
Method Details
-
getSubscriptions
The list of unmodifiable subscriptions of the SUBSCRIBE.- Returns:
- The list of
Subscriptions. - Since:
- 4.2.0, CE 2020.1
-
getUserProperties
The user properties from the SUBSCRIBE packet.For an MQTT 3 client this MQTT 5 property will always contain an empty list as the user properties.
- Returns:
- The
UserPropertiesof the SUBSCRIBE packet. - Since:
- 4.2.0, CE 2020.1
-
getSubscriptionIdentifier
If this property is present, it contains the subscription identifier for the SUBSCRIBE packet.For an MQTT 3 client this
Optionalfor the MQTT 5 property will always be empty.- Returns:
- An
Optionalcontaining the subscription identifier of the SUBSCRIBE packet if present. - Since:
- 4.2.0, CE 2020.1
-
getPacketId
int getPacketId()The packet identifier of the SUBSCRIBE packet.- Returns:
- The packet identifier.
- Since:
- 4.2.0, CE 2020.1
-