Enum Class MqttGlobalPublishFilter

java.lang.Object
java.lang.Enum<MqttGlobalPublishFilter>
com.hivemq.client.mqtt.MqttGlobalPublishFilter
All Implemented Interfaces:
Serializable, Comparable<MqttGlobalPublishFilter>, Constable

public enum MqttGlobalPublishFilter extends Enum<MqttGlobalPublishFilter>
Global filter for incoming Publish messages.

Global means not filtering for individual subscriptions of a Subscribe message.

Since:
1.0
  • Enum Constant Details

    • ALL

      public static final MqttGlobalPublishFilter ALL
      Filter matching all incoming Publish messages.

      ALL = SUBSCRIBED + UNSOLICITED.

    • SUBSCRIBED

      public static final MqttGlobalPublishFilter SUBSCRIBED
      Filter matching the incoming Publish messages resulting from subscriptions made by the client.

      SUBSCRIBED + UNSOLICITED = ALL.

    • UNSOLICITED

      public static final MqttGlobalPublishFilter UNSOLICITED
      Filter matching the incoming Publish messages not resulting from any subscription made by the client.

      UNSOLICITED + SUBSCRIBED = ALL.

    • REMAINING

      public static final MqttGlobalPublishFilter REMAINING
      Filter matching the incoming Publish messages that are not consumed in per subscription or other global flows.

      This filter will not match any messages if

      Example (pseudo-code):

      • stream1 = client.subscribePublishes("a/#")
      • client.subscribe("b/#")
      • stream2 = client.publishes(SUBSCRIBED)
      • stream3 = client.publishes(REMAINING)
      Result: incoming Publishes with topic
      • "a/b" will be emitted in stream1 and stream2.
      • "b/c" will be emitted in stream2
      • "c/d" will be emitted in stream3 as there is no other stream registered for the topic.
  • Method Details

    • values

      public static MqttGlobalPublishFilter[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static MqttGlobalPublishFilter valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null