Interface Subscription

All Known Subinterfaces:
ModifiableSubscription

@Immutable
@DoNotImplement
public interface Subscription
Represents a subscription from a SUBSCRIBE packet.

Contains all values of an MQTT 5 SUBSCRIBE, but will also used to represent MQTT 3 subscribes.

Since:
4.0.0, CE 2019.1
  • Method Summary

    Modifier and Type Method Description
    boolean getNoLocal()
    The no local flag indicates if the client wants to receive messages published by itself to the topic filter of the subscription.
    @NotNull Qos getQos()
    The quality of service level of the subscription.
    boolean getRetainAsPublished()
    The retain as published flag indicates if the client wants the retain flag preserved for received messages to the topic filter of the subscription.
    @NotNull RetainHandling getRetainHandling()
    The retain handling states how a retained message should be send for a subscription.
    @NotNull String getTopicFilter()
    The topic filter the client wants to subscribe to.
  • Method Details

    • getTopicFilter

      @NotNull @NotNull String getTopicFilter()
      The topic filter the client wants to subscribe to.
      Returns:
      The topic filter of the subscription.
      Since:
      4.0.0, CE 2019.1
    • getQos

      The quality of service level of the subscription.
      Returns:
      The quality of service level of the subscription.
      Since:
      4.0.0, CE 2019.1
    • getRetainHandling

      @NotNull @NotNull RetainHandling getRetainHandling()
      The retain handling states how a retained message should be send for a subscription.

      For an MQTT 3 subscription this MQTT 5 property will always be RetainHandling.SEND.

      Returns:
      The retain handling of the subscription.
      Since:
      4.0.0, CE 2019.1
    • getRetainAsPublished

      boolean getRetainAsPublished()
      The retain as published flag indicates if the client wants the retain flag preserved for received messages to the topic filter of the subscription.

      If true the retain flag is preserved. If false it isn't.

      For an MQTT 3 subscription this MQTT 5 property will always be false.

      Returns:
      The retain as published flag of the subscription.
      Since:
      4.0.0, CE 2019.1
    • getNoLocal

      boolean getNoLocal()
      The no local flag indicates if the client wants to receive messages published by itself to the topic filter of the subscription.

      If false the client also receives it's own messages. If true it doesn't.

      For an MQTT 3 subscription this MQTT 5 property will always be false.

      Returns:
      The no local flag of the subscription.
      Since:
      4.0.0, CE 2019.1