Interface MqttSharedTopicFilter

All Superinterfaces:
Comparable<MqttUtf8String>, MqttTopicFilter, MqttUtf8String

@DoNotImplement public interface MqttSharedTopicFilter extends MqttTopicFilter
MQTT Shared Topic Filter according to the MQTT specification.

A Shared Topic Filter consists of the share prefix ("$share/"), a Share Name and a Topic Filter.

The Share Name has the same requirements as an UTF-8 encoded string. Additionally it

  • must be at least 1 character long,
  • must not contain wildcard characters ('#', '+') and
  • must not contain a topic level separator ('/')

The Topic Filter has the same restrictions as a Topic Filter.

Since:
1.0
  • Field Details

    • SHARE_PREFIX

      @NotNull static final @NotNull String SHARE_PREFIX
      The prefix of a Shared Topic Filter.
      See Also:
  • Method Details

    • of

      @NotNull static @NotNull MqttSharedTopicFilter of(@NotNull @NotNull String shareName, @NotNull @NotNull String topicFilter)
      Validates and creates a Shared Topic Filter of the given Share Name and Topic Filter.
      Parameters:
      shareName - the string representation of the Share Name.
      topicFilter - the string representation of the Topic Filter.
      Returns:
      the created Shared Topic Filter.
      Throws:
      IllegalArgumentException - if the Share Name string is not a valid Share Name or the Topic Filter string is not a valid Topic Filter.
    • builder

      @NotNull static @NotNull MqttSharedTopicFilterBuilder builder(@NotNull @NotNull String shareName)
      Creates a builder for a Shared Topic Filter.
      Parameters:
      shareName - the string representation of the Share Name.
      Returns:
      the created builder.
    • getShareName

      @NotNull @NotNull String getShareName()
      Returns:
      the Share Name of this Shared Topic Filter as a string.
    • getTopicFilter

      @NotNull @NotNull MqttTopicFilter getTopicFilter()
      Returns:
      the Topic Filter of this Shared Topic Filter.
    • extendShared

      @NotNull MqttSharedTopicFilterBuilder.Complete extendShared()
      Creates a builder for extending this Shared Topic Filter.
      Returns:
      the created builder.