Interface TopicPermissionBuilder
-
@DoNotImplement public interface TopicPermissionBuilder
This builder allows to createTopicPermission
s that can be used in the extension system.- Since:
- 4.0.0, CE 2019.1
-
-
Method Summary
-
-
-
Method Detail
-
topicFilter
@NotNull TopicPermissionBuilder topicFilter(@NotNull String 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
@NotNull TopicPermissionBuilder type(@NotNull TopicPermission.PermissionType type)
Set a type for thisTopicPermission
.DEFAULT:
ALLOW
.- Parameters:
type
- TheTopicPermission.PermissionType
to use.- Returns:
- The
TopicPermissionBuilder
. - Throws:
NullPointerException
- If the type is null.- Since:
- 4.0.0, CE 2019.1
-
qos
@NotNull TopicPermissionBuilder qos(@NotNull TopicPermission.Qos qos)
Set a QoS for thisTopicPermission
.DEFAULT:
ALL
.- Parameters:
qos
- TheTopicPermission.Qos
to use.- Returns:
- The
TopicPermissionBuilder
. - Throws:
NullPointerException
- If the qos is null.- Since:
- 4.0.0, CE 2019.1
-
activity
@NotNull TopicPermissionBuilder activity(@NotNull TopicPermission.MqttActivity activity)
Set an Activity for thisTopicPermission
.DEFAULT:
ALL
.- Parameters:
activity
- TheTopicPermission.MqttActivity
to use.- Returns:
- The
TopicPermissionBuilder
. - Throws:
NullPointerException
- If the activity is null.- Since:
- 4.0.0, CE 2019.1
-
retain
@NotNull TopicPermissionBuilder retain(@NotNull TopicPermission.Retain 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.Retain
to use.- Returns:
- The
TopicPermissionBuilder
. - Throws:
NullPointerException
- If the retain is null.- Since:
- 4.0.0, CE 2019.1
-
sharedSubscription
@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.SharedSubscription
to use.- Returns:
- The
TopicPermissionBuilder
. - Throws:
NullPointerException
- If the sharedSubscription is null.- Since:
- 4.0.0, CE 2019.1
-
sharedGroup
@NotNull TopicPermissionBuilder sharedGroup(@NotNull String 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
@NotNull TopicPermission build()
Builds theTopicPermission
with the provided values or default values.- Returns:
- A
TopicPermission
with the set parameters. - Throws:
NullPointerException
- If the topic is null.- Since:
- 4.0.0, CE 2019.1
-
-