Enum Class RetainHandling

java.lang.Object
java.lang.Enum<RetainHandling>
org.mqtt4j.hato.RetainHandling
All Implemented Interfaces:
Serializable, Comparable<RetainHandling>, Constable

public enum RetainHandling extends Enum<RetainHandling>
When the broker sends the retained messages that match a subscription as it makes the subscription (the MQTT 5.0 Retain Handling option). See Subscribe.withRetainHandling(RetainHandling).
  • Enum Constant Details

    • SEND

      public static final RetainHandling SEND
      Send them whenever the subscription is made, as MQTT 3.1.1 does.
    • SEND_IF_NEW_SUBSCRIPTION

      public static final RetainHandling SEND_IF_NEW_SUBSCRIPTION
      Send them only when the subscription did not exist in the session. A broker that resumes no session for the client, for example after a connection with Session Present false, sees the client's re-created subscriptions as new, so retained messages can arrive after each such reconnection.
    • DO_NOT_SEND

      public static final RetainHandling DO_NOT_SEND
      Do not send them when the subscription is made.
  • Method Details

    • values

      public static RetainHandling[] 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 RetainHandling 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