Package com.plccom.mqtt.client
Enum PlccomMqttRetainHandling
- java.lang.Object
-
- java.lang.Enum<PlccomMqttRetainHandling>
-
- com.plccom.mqtt.client.PlccomMqttRetainHandling
-
- All Implemented Interfaces:
Serializable,Comparable<PlccomMqttRetainHandling>
public enum PlccomMqttRetainHandling extends Enum<PlccomMqttRetainHandling>
MQTT 5 Retain Handling option used by SUBSCRIBE.The option controls whether the broker sends matching retained messages immediately after a subscription is created or replaced. MQTT 3.1.1 has no equivalent field, so these values can only be encoded on MQTT 5 connections.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DO_NOT_SENDAsk the broker not to send retained messages for this subscription.SEND_AT_SUBSCRIBEAsk the broker to send retained messages whenever the subscription is processed.SEND_AT_SUBSCRIBE_IF_NEWAsk the broker to send retained messages only when the subscription did not already exist.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCode()Returns the MQTT wire value.static PlccomMqttRetainHandlingvalueOf(String name)Returns the enum constant of this type with the specified name.static PlccomMqttRetainHandling[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SEND_AT_SUBSCRIBE
public static final PlccomMqttRetainHandling SEND_AT_SUBSCRIBE
Ask the broker to send retained messages whenever the subscription is processed.
-
SEND_AT_SUBSCRIBE_IF_NEW
public static final PlccomMqttRetainHandling SEND_AT_SUBSCRIBE_IF_NEW
Ask the broker to send retained messages only when the subscription did not already exist.
-
DO_NOT_SEND
public static final PlccomMqttRetainHandling DO_NOT_SEND
Ask the broker not to send retained messages for this subscription.
-
-
Method Detail
-
values
public static PlccomMqttRetainHandling[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PlccomMqttRetainHandling c : PlccomMqttRetainHandling.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PlccomMqttRetainHandling valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()
Returns the MQTT wire value.- Returns:
- MQTT 5 Retain Handling option value
-
-