Interface TopicPermissionBuilder
@DoNotImplement public interface TopicPermissionBuilder
This builder allows to create
TopicPermissions that can be used in the extension system.- Since:
- 4.0.0, CE 2019.1
-
Method Summary
Modifier and Type Method Description @NotNull TopicPermissionBuilderactivity(TopicPermission.MqttActivity activity)Set an Activity for thisTopicPermission.@NotNull TopicPermissionbuild()Builds theTopicPermissionwith the provided values or default values.@NotNull TopicPermissionBuilderqos(TopicPermission.Qos qos)Set a QoS for thisTopicPermission.@NotNull TopicPermissionBuilderretain(TopicPermission.Retain retain)Set a Retain for thisTopicPermission.@NotNull TopicPermissionBuildersharedGroup(@NotNull String sharedGroup)Set a shared group for thisTopicPermission.@NotNull TopicPermissionBuildersharedSubscription(TopicPermission.SharedSubscription sharedSubscription)Set a SharedSubscription for thisTopicPermission.@NotNull TopicPermissionBuildertopicFilter(@NotNull String topicFilter)Set a topic filter for thisTopicPermission.@NotNull TopicPermissionBuildertype(TopicPermission.PermissionType type)Set a type for thisTopicPermission.
-
Method Details
-
topicFilter
Set a topic filter for thisTopicPermission.This value has no default and must be set.
- Parameters:
topicFilter- The topic filter to set.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the topic filter is null.IllegalArgumentException- If the topic filter is an empty string.IllegalArgumentException- If the topic filter contains invalid UTF-8 characters.IllegalArgumentException- If the topic filter is longer than the configured maximum. Default maximum length is 65535.- Since:
- 4.0.0, CE 2019.1
-
type
Set a type for thisTopicPermission.DEFAULT:
ALLOW.- Parameters:
type- TheTopicPermission.PermissionTypeto use.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the type is null.- Since:
- 4.0.0, CE 2019.1
-
qos
Set a QoS for thisTopicPermission.DEFAULT:
ALL.- Parameters:
qos- TheTopicPermission.Qosto use.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the qos is null.- Since:
- 4.0.0, CE 2019.1
-
activity
Set an Activity for thisTopicPermission.DEFAULT:
ALL.- Parameters:
activity- TheTopicPermission.MqttActivityto use.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the activity is null.- Since:
- 4.0.0, CE 2019.1
-
retain
Set a Retain for thisTopicPermission.This value is only used for PUBLISH actions. For SUBSCRIBE actions this value is ignored.
DEFAULT:
ALL.- Parameters:
retain- TheTopicPermission.Retainto use.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the retain is null.- Since:
- 4.0.0, CE 2019.1
-
sharedSubscription
@NotNull @NotNull TopicPermissionBuilder sharedSubscription(@NotNull TopicPermission.SharedSubscription sharedSubscription)Set a SharedSubscription for thisTopicPermission.This value is only used for SUBSCRIBE actions. For PUBLISH actions this value is ignored.
DEFAULT:
ALL.- Parameters:
sharedSubscription- TheTopicPermission.SharedSubscriptionto use.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the sharedSubscription is null.- Since:
- 4.0.0, CE 2019.1
-
sharedGroup
Set a shared group for thisTopicPermission. The value can be either#which allows all shared group names, or a specific group name must be set.This value is only used for SUBSCRIBE actions. For PUBLISH actions this value is ignored. This value is only used when the Subscription's topic filter is a shared subscription. For regular subscriptions this value is ignored.
DEFAULT:
#.Limitations for shared group:
- Must not be an empty string
- Must not contain a slash '/'
- Must not contain the wildcard '+'
- Must not contain the wildcard '#' if string length is > 1
- Must not contain an invalid UTF-8 character
- Parameters:
sharedGroup- The shared group that can be used, or#to allow any value.- Returns:
- The
TopicPermissionBuilder. - Throws:
NullPointerException- If the sharedGroup is null.IllegalArgumentException- If an invalid shared group name is passed.IllegalArgumentException- If the shared group contains invalid UTF-8 characters.- Since:
- 4.0.0, CE 2019.1
-
build
Builds theTopicPermissionwith the provided values or default values.- Returns:
- A
TopicPermissionwith the set parameters. - Throws:
NullPointerException- If the topic is null.- Since:
- 4.0.0, CE 2019.1
-