ManagementClient Class
- java.
lang. Object - com.
microsoft. azure. servicebus. management. ManagementClient
- com.
public class ManagementClient
Synchronous client to perform management operations on Service Bus entities. Use ManagementClientAsync for asynchronous operations.
Constructor Summary
Constructor | Description | |
---|---|---|
ManagementClient(ConnectionStringBuilder connectionStringBuilder) | ||
ManagementClient(URI namespaceEndpointURI, ClientSettings clientSettings) |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
close()
Disposes and closes the management |
Queue |
createQueue(QueueDescription queueDescription)
Creates a new queue in the service namespace with the given name. |
Queue |
createQueue(String queuePath)
Creates a new queue in the service namespace with the given name. |
Rule |
createRule(String topicName, String subscriptionName, RuleDescription ruleDescription)
Creates a new rule for a given topic - subscription. |
Subscription |
createSubscription(SubscriptionDescription subscriptionDescription)
Creates a new subscription in the service namespace with the given name. |
Subscription |
createSubscription(SubscriptionDescription subscriptionDescription, RuleDescription defaultRule)
Creates a new subscription in the service namespace with the provided default rule. |
Subscription |
createSubscription(String topicPath, String subscriptionName)
Creates a new subscription for a given topic in the service namespace with the given name. |
Topic |
createTopic(TopicDescription topicDescription)
Creates a new topic in the service namespace with the given name. |
Topic |
createTopic(String topicPath)
Creates a new topic in the service namespace with the given name. |
Void |
deleteQueue(String path)
Deletes the queue described by the path relative to the service namespace base address. |
Void |
deleteRule(String topicPath, String subscriptionName, String ruleName)
Deletes the rule for a given topic-subscription. |
Void |
deleteSubscription(String topicPath, String subscriptionName)
Deletes the subscription described by the topic |
Void |
deleteTopic(String path)
Deletes the topic described by the path relative to the service namespace base address. |
Namespace |
getNamespaceInfo()
Retrieves information related to the namespace. |
Queue |
getQueue(String path)
Retrieves a queue from the service namespace |
Queue |
getQueueRuntimeInfo(String path)
Retrieves the runtime information of a queue. |
List<Queue |
getQueues()
Retrieves the list of queues present in the namespace. |
List<Queue |
getQueues(int count, int skip)
Retrieves the list of queues present in the namespace. |
Rule |
getRule(String topicPath, String subscriptionName, String ruleName)
Retrieves a rule for a given topic and subscription from the service namespace |
List<Rule |
getRules(String topicName, String subscriptionName)
Retrieves the list of rules for a given topic-subscription in the namespace. |
List<Rule |
getRules(String topicName, String subscriptionName, int count, int skip)
Retrieves the list of rules for a given topic-subscription in the namespace. |
Subscription |
getSubscription(String topicPath, String subscriptionName)
Retrieves a subscription for a given topic from the service namespace |
Subscription |
getSubscriptionRuntimeInfo(String topicPath, String subscriptionName)
Retrieves the runtime information of a subscription in a given topic |
List<Subscription |
getSubscriptions(String topicName)
Retrieves the list of subscriptions for a given topic in the namespace. |
List<Subscription |
getSubscriptions(String topicName, int count, int skip)
Retrieves the list of subscriptions for a given topic in the namespace. |
Topic |
getTopic(String path)
Retrieves a topic from the service namespace |
Topic |
getTopicRuntimeInfo(String path)
Retrieves the runtime information of a topic |
List<Topic |
getTopics()
Retrieves the list of topics present in the namespace. |
List<Topic |
getTopics(int count, int skip)
Retrieves the list of topics present in the namespace. |
Boolean |
queueExists(String path)
Checks whether a given queue exists or not. |
Boolean |
ruleExists(String topicPath, String subscriptionName, String ruleName)
Checks whether a given rule exists or not for a given subscription. |
Boolean |
subscriptionExists(String topicPath, String subscriptionName)
Checks whether a given subscription exists or not. |
Boolean |
topicExists(String path)
Checks whether a given topic exists or not. |
Queue |
updateQueue(QueueDescription queueDescription)
Updates an existing queue. |
Rule |
updateRule(String topicName, String subscriptionName, RuleDescription ruleDescription)
Updates an existing rule. |
Subscription |
updateSubscription(SubscriptionDescription subscriptionDescription)
Updates an existing subscription. |
Topic |
updateTopic(TopicDescription topicDescription)
Updates an existing topic. |
Methods inherited from java.lang.Object
Constructor Details
ManagementClient
public ManagementClient(ConnectionStringBuilder connectionStringBuilder)
Parameters:
ManagementClient
public ManagementClient(URI namespaceEndpointURI, ClientSettings clientSettings)
Parameters:
Method Details
close
public void close()
Disposes and closes the managementClient.
Throws:
createQueue
public QueueDescription createQueue(QueueDescription queueDescription)
Creates a new queue in the service namespace with the given name. See QueueDescription for default values of queue properties.
Parameters:
- A QueueDescription object describing the attributes with which the new queue will be created.
Returns:
Throws:
- An entity with the same name exists under the same service namespace.
- An entity with the same name exists under the same service namespace.
createQueue
public QueueDescription createQueue(String queuePath)
Creates a new queue in the service namespace with the given name. See QueueDescription for default values of queue properties.
Parameters:
- The name of the queue relative to the service namespace base address.
Returns:
Throws:
- Entity name is null, empty, too long or uses illegal characters.
- Entity name is null, empty, too long or uses illegal characters.
createRule
public RuleDescription createRule(String topicName, String subscriptionName, RuleDescription ruleDescription)
Creates a new rule for a given topic - subscription. See RuleDescription for default values of subscription properties.
Parameters:
- Name of the topic.
- Name of the subscription.
- A RuleDescription object describing the attributes with which the new rule will be created.
Returns:
Throws:
- An entity with the same name exists under the same service namespace.
- An entity with the same name exists under the same service namespace.
createSubscription
public SubscriptionDescription createSubscription(SubscriptionDescription subscriptionDescription)
Creates a new subscription in the service namespace with the given name. See SubscriptionDescription for default values of subscription properties.
Parameters:
- A SubscriptionDescription object describing the attributes with which the new subscription will be created.
Returns:
Throws:
- An entity with the same name exists under the same service namespace.
- An entity with the same name exists under the same service namespace.
createSubscription
public SubscriptionDescription createSubscription(SubscriptionDescription subscriptionDescription, RuleDescription defaultRule)
Creates a new subscription in the service namespace with the provided default rule. See SubscriptionDescription for default values of subscription properties.
Parameters:
- A SubscriptionDescription object describing the attributes with which the new subscription will be created.
- A RuleDescription object describing the default rule. If null, then pass-through filter will be created.
Returns:
Throws:
- An entity with the same name exists under the same service namespace.
- An entity with the same name exists under the same service namespace.
createSubscription
public SubscriptionDescription createSubscription(String topicPath, String subscriptionName)
Creates a new subscription for a given topic in the service namespace with the given name. See SubscriptionDescription for default values of subscription properties.
Parameters:
- The name of the topic relative to the service namespace base address.
- The name of the subscription.
Returns:
Throws:
- Entity name is null, empty, too long or uses illegal characters.
- Entity name is null, empty, too long or uses illegal characters.
createTopic
public TopicDescription createTopic(TopicDescription topicDescription)
Creates a new topic in the service namespace with the given name. See TopicDescription for default values of topic properties.
Parameters:
- A QueueDescription object describing the attributes with which the new topic will be created.
Returns:
Throws:
- An entity with the same name exists under the same service namespace.
- An entity with the same name exists under the same service namespace.
createTopic
public TopicDescription createTopic(String topicPath)
Creates a new topic in the service namespace with the given name. See TopicDescription for default values of topic properties.
Parameters:
- The name of the topic relative to the service namespace base address.
Returns:
Throws:
- Entity name is null, empty, too long or uses illegal characters.
- Entity name is null, empty, too long or uses illegal characters.
deleteQueue
public Void deleteQueue(String path)
Deletes the queue described by the path relative to the service namespace base address.
Parameters:
- The name of the entity relative to the service namespace base address.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
deleteRule
public Void deleteRule(String topicPath, String subscriptionName, String ruleName)
Deletes the rule for a given topic-subscription.
Parameters:
- The name of the topic.
- The name of the subscription.
- The name of the rule.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
deleteSubscription
public Void deleteSubscription(String topicPath, String subscriptionName)
Deletes the subscription described by the topicPath and the subscriptionName.
Parameters:
- The name of the topic.
- The name of the subscription.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
deleteTopic
public Void deleteTopic(String path)
Deletes the topic described by the path relative to the service namespace base address.
Parameters:
- The name of the entity relative to the service namespace base address.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
getNamespaceInfo
public NamespaceInfo getNamespaceInfo()
Retrieves information related to the namespace. Works with any claim (Send/Listen/Manage).
Returns:
- NamespaceInfo containing namespace information.
Throws:
- An internal error or an unexpected exception occurred.
- An internal error or an unexpected exception occurred.
getQueue
public QueueDescription getQueue(String path)
Retrieves a queue from the service namespace
Parameters:
- The path of the queue relative to service bus namespace.
Returns:
- QueueDescription containing information about the queue.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getQueueRuntimeInfo
public QueueRuntimeInfo getQueueRuntimeInfo(String path)
Retrieves the runtime information of a queue.
Parameters:
- The path of the queue relative to service bus namespace.
Returns:
- QueueRuntimeInfo containing runtime information about the queue.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getQueues
public List
Retrieves the list of queues present in the namespace.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getQueues
public List
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:
- The number of queues to fetch. Defaults to 100. Maximum value allowed is 100.
- The number of queues to skip. Defaults to 0. Cannot be negative.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getRule
public RuleDescription getRule(String topicPath, String subscriptionName, String ruleName)
Retrieves a rule for a given topic and subscription from the service namespace
Parameters:
- The path of the topic relative to service bus namespace.
- The name of the subscription.
- The name of the rule.
Returns:
- RuleDescription containing information about the subscription.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getRules
public List
Retrieves the list of rules for a given topic-subscription in the namespace.
Parameters:
- The name of the topic.
- The name of the subscription.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getRules
public List
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:
- The name of the topic.
- The name of the subscription.
- The number of rules to fetch. Defaults to 100. Maximum value allowed is 100.
- The number of rules to skip. Defaults to 0. Cannot be negative.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getSubscription
public SubscriptionDescription getSubscription(String topicPath, String subscriptionName)
Retrieves a subscription for a given topic from the service namespace
Parameters:
- The path of the topic relative to service bus namespace.
- The name of the subscription
Returns:
- SubscriptionDescription containing information about the subscription.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getSubscriptionRuntimeInfo
public SubscriptionRuntimeInfo getSubscriptionRuntimeInfo(String topicPath, String subscriptionName)
Retrieves the runtime information of a subscription in a given topic
Parameters:
- The path of the topic relative to service bus namespace.
- The name of the subscription
Returns:
- SubscriptionRuntimeInfo containing the runtime information about the subscription.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getSubscriptions
public List
Retrieves the list of subscriptions for a given topic in the namespace.
Parameters:
- The name of the topic.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getSubscriptions
public List
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:
- The name of the topic.
- The number of subscriptions to fetch. Defaults to 100. Maximum value allowed is 100.
- The number of subscriptions to skip. Defaults to 0. Cannot be negative.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getTopic
public TopicDescription getTopic(String path)
Retrieves a topic from the service namespace
Parameters:
- The path of the queue relative to service bus namespace.
Returns:
- Description containing information about the topic.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getTopicRuntimeInfo
public TopicRuntimeInfo getTopicRuntimeInfo(String path)
Retrieves the runtime information of a topic
Parameters:
- The path of the queue relative to service bus namespace.
Returns:
- TopicRuntimeInfo containing runtime information about the topic.
Throws:
- Thrown if path is null, empty, or not in right format or length.
- Thrown if path is null, empty, or not in right format or length.
getTopics
public List
Retrieves the list of topics present in the namespace.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
getTopics
public List
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:
- The number of topics to fetch. Defaults to 100. Maximum value allowed is 100.
- The number of topics to skip. Defaults to 0. Cannot be negative.
Returns:
Throws:
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
- The operation times out. The timeout period is initiated through ClientSettings.operationTimeout
queueExists
public Boolean queueExists(String path)
Checks whether a given queue exists or not.
Parameters:
- Path of the entity to check
Returns:
- True if the entity exists. False otherwise.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
ruleExists
public Boolean ruleExists(String topicPath, String subscriptionName, String ruleName)
Checks whether a given rule exists or not for a given subscription.
Parameters:
- Path of the topic
- Name of the subscription.
- Name of the rule
Returns:
- True if the entity exists. False otherwise.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
subscriptionExists
public Boolean subscriptionExists(String topicPath, String subscriptionName)
Checks whether a given subscription exists or not.
Parameters:
- Path of the topic
- Name of the subscription.
Returns:
- True if the entity exists. False otherwise.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
topicExists
public Boolean topicExists(String path)
Checks whether a given topic exists or not.
Parameters:
- Path of the entity to check
Returns:
- True if the entity exists. False otherwise.
Throws:
- path is not null / empty / too long / invalid.
- path is not null / empty / too long / invalid.
updateQueue
public QueueDescription updateQueue(QueueDescription queueDescription)
Updates an existing queue.
Parameters:
- A QueueDescription object describing the attributes with which the queue will be updated.
Returns:
Throws:
- Described entity was not found.
- Described entity was not found.
updateRule
public RuleDescription updateRule(String topicName, String subscriptionName, RuleDescription ruleDescription)
Updates an existing rule.
Parameters:
- Name of the topic.
- Name of the subscription.
- A RuleDescription object describing the attributes with which the rule will be updated.
Returns:
Throws:
- Described entity was not found.
- Described entity was not found.
updateSubscription
public SubscriptionDescription updateSubscription(SubscriptionDescription subscriptionDescription)
Updates an existing subscription.
Parameters:
- A SubscriptionDescription object describing the attributes with which the subscription will be updated.
Returns:
Throws:
- Described entity was not found.
- Described entity was not found.
updateTopic
public TopicDescription updateTopic(TopicDescription topicDescription)
Updates an existing topic.
Parameters:
- A TopicDescription object describing the attributes with which the topic will be updated.
Returns:
Throws:
- Described entity was not found.
- Described entity was not found.
Applies to
Azure SDK for Java