Package software.amazon.awssdk.crt.mqtt5
Class TopicAliasingOptions
- java.lang.Object
-
- software.amazon.awssdk.crt.mqtt5.TopicAliasingOptions
-
public class TopicAliasingOptions extends Object
Configuration for all client topic aliasing behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TopicAliasingOptions.InboundTopicAliasBehaviorType
An enumeration that controls whether or not the client allows the broker to send publishes that use topic aliasing.static class
TopicAliasingOptions.OutboundTopicAliasBehaviorType
An enumeration that controls how the client applies topic aliasing to outbound publish packets.
-
Constructor Summary
Constructors Constructor Description TopicAliasingOptions()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicAliasingOptions
withInboundBehavior(TopicAliasingOptions.InboundTopicAliasBehaviorType behavior)
Controls whether or not the client allows the broker to use topic aliasing when sending publishes.TopicAliasingOptions
withInboundCacheMaxSize(int size)
If inbound topic aliasing is enabled, this will control the size of the inbound alias cache.TopicAliasingOptions
withOutboundBehavior(TopicAliasingOptions.OutboundTopicAliasBehaviorType behavior)
Controls what kind of outbound topic aliasing behavior the client should attempt to use.TopicAliasingOptions
withOutboundCacheMaxSize(int size)
If outbound topic aliasing is set to LRU, this controls the maximum size of the cache.
-
-
-
Method Detail
-
withOutboundBehavior
public TopicAliasingOptions withOutboundBehavior(TopicAliasingOptions.OutboundTopicAliasBehaviorType behavior)
Controls what kind of outbound topic aliasing behavior the client should attempt to use. If topic aliasing is not supported by the server, this setting has no effect and any attempts to directly manipulate the topic alias id in outbound publishes will be ignored. By default, outbound topic aliasing is disabled.- Parameters:
behavior
- outbound topic alias behavior to use- Returns:
- the topic aliasing options object
-
withOutboundCacheMaxSize
public TopicAliasingOptions withOutboundCacheMaxSize(int size)
If outbound topic aliasing is set to LRU, this controls the maximum size of the cache. If outbound topic aliasing is set to LRU and this is zero or undefined, a sensible default is used (25). If outbound topic aliasing is not set to LRU, then this setting has no effect. The final size of the cache is determined by the minimum of this setting and the value of the topic_alias_maximum property of the received CONNACK. If the received CONNACK does not have an explicit positive value for that field, outbound topic aliasing is disabled for the duration of that connection.- Parameters:
size
- maximum size to use for the outbound alias cache- Returns:
- the topic aliasing options object
-
withInboundBehavior
public TopicAliasingOptions withInboundBehavior(TopicAliasingOptions.InboundTopicAliasBehaviorType behavior)
Controls whether or not the client allows the broker to use topic aliasing when sending publishes. Even if inbound topic aliasing is enabled, it is up to the server to choose whether or not to use it. If left undefined, then inbound topic aliasing is disabled.- Parameters:
behavior
- inbound topic alias behavior to use- Returns:
- the topic aliasing options object
-
withInboundCacheMaxSize
public TopicAliasingOptions withInboundCacheMaxSize(int size)
If inbound topic aliasing is enabled, this will control the size of the inbound alias cache. If inbound aliases are enabled and this is zero or undefined, then a sensible default will be used (25). If inbound aliases are disabled, this setting has no effect. Behaviorally, this value overrides anything present in the topic_alias_maximum field of the CONNECT packet options.- Parameters:
size
- maximum size to use for the inbound alias cache- Returns:
- the topic aliasing options object
-
-