Class TopicDescription
- java.lang.Object
-
- com.microsoft.azure.servicebus.management.TopicDescription
-
public class TopicDescription extends Object
Represents the metadata description of the topic.
-
-
Constructor Summary
Constructors Constructor Description TopicDescription(String path)Initializes a new instance of TopicDescription with the specified relative path.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)List<AuthorizationRule>getAuthorizationRules()DurationgetAutoDeleteOnIdle()DurationgetDefaultMessageTimeToLive()Time-To-live is the duration after which the message expires, starting from when the message is sent to Service Bus.DurationgetDuplicationDetectionHistoryTimeWindow()EntityStatusgetEntityStatus()Gets the status of the entity.longgetMaxSizeInMB()StringgetPath()StringgetUserMetadata()inthashCode()booleanisEnableBatchedOperations()booleanisEnablePartitioning()booleanisRequiresDuplicateDetection()If enabled, duplicate messages having sameIMessage.getMessageId()and sent to queue within duration ofgetDuplicationDetectionHistoryTimeWindow()will be discarded.booleanisSupportOrdering()voidsetAuthorizationRules(List<AuthorizationRule> authorizationRules)voidsetAutoDeleteOnIdle(Duration autoDeleteOnIdle)voidsetDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)voidsetDuplicationDetectionHistoryTimeWindow(Duration duplicationDetectionHistoryTimeWindow)voidsetEnableBatchedOperations(boolean enableBatchedOperations)voidsetEnablePartitioning(boolean enablePartitioning)voidsetEntityStatus(EntityStatus status)voidsetMaxSizeInMB(long maxSize)voidsetRequiresDuplicateDetection(boolean requiresDuplicateDetection)voidsetSupportOrdering(boolean supportOrdering)voidsetUserMetadata(String userMetadata)
-
-
-
Constructor Detail
-
TopicDescription
public TopicDescription(String path)
Initializes a new instance of TopicDescription with the specified relative path.- Parameters:
path- - Path of the topic. Max length is 260 chars. Cannot start or end with a slash. Cannot have restricted characters: '@','?','#','*'
-
-
Method Detail
-
getPath
public String getPath()
- Returns:
- the path of the topic.
-
getMaxSizeInMB
public long getMaxSizeInMB()
- Returns:
- the maximum size of the topic in megabytes, which is the size of memory allocated for the topic. Default value is 1024.
-
setMaxSizeInMB
public void setMaxSizeInMB(long maxSize)
- Parameters:
maxSize- - Sets the maximum size of the topic in megabytes, which is the size of memory allocated for the topic.
-
isRequiresDuplicateDetection
public boolean isRequiresDuplicateDetection()
If enabled, duplicate messages having sameIMessage.getMessageId()and sent to queue within duration ofgetDuplicationDetectionHistoryTimeWindow()will be discarded.- Returns:
- value indicating if the queue requires guard against duplicate messages.
-
setRequiresDuplicateDetection
public void setRequiresDuplicateDetection(boolean requiresDuplicateDetection)
- Parameters:
requiresDuplicateDetection- - Set to true if duplicate detection needs to be enabled. See also -isRequiresDuplicateDetection()
-
getDefaultMessageTimeToLive
public Duration getDefaultMessageTimeToLive()
Time-To-live is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used whenIMessage.getTimeToLive()is not set on a message itself. Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages.- Returns:
- The default time to live value for the messages. Default value is
ManagementClientConstants.MAX_DURATION
-
setDefaultMessageTimeToLive
public void setDefaultMessageTimeToLive(Duration defaultMessageTimeToLive)
- Parameters:
defaultMessageTimeToLive- - Sets the default message time to live value. Value cannot be lower than 1 second. SeegetDefaultMessageTimeToLive()
-
getAutoDeleteOnIdle
public Duration getAutoDeleteOnIdle()
- Returns:
- The idle interval after which the topic is automatically deleted.
Default value is
ManagementClientConstants.MAX_DURATION
-
setAutoDeleteOnIdle
public void setAutoDeleteOnIdle(Duration autoDeleteOnIdle)
- Parameters:
autoDeleteOnIdle- - The idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes.
-
getDuplicationDetectionHistoryTimeWindow
public Duration getDuplicationDetectionHistoryTimeWindow()
- Returns:
- The duration of duplicate detection history that is maintained by the service. The default value is 1 minute.
-
setDuplicationDetectionHistoryTimeWindow
public void setDuplicationDetectionHistoryTimeWindow(Duration duplicationDetectionHistoryTimeWindow)
- Parameters:
duplicationDetectionHistoryTimeWindow- - The duration of duplicate detection history that is maintained by the service. Max value is 1 day and minimum is 20 seconds.
-
isEnableBatchedOperations
public boolean isEnableBatchedOperations()
- Returns:
- Indicates whether server-side batched operations are enabled. Defaults to true.
-
setEnableBatchedOperations
public void setEnableBatchedOperations(boolean enableBatchedOperations)
- Parameters:
enableBatchedOperations- - Indicates whether server-side batched operations are enabled.
-
getAuthorizationRules
public List<AuthorizationRule> getAuthorizationRules()
- Returns:
- The
AuthorizationRuleon the topic to control user access at entity level.
-
setAuthorizationRules
public void setAuthorizationRules(List<AuthorizationRule> authorizationRules)
- Parameters:
authorizationRules- - TheAuthorizationRuleon the topic to control user access at entity level.
-
getEntityStatus
public EntityStatus getEntityStatus()
Gets the status of the entity. When an entity is disabled, that entity cannot send or receive messages.- Returns:
- The current status of the topic (Enabled / Disabled). The default value is Enabled.
-
setEntityStatus
public void setEntityStatus(EntityStatus status)
- Parameters:
status- - the status of the topic (Enabled / Disabled). When an entity is disabled, that entity cannot send or receive messages.
-
isEnablePartitioning
public boolean isEnablePartitioning()
- Returns:
- boolean indicating whether the topic is to be partitioned across multiple message brokers. Defaults to false
-
setEnablePartitioning
public void setEnablePartitioning(boolean enablePartitioning)
- Parameters:
enablePartitioning- - true if topic is to be partitioned across multiple message brokers.
-
isSupportOrdering
public boolean isSupportOrdering()
- Returns:
- Defines whether ordering needs to be maintained. If true, messages sent to topic will be forwarded to the subscription in order. Defaults to false
-
setSupportOrdering
public void setSupportOrdering(boolean supportOrdering)
- Parameters:
supportOrdering- - Defines whether ordering needs to be maintained. If true, messages sent to topic will be forwarded to the subscription in order.
-
getUserMetadata
public String getUserMetadata()
- Returns:
- - Custom metdata that user can associate with the description.
-
setUserMetadata
public void setUserMetadata(String userMetadata)
- Parameters:
userMetadata- - Custom metdata that user can associate with the description. Cannot be null. Max length is 1024 chars
-
-