Interface MqttClientIdentifier

All Superinterfaces:
Comparable<MqttUtf8String>, MqttUtf8String

@DoNotImplement public interface MqttClientIdentifier extends MqttUtf8String
MQTT Client Identifier according to the MQTT specification.

A Client Identifier has the same requirements as an UTF-8 encoded string.

Since:
1.0
  • Method Details

    • of

      Validates and creates a Client Identifier of the given string.
      Parameters:
      string - the string representation of the Client Identifier.
      Returns:
      the created Client Identifier.
      Throws:
      IllegalArgumentException - if the string is not a valid Client Identifier.
    • mustBeAllowedByServer

      boolean mustBeAllowedByServer()
      Checks whether this Client Identifier must be allowed by every MQTT broker according to the MQTT specification.

      A Client Identifier must be allowed by every MQTT broker if it is between 1 and 23 characters long and only contains lower or uppercase alphabetical characters or numbers.

      Returns:
      whether this Client Identifier must be allowed by every MQTT broker.