Class ManagementClient
- java.lang.Object
-
- com.microsoft.azure.servicebus.management.ManagementClient
-
public class ManagementClient extends Object
Synchronous client to perform management operations on Service Bus entities. UseManagementClientAsyncfor asynchronous operations.
-
-
Constructor Summary
Constructors Constructor Description ManagementClient(ConnectionStringBuilder connectionStringBuilder)ManagementClient(URI namespaceEndpointURI, ClientSettings clientSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Disposes and closes the managementClient.QueueDescriptioncreateQueue(QueueDescription queueDescription)Creates a new queue in the service namespace with the given name.QueueDescriptioncreateQueue(String queuePath)Creates a new queue in the service namespace with the given name.RuleDescriptioncreateRule(String topicName, String subscriptionName, RuleDescription ruleDescription)Creates a new rule for a given topic - subscription.SubscriptionDescriptioncreateSubscription(SubscriptionDescription subscriptionDescription)Creates a new subscription in the service namespace with the given name.SubscriptionDescriptioncreateSubscription(SubscriptionDescription subscriptionDescription, RuleDescription defaultRule)Creates a new subscription in the service namespace with the provided default rule.SubscriptionDescriptioncreateSubscription(String topicPath, String subscriptionName)Creates a new subscription for a given topic in the service namespace with the given name.TopicDescriptioncreateTopic(TopicDescription topicDescription)Creates a new topic in the service namespace with the given name.TopicDescriptioncreateTopic(String topicPath)Creates a new topic in the service namespace with the given name.VoiddeleteQueue(String path)Deletes the queue described by the path relative to the service namespace base address.VoiddeleteRule(String topicPath, String subscriptionName, String ruleName)Deletes the rule for a given topic-subscription.VoiddeleteSubscription(String topicPath, String subscriptionName)Deletes the subscription described by the topicPath and the subscriptionName.VoiddeleteTopic(String path)Deletes the topic described by the path relative to the service namespace base address.NamespaceInfogetNamespaceInfo()Retrieves information related to the namespace.QueueDescriptiongetQueue(String path)Retrieves a queue from the service namespaceQueueRuntimeInfogetQueueRuntimeInfo(String path)Retrieves the runtime information of a queue.List<QueueDescription>getQueues()Retrieves the list of queues present in the namespace.List<QueueDescription>getQueues(int count, int skip)Retrieves the list of queues present in the namespace.RuleDescriptiongetRule(String topicPath, String subscriptionName, String ruleName)Retrieves a rule for a given topic and subscription from the service namespaceList<RuleDescription>getRules(String topicName, String subscriptionName)Retrieves the list of rules for a given topic-subscription in the namespace.List<RuleDescription>getRules(String topicName, String subscriptionName, int count, int skip)Retrieves the list of rules for a given topic-subscription in the namespace.SubscriptionDescriptiongetSubscription(String topicPath, String subscriptionName)Retrieves a subscription for a given topic from the service namespaceSubscriptionRuntimeInfogetSubscriptionRuntimeInfo(String topicPath, String subscriptionName)Retrieves the runtime information of a subscription in a given topicList<SubscriptionDescription>getSubscriptions(String topicName)Retrieves the list of subscriptions for a given topic in the namespace.List<SubscriptionDescription>getSubscriptions(String topicName, int count, int skip)Retrieves the list of subscriptions for a given topic in the namespace.TopicDescriptiongetTopic(String path)Retrieves a topic from the service namespaceTopicRuntimeInfogetTopicRuntimeInfo(String path)Retrieves the runtime information of a topicList<TopicDescription>getTopics()Retrieves the list of topics present in the namespace.List<TopicDescription>getTopics(int count, int skip)Retrieves the list of topics present in the namespace.BooleanqueueExists(String path)Checks whether a given queue exists or not.BooleanruleExists(String topicPath, String subscriptionName, String ruleName)Checks whether a given rule exists or not for a given subscription.BooleansubscriptionExists(String topicPath, String subscriptionName)Checks whether a given subscription exists or not.BooleantopicExists(String path)Checks whether a given topic exists or not.QueueDescriptionupdateQueue(QueueDescription queueDescription)Updates an existing queue.RuleDescriptionupdateRule(String topicName, String subscriptionName, RuleDescription ruleDescription)Updates an existing rule.SubscriptionDescriptionupdateSubscription(SubscriptionDescription subscriptionDescription)Updates an existing subscription.TopicDescriptionupdateTopic(TopicDescription topicDescription)Updates an existing topic.
-
-
-
Constructor Detail
-
ManagementClient
public ManagementClient(ConnectionStringBuilder connectionStringBuilder)
-
ManagementClient
public ManagementClient(URI namespaceEndpointURI, ClientSettings clientSettings)
-
-
Method Detail
-
getNamespaceInfo
public NamespaceInfo getNamespaceInfo() throws ServiceBusException, InterruptedException
Retrieves information related to the namespace. Works with any claim (Send/Listen/Manage).- Returns:
- -
NamespaceInfocontaining namespace information. - Throws:
ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getQueue
public QueueDescription getQueue(String path) throws ServiceBusException, InterruptedException
Retrieves a queue from the service namespace- Parameters:
path- - The path of the queue relative to service bus namespace.- Returns:
- - QueueDescription containing information about the queue.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getQueueRuntimeInfo
public QueueRuntimeInfo getQueueRuntimeInfo(String path) throws ServiceBusException, InterruptedException
Retrieves the runtime information of a queue.- Parameters:
path- - The path of the queue relative to service bus namespace.- Returns:
- - QueueRuntimeInfo containing runtime information about the queue.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getTopic
public TopicDescription getTopic(String path) throws ServiceBusException, InterruptedException
Retrieves a topic from the service namespace- Parameters:
path- - The path of the queue relative to service bus namespace.- Returns:
- - Description containing information about the topic.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getTopicRuntimeInfo
public TopicRuntimeInfo getTopicRuntimeInfo(String path) throws ServiceBusException, InterruptedException
Retrieves the runtime information of a topic- Parameters:
path- - The path of the queue relative to service bus namespace.- Returns:
- - TopicRuntimeInfo containing runtime information about the topic.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getSubscription
public SubscriptionDescription getSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException
Retrieves a subscription for a given topic from the service namespace- Parameters:
topicPath- - The path of the topic relative to service bus namespace.subscriptionName- - The name of the subscription- Returns:
- - SubscriptionDescription containing information about the subscription.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getSubscriptionRuntimeInfo
public SubscriptionRuntimeInfo getSubscriptionRuntimeInfo(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException
Retrieves the runtime information of a subscription in a given topic- Parameters:
topicPath- - The path of the topic relative to service bus namespace.subscriptionName- - The name of the subscription- Returns:
- - SubscriptionRuntimeInfo containing the runtime information about the subscription.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getRule
public RuleDescription getRule(String topicPath, String subscriptionName, String ruleName) throws ServiceBusException, InterruptedException
Retrieves a rule for a given topic and subscription from the service namespace- Parameters:
topicPath- - The path of the topic relative to service bus namespace.subscriptionName- - The name of the subscription.ruleName- - The name of the rule.- Returns:
- - RuleDescription containing information about the subscription.
- Throws:
IllegalArgumentException- - Thrown if path is null, empty, or not in right format or length.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutMessagingEntityNotFoundException- - Entity with this name doesn't exist.AuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getQueues
public List<QueueDescription> getQueues() throws ServiceBusException, InterruptedException
Retrieves the list of queues present in the namespace.- Returns:
- the first 100 queues.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getQueues
public List<QueueDescription> getQueues(int count, int skip) throws ServiceBusException, InterruptedException
Retrieves the list of queues present in the namespace. You can simulate pages of list of entities by manipulating count and skip parameters. skip(0)+count(100) gives first 100 entities. skip(100)+count(100) gives the next 100 entities.- Parameters:
count- - The number of queues to fetch. Defaults to 100. Maximum value allowed is 100.skip- - The number of queues to skip. Defaults to 0. Cannot be negative.- Returns:
- the list of queues.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getTopics
public List<TopicDescription> getTopics() throws ServiceBusException, InterruptedException
Retrieves the list of topics present in the namespace.- Returns:
- the first 100 topics.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getTopics
public List<TopicDescription> getTopics(int count, int skip) throws ServiceBusException, InterruptedException
Retrieves the list of topics present in the namespace. You can simulate pages of list of entities by manipulating count and skip parameters. skip(0)+count(100) gives first 100 entities. skip(100)+count(100) gives the next 100 entities.- Parameters:
count- - The number of topics to fetch. Defaults to 100. Maximum value allowed is 100.skip- - The number of topics to skip. Defaults to 0. Cannot be negative.- Returns:
- the list of topics.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getSubscriptions
public List<SubscriptionDescription> getSubscriptions(String topicName) throws ServiceBusException, InterruptedException
Retrieves the list of subscriptions for a given topic in the namespace.- Parameters:
topicName- - The name of the topic.- Returns:
- the first 100 subscriptions.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getSubscriptions
public List<SubscriptionDescription> getSubscriptions(String topicName, int count, int skip) throws ServiceBusException, InterruptedException
Retrieves the list of subscriptions for a given topic in the namespace. You can simulate pages of list of entities by manipulating count and skip parameters. skip(0)+count(100) gives first 100 entities. skip(100)+count(100) gives the next 100 entities.- Parameters:
topicName- - The name of the topic.count- - The number of subscriptions to fetch. Defaults to 100. Maximum value allowed is 100.skip- - The number of subscriptions to skip. Defaults to 0. Cannot be negative.- Returns:
- the list of subscriptions.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getRules
public List<RuleDescription> getRules(String topicName, String subscriptionName) throws ServiceBusException, InterruptedException
Retrieves the list of rules for a given topic-subscription in the namespace.- Parameters:
topicName- - The name of the topic.subscriptionName- - The name of the subscription.- Returns:
- the first 100 rules.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
getRules
public List<RuleDescription> getRules(String topicName, String subscriptionName, int count, int skip) throws ServiceBusException, InterruptedException
Retrieves the list of rules for a given topic-subscription in the namespace. You can simulate pages of list of entities by manipulating count and skip parameters. skip(0)+count(100) gives first 100 entities. skip(100)+count(100) gives the next 100 entities.- Parameters:
topicName- - The name of the topic.subscriptionName- - The name of the subscription.count- - The number of rules to fetch. Defaults to 100. Maximum value allowed is 100.skip- - The number of rules to skip. Defaults to 0. Cannot be negative.- Returns:
- the list of rules.
- Throws:
TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
createQueue
public QueueDescription createQueue(String queuePath) throws ServiceBusException, InterruptedException
Creates a new queue in the service namespace with the given name. SeeQueueDescriptionfor default values of queue properties.- Parameters:
queuePath- - The name of the queue relative to the service namespace base address.- Returns:
QueueDescriptionof the newly created queue.- Throws:
IllegalArgumentException- - Entity name is null, empty, too long or uses illegal characters.MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createQueue
public QueueDescription createQueue(QueueDescription queueDescription) throws ServiceBusException, InterruptedException
Creates a new queue in the service namespace with the given name. SeeQueueDescriptionfor default values of queue properties.- Parameters:
queueDescription- - AQueueDescriptionobject describing the attributes with which the new queue will be created.- Returns:
QueueDescriptionof the newly created queue.- Throws:
MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
updateQueue
public QueueDescription updateQueue(QueueDescription queueDescription) throws ServiceBusException, InterruptedException
Updates an existing queue.- Parameters:
queueDescription- - AQueueDescriptionobject describing the attributes with which the queue will be updated.- Returns:
QueueDescriptionof the updated queue.- Throws:
MessagingEntityNotFoundException- - Described entity was not found.IllegalArgumentException- - descriptor is null.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createTopic
public TopicDescription createTopic(String topicPath) throws ServiceBusException, InterruptedException
Creates a new topic in the service namespace with the given name. SeeTopicDescriptionfor default values of topic properties.- Parameters:
topicPath- - The name of the topic relative to the service namespace base address.- Returns:
TopicDescriptionof the newly created topic.- Throws:
IllegalArgumentException- - Entity name is null, empty, too long or uses illegal characters.MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createTopic
public TopicDescription createTopic(TopicDescription topicDescription) throws ServiceBusException, InterruptedException
Creates a new topic in the service namespace with the given name. SeeTopicDescriptionfor default values of topic properties.- Parameters:
topicDescription- - AQueueDescriptionobject describing the attributes with which the new topic will be created.- Returns:
TopicDescriptionof the newly created topic.- Throws:
MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
updateTopic
public TopicDescription updateTopic(TopicDescription topicDescription) throws ServiceBusException, InterruptedException
Updates an existing topic.- Parameters:
topicDescription- - ATopicDescriptionobject describing the attributes with which the topic will be updated.- Returns:
TopicDescriptionof the updated topic.- Throws:
MessagingEntityNotFoundException- - Described entity was not found.IllegalArgumentException- - descriptor is null.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createSubscription
public SubscriptionDescription createSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException
Creates a new subscription for a given topic in the service namespace with the given name. SeeSubscriptionDescriptionfor default values of subscription properties.- Parameters:
topicPath- - The name of the topic relative to the service namespace base address.subscriptionName- - The name of the subscription.- Returns:
SubscriptionDescriptionof the newly created subscription.- Throws:
IllegalArgumentException- - Entity name is null, empty, too long or uses illegal characters.MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createSubscription
public SubscriptionDescription createSubscription(SubscriptionDescription subscriptionDescription) throws ServiceBusException, InterruptedException
Creates a new subscription in the service namespace with the given name. SeeSubscriptionDescriptionfor default values of subscription properties.- Parameters:
subscriptionDescription- - ASubscriptionDescriptionobject describing the attributes with which the new subscription will be created.- Returns:
SubscriptionDescriptionof the newly created subscription.- Throws:
MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createSubscription
public SubscriptionDescription createSubscription(SubscriptionDescription subscriptionDescription, RuleDescription defaultRule) throws ServiceBusException, InterruptedException
Creates a new subscription in the service namespace with the provided default rule. SeeSubscriptionDescriptionfor default values of subscription properties.- Parameters:
subscriptionDescription- - ASubscriptionDescriptionobject describing the attributes with which the new subscription will be created.defaultRule- - ARuleDescriptionobject describing the default rule. If null, then pass-through filter will be created.- Returns:
SubscriptionDescriptionof the newly created subscription.- Throws:
MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
updateSubscription
public SubscriptionDescription updateSubscription(SubscriptionDescription subscriptionDescription) throws ServiceBusException, InterruptedException
Updates an existing subscription.- Parameters:
subscriptionDescription- - ASubscriptionDescriptionobject describing the attributes with which the subscription will be updated.- Returns:
SubscriptionDescriptionof the updated subscription.- Throws:
MessagingEntityNotFoundException- - Described entity was not found.IllegalArgumentException- - descriptor is null.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
createRule
public RuleDescription createRule(String topicName, String subscriptionName, RuleDescription ruleDescription) throws ServiceBusException, InterruptedException
Creates a new rule for a given topic - subscription. SeeRuleDescriptionfor default values of subscription properties.- Parameters:
topicName- - Name of the topic.subscriptionName- - Name of the subscription.ruleDescription- - ARuleDescriptionobject describing the attributes with which the new rule will be created.- Returns:
RuleDescriptionof the newly created rule.- Throws:
MessagingEntityAlreadyExistsException- - An entity with the same name exists under the same service namespace.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
updateRule
public RuleDescription updateRule(String topicName, String subscriptionName, RuleDescription ruleDescription) throws ServiceBusException, InterruptedException
Updates an existing rule.- Parameters:
topicName- - Name of the topic.subscriptionName- - Name of the subscription.ruleDescription- - ARuleDescriptionobject describing the attributes with which the rule will be updated.- Returns:
RuleDescriptionof the updated rule.- Throws:
MessagingEntityNotFoundException- - Described entity was not found.IllegalArgumentException- - descriptor is null.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.QuotaExceededException- - Either the specified size in the description is not supported or the maximum allowed quota has been reached.InterruptedException- if the current thread was interrupted
-
queueExists
public Boolean queueExists(String path) throws ServiceBusException, InterruptedException
Checks whether a given queue exists or not.- Parameters:
path- - Path of the entity to check- Returns:
- - True if the entity exists. False otherwise.
- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
topicExists
public Boolean topicExists(String path) throws ServiceBusException, InterruptedException
Checks whether a given topic exists or not.- Parameters:
path- - Path of the entity to check- Returns:
- - True if the entity exists. False otherwise.
- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
subscriptionExists
public Boolean subscriptionExists(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException
Checks whether a given subscription exists or not.- Parameters:
topicPath- - Path of the topicsubscriptionName- - Name of the subscription.- Returns:
- - True if the entity exists. False otherwise.
- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
ruleExists
public Boolean ruleExists(String topicPath, String subscriptionName, String ruleName) throws ServiceBusException, InterruptedException
Checks whether a given rule exists or not for a given subscription.- Parameters:
topicPath- - Path of the topicsubscriptionName- - Name of the subscription.ruleName- - Name of the rule- Returns:
- - True if the entity exists. False otherwise.
- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.InterruptedException- if the current thread was interrupted
-
deleteQueue
public Void deleteQueue(String path) throws ServiceBusException, InterruptedException
Deletes the queue described by the path relative to the service namespace base address.- Parameters:
path- - The name of the entity relative to the service namespace base address.- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.MessagingEntityNotFoundException- - An entity with this name does not exist.InterruptedException- if the current thread was interrupted
-
deleteTopic
public Void deleteTopic(String path) throws ServiceBusException, InterruptedException
Deletes the topic described by the path relative to the service namespace base address.- Parameters:
path- - The name of the entity relative to the service namespace base address.- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.MessagingEntityNotFoundException- - An entity with this name does not exist.InterruptedException- if the current thread was interrupted
-
deleteSubscription
public Void deleteSubscription(String topicPath, String subscriptionName) throws ServiceBusException, InterruptedException
Deletes the subscription described by the topicPath and the subscriptionName.- Parameters:
topicPath- - The name of the topic.subscriptionName- - The name of the subscription.- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.MessagingEntityNotFoundException- - An entity with this name does not exist.InterruptedException- if the current thread was interrupted
-
deleteRule
public Void deleteRule(String topicPath, String subscriptionName, String ruleName) throws ServiceBusException, InterruptedException
Deletes the rule for a given topic-subscription.- Parameters:
topicPath- - The name of the topic.subscriptionName- - The name of the subscription.ruleName- - The name of the rule.- Throws:
IllegalArgumentException- - path is not null / empty / too long / invalid.TimeoutException- - The operation times out. The timeout period is initiated through ClientSettings.operationTimeoutAuthorizationFailedException- - No sufficient permission to perform this operation. Please check ClientSettings.tokenProvider has correct details.ServerBusyException- - The server is busy. You should wait before you retry the operation.ServiceBusException- - An internal error or an unexpected exception occurred.MessagingEntityNotFoundException- - An entity with this name does not exist.InterruptedException- if the current thread was interrupted
-
close
public void close() throws IOExceptionDisposes and closes the managementClient.- Throws:
IOException- if an I/O error occurs
-
-