Class ServiceBusAdministrationClient
ServiceBusAdministrationClientBuilder.
Sample: Create the async client
The follow code sample demonstrates the creation of the async administration client. The credential used in the
following sample is DefaultAzureCredential for authentication. It is appropriate for most scenarios,
including local development and production environments. Additionally, we recommend using
managed identity
for authentication in production environments. You can find more information on different ways of authenticating and
their corresponding credential types in the
Azure Identity documentation.
HttpLogOptions logOptions = new HttpLogOptions()
.setLogLevel(HttpLogDetailLevel.HEADERS);
// DefaultAzureCredential creates a credential based on the environment it is executed in.
TokenCredential tokenCredential = new DefaultAzureCredentialBuilder().build();
// 'fullyQualifiedNamespace' will look similar to "{your-namespace}.servicebus.windows.net"
ServiceBusAdministrationClient client = new ServiceBusAdministrationClientBuilder()
.credential(fullyQualifiedNamespace, tokenCredential)
.httpLogOptions(logOptions)
.buildClient();
Sample: Create a queue
The following sample creates a queue with default values. Default values are listed in
CreateQueueOptions().
QueueProperties queue = client.createQueue("my-new-queue");
System.out.printf("Queue created. Name: %s. Lock Duration: %s.%n",
queue.getName(), queue.getLockDuration());
Sample: Edit an existing subscription
The following code sample demonstrates updating an existing subscription. Users should fetch the subscription's properties, modify the properties, and then pass the object to update method.
// To update the subscription we have to:
// 1. Get the subscription info from the service.
// 2. Update the SubscriptionProperties we want to change.
// 3. Call the updateSubscription() with the updated object.
SubscriptionProperties subscription = client.getSubscription("my-topic", "my-subscription");
System.out.println("Original delivery count: " + subscription.getMaxDeliveryCount());
// Updating it to a new value.
subscription.setMaxDeliveryCount(5);
// Persisting the updates to the subscription object.
SubscriptionProperties updated = client.updateSubscription(subscription);
System.out.printf("Subscription updated. Name: %s. Delivery count: %s.%n",
updated.getSubscriptionName(), updated.getMaxDeliveryCount());
Sample: List all queues
The following code sample lists all the queues in the Service Bus namespace.
client.listQueues().forEach(queue -> {
System.out.printf("Queue [%s]. Lock Duration: %s.%n",
queue.getName(), queue.getLockDuration());
});
Sample: Delete queue
The code sample below demonstrates deleting an existing queue.
try {
client.deleteQueue("my-existing-queue");
} catch (AzureException exception) {
System.err.println("Exception occurred deleting queue: " + exception);
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreateQueue(String queueName) Creates a queue with the given name.createQueue(String queueName, CreateQueueOptions queueOptions) Creates a queue with theCreateQueueOptions.com.azure.core.http.rest.Response<QueueProperties> createQueueWithResponse(String queueName, CreateQueueOptions queueOptions, com.azure.core.util.Context context) Creates a queue and returns the created queue in addition to the HTTP response.createRule(String topicName, String subscriptionName, String ruleName) Creates a rule under the given topic and subscriptioncreateRule(String topicName, String ruleName, String subscriptionName, CreateRuleOptions ruleOptions) Creates a rule with theCreateRuleOptions.com.azure.core.http.rest.Response<RuleProperties> createRuleWithResponse(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions, com.azure.core.util.Context context) Creates a rule and returns the created rule in addition to the HTTP response.createSubscription(String topicName, String subscriptionName) Creates a subscription with the given topic and subscription names.createSubscription(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions) Creates a subscription with theCreateSubscriptionOptions.createSubscription(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions) Creates a subscription with default rule using theCreateSubscriptionOptionsandCreateRuleOptions.com.azure.core.http.rest.Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions, com.azure.core.util.Context context) Creates a subscription and returns the created subscription in addition to the HTTP response.com.azure.core.http.rest.Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions, com.azure.core.util.Context context) Creates a subscription with default rule configured and returns the created subscription in addition to the HTTP response.createTopic(String topicName) Creates a topic with the given name.createTopic(String topicName, CreateTopicOptions topicOptions) Creates a topic with theCreateTopicOptions.com.azure.core.http.rest.Response<TopicProperties> createTopicWithResponse(String topicName, CreateTopicOptions topicOptions, com.azure.core.util.Context context) Creates a topic and returns the created topic in addition to the HTTP response.voiddeleteQueue(String queueName) Deletes a queue the matchingqueueName.com.azure.core.http.rest.Response<Void> deleteQueueWithResponse(String queueName, com.azure.core.util.Context context) Deletes a queue the matchingqueueNameand returns the HTTP response.voiddeleteRule(String topicName, String subscriptionName, String ruleName) Deletes a rule the matchingruleName.com.azure.core.http.rest.Response<Void> deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName, com.azure.core.util.Context context) Deletes a rule the matchingruleNameand returns the HTTP response.voiddeleteSubscription(String topicName, String subscriptionName) Deletes a subscription matching thesubscriptionNamein topictopicName.com.azure.core.http.rest.Response<Void> deleteSubscriptionWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Deletes a subscription the matchingsubscriptionNameand returns the HTTP response.voiddeleteTopic(String topicName) Deletes a topic the matchingtopicName.com.azure.core.http.rest.Response<Void> deleteTopicWithResponse(String topicName, com.azure.core.util.Context context) Deletes a topic the matchingtopicNameand returns the HTTP response.Gets information about the Service Bus namespace.com.azure.core.http.rest.Response<NamespaceProperties> getNamespacePropertiesWithResponse(com.azure.core.util.Context context) Gets information about the Service Bus namespace along with its HTTP response.Gets information about the queue.booleangetQueueExists(String queueName) Gets whether a queue withqueueNameexists in the Service Bus namespace.com.azure.core.http.rest.Response<Boolean> getQueueExistsWithResponse(String queueName, com.azure.core.util.Context context) Gets whether a queue withqueueNameexists in the Service Bus namespace.getQueueRuntimeProperties(String queueName) Gets runtime properties about the queue.com.azure.core.http.rest.Response<QueueRuntimeProperties> getQueueRuntimePropertiesWithResponse(String queueName, com.azure.core.util.Context context) Gets runtime properties about the queue along with its HTTP response.com.azure.core.http.rest.Response<QueueProperties> getQueueWithResponse(String queueName, com.azure.core.util.Context context) Gets information about the queue along with its HTTP response.Gets a rule from the service namespace.com.azure.core.http.rest.Response<RuleProperties> getRuleWithResponse(String topicName, String subscriptionName, String ruleName, com.azure.core.util.Context context) Gets a rule from the service namespace.getSubscription(String topicName, String subscriptionName) Gets information about the queue.booleangetSubscriptionExists(String topicName, String subscriptionName) Gets whether a subscription within a topic exists.com.azure.core.http.rest.Response<Boolean> getSubscriptionExistsWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets whether a subscription within a topic exists.getSubscriptionRuntimeProperties(String topicName, String subscriptionName) Gets runtime properties about the subscription.com.azure.core.http.rest.Response<SubscriptionRuntimeProperties> getSubscriptionRuntimePropertiesWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets runtime properties about the subscription.com.azure.core.http.rest.Response<SubscriptionProperties> getSubscriptionWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets information about the subscription along with its HTTP response.Gets information about the topic.booleangetTopicExists(String topicName) Gets whether a topic withtopicNameexists in the Service Bus namespace.com.azure.core.http.rest.Response<Boolean> getTopicExistsWithResponse(String topicName, com.azure.core.util.Context context) Gets whether a topic withtopicNameexists in the Service Bus namespace.getTopicRuntimeProperties(String topicName) Gets runtime properties about the topic.com.azure.core.http.rest.Response<TopicRuntimeProperties> getTopicRuntimePropertiesWithResponse(String topicName, com.azure.core.util.Context context) Gets runtime properties about the topic with its HTTP response.com.azure.core.http.rest.Response<TopicProperties> getTopicWithResponse(String topicName, com.azure.core.util.Context context) Gets information about the topic along with its HTTP response.com.azure.core.http.rest.PagedIterable<QueueProperties> Fetches all the queues in the Service Bus namespace.com.azure.core.http.rest.PagedIterable<QueueProperties> listQueues(com.azure.core.util.Context context) Fetches all the queues in the Service Bus namespace.com.azure.core.http.rest.PagedIterable<RuleProperties> Fetches all the rules for a topic and subscription.com.azure.core.http.rest.PagedIterable<RuleProperties> Fetches all the rules for a topic and subscription.com.azure.core.http.rest.PagedIterable<SubscriptionProperties> listSubscriptions(String topicName) Fetches all the subscriptions for a topic.com.azure.core.http.rest.PagedIterable<SubscriptionProperties> listSubscriptions(String topicName, com.azure.core.util.Context context) Fetches all the subscriptions for a topic.com.azure.core.http.rest.PagedIterable<TopicProperties> Fetches all the topics in the Service Bus namespace.com.azure.core.http.rest.PagedIterable<TopicProperties> listTopics(com.azure.core.util.Context context) Fetches all the topics in the Service Bus namespace.updateQueue(QueueProperties queue) Updates a queue with the givenQueueProperties.com.azure.core.http.rest.Response<QueueProperties> updateQueueWithResponse(QueueProperties queue, com.azure.core.util.Context context) Updates a queue with the givenQueueProperties.updateRule(String topicName, String subscriptionName, RuleProperties rule) Updates a rule with the givenRuleProperties.com.azure.core.http.rest.Response<RuleProperties> updateRuleWithResponse(String topicName, String subscriptionName, RuleProperties rule, com.azure.core.util.Context context) Updates a rule with the givenRuleProperties.updateSubscription(SubscriptionProperties subscription) Updates a subscription with the givenSubscriptionProperties.com.azure.core.http.rest.Response<SubscriptionProperties> updateSubscriptionWithResponse(SubscriptionProperties subscription, com.azure.core.util.Context context) Updates a subscription with the givenSubscriptionProperties.updateTopic(TopicProperties topic) Updates a topic with the givenTopicProperties.com.azure.core.http.rest.Response<TopicProperties> updateTopicWithResponse(TopicProperties topic, com.azure.core.util.Context context) Updates a topic with the givenTopicProperties.
-
Method Details
-
createQueue
Creates a queue with the given name.- Parameters:
queueName- Name of the queue to create.- Returns:
- The created queue.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the queue quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifqueueNamenull or an empty string.com.azure.core.exception.ResourceExistsException- if a queue exists with the samequeueName.- See Also:
-
createQueue
Creates a queue with theCreateQueueOptions.- Parameters:
queueName- Name of the queue to create.queueOptions- Information about the queue to create.- Returns:
- The created queue.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the queue quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifqueueNamenull or an empty string.com.azure.core.exception.ResourceExistsException- if a queue exists with the samequeueName.- See Also:
-
createQueueWithResponse
public com.azure.core.http.rest.Response<QueueProperties> createQueueWithResponse(String queueName, CreateQueueOptions queueOptions, com.azure.core.util.Context context) Creates a queue and returns the created queue in addition to the HTTP response.- Parameters:
queueName- Name of the queue to create.queueOptions- Information about the queue to create.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The created queue in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the queue quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifqueueNamenull or an empty string.com.azure.core.exception.ResourceExistsException- if a queue exists with the samequeueName.- See Also:
-
createRule
Creates a rule under the given topic and subscription- Parameters:
topicName- Name of the topic associated with rule.subscriptionName- Name of the subscription associated with the rule.ruleName- Name of the rule.- Returns:
- Information about the created rule.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameorruleNameare null or empty strings.com.azure.core.exception.ResourceExistsException- if a rule exists with the same topic, subscription, and rule name.
-
createRule
public RuleProperties createRule(String topicName, String ruleName, String subscriptionName, CreateRuleOptions ruleOptions) Creates a rule with theCreateRuleOptions.- Parameters:
topicName- Name of the topic associated with rule.ruleName- Name of the rule.subscriptionName- Name of the subscription associated with the rule.ruleOptions- Information about the rule to create.- Returns:
- Information about the created rule.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameorruleNameare null or empty strings.NullPointerException-ruleOptionsare null.com.azure.core.exception.ResourceExistsException- if a rule exists with the same topic and rule name.
-
createRuleWithResponse
public com.azure.core.http.rest.Response<RuleProperties> createRuleWithResponse(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions, com.azure.core.util.Context context) Creates a rule and returns the created rule in addition to the HTTP response.- Parameters:
topicName- Name of the topic associated with rule.subscriptionName- Name of the subscription associated with the rule.ruleName- Name of the rule.ruleOptions- Information about the rule to create.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The created rule in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameorruleNameare null or empty strings.NullPointerException-ruleOptionsare null.com.azure.core.exception.ResourceExistsException- if a rule exists with the same topic and rule name.
-
createSubscription
Creates a subscription with the given topic and subscription names.- Parameters:
topicName- Name of the topic associated with subscription.subscriptionName- Name of the subscription.- Returns:
- Information about the created subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.NullPointerException- iftopicNameorsubscriptionNameare null or empty strings.com.azure.core.exception.ResourceExistsException- if a subscription exists with the same topic and subscription name.- See Also:
-
createSubscription
public SubscriptionProperties createSubscription(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions) Creates a subscription with theCreateSubscriptionOptions.- Parameters:
topicName- Name of the topic associated with subscription.subscriptionName- Name of the subscription.subscriptionOptions- Information about the subscription to create.- Returns:
- Information about the created subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameare null or empty strings.com.azure.core.exception.ResourceExistsException- if a subscription exists with the same topic and subscription name.- See Also:
-
createSubscription
public SubscriptionProperties createSubscription(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions) Creates a subscription with default rule using theCreateSubscriptionOptionsandCreateRuleOptions.- Parameters:
topicName- Name of the topic associated with subscription.subscriptionName- Name of the subscription.ruleName- Name of the default rule the subscription should be created with.subscriptionOptions- ACreateSubscriptionOptionsobject describing the subscription to create.ruleOptions- ACreateRuleOptionsobject describing the default rule. If null, then pass-through filter will be created.- Returns:
- Information about the created subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameare null or empty strings.com.azure.core.exception.ResourceExistsException- if a subscription exists with the same topic and subscription name.- See Also:
-
createSubscriptionWithResponse
public com.azure.core.http.rest.Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions, com.azure.core.util.Context context) Creates a subscription and returns the created subscription in addition to the HTTP response.- Parameters:
topicName- Name of the topic associated with subscription.subscriptionName- Name of the subscription.subscriptionOptions- Information about the subscription to create.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The created subscription in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.NullPointerException- ifsubscriptionOptionsis null.com.azure.core.exception.ResourceExistsException- if a subscription exists with the same topic and subscription name.- See Also:
-
createSubscriptionWithResponse
public com.azure.core.http.rest.Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions, com.azure.core.util.Context context) Creates a subscription with default rule configured and returns the created subscription in addition to the HTTP response.- Parameters:
topicName- Name of the topic associated with subscription.subscriptionName- Name of the subscription.ruleName- Name of the default rule the subscription should be created with.subscriptionOptions- ACreateSubscriptionOptionsobject describing the subscription to create.ruleOptions- ACreateRuleOptionsobject describing the default rule. If null, then pass-through filter will be created.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The created subscription in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the quota is exceeded, or an error occurred processing the request.NullPointerException- ifsubscriptionOptionsis null.com.azure.core.exception.ResourceExistsException- if a subscription exists with the same topic and subscription name.- See Also:
-
createTopic
Creates a topic with the given name.- Parameters:
topicName- Name of the topic to create.- Returns:
- Information about the created topic.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the topic quota is exceeded, or an error occurred processing the request.NullPointerException- iftopicNameis null.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceExistsException- if a topic exists with the sametopicName.- See Also:
-
createTopic
Creates a topic with theCreateTopicOptions.- Parameters:
topicName- Name of the topic to create.topicOptions- Information about the topic to create.- Returns:
- Information about the created topic.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the topicOptions quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.NullPointerException- iftopicOptionsis null.com.azure.core.exception.ResourceExistsException- if a topic exists with the sametopicName.- See Also:
-
createTopicWithResponse
public com.azure.core.http.rest.Response<TopicProperties> createTopicWithResponse(String topicName, CreateTopicOptions topicOptions, com.azure.core.util.Context context) Creates a topic and returns the created topic in addition to the HTTP response.- Parameters:
topicName- Name of the topic to create.topicOptions- Information about the topic to create.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The created topic in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the topic quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopic.getName()is null or an empty string.NullPointerException- iftopicOptionsis null.com.azure.core.exception.ResourceExistsException- if a topic exists with the sametopicName.- See Also:
-
deleteQueue
Deletes a queue the matchingqueueName.- Parameters:
queueName- Name of queue to delete.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or is an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
deleteQueueWithResponse
public com.azure.core.http.rest.Response<Void> deleteQueueWithResponse(String queueName, com.azure.core.util.Context context) Deletes a queue the matchingqueueNameand returns the HTTP response.- Parameters:
queueName- Name of queue to delete.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response when the queue is successfully deleted.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or is an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
deleteRule
Deletes a rule the matchingruleName.- Parameters:
topicName- Name of topic associated with rule to delete.subscriptionName- Name of the subscription associated with the rule to delete.ruleName- Name of rule to delete.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicName,subscriptionName, orruleNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if theruleNamedoes not exist.
-
deleteRuleWithResponse
public com.azure.core.http.rest.Response<Void> deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName, com.azure.core.util.Context context) Deletes a rule the matchingruleNameand returns the HTTP response.- Parameters:
topicName- Name of topic associated with rule to delete.subscriptionName- Name of the subscription associated with the rule to delete.ruleName- Name of rule to delete.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicName,subscriptionName, orruleNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if theruleNamedoes not exist.
-
deleteSubscription
Deletes a subscription matching thesubscriptionNamein topictopicName.- Parameters:
topicName- Name of topic associated with subscription to delete.subscriptionName- Name of subscription to delete.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thesubscriptionNamedoes not exist.- See Also:
-
deleteSubscriptionWithResponse
public com.azure.core.http.rest.Response<Void> deleteSubscriptionWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Deletes a subscription the matchingsubscriptionNameand returns the HTTP response.- Parameters:
topicName- Name of topic associated with subscription to delete.subscriptionName- Name of subscription to delete.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thesubscriptionNamedoes not exist.- See Also:
-
deleteTopic
Deletes a topic the matchingtopicName.- Parameters:
topicName- Name of topic to delete.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
deleteTopicWithResponse
public com.azure.core.http.rest.Response<Void> deleteTopicWithResponse(String topicName, com.azure.core.util.Context context) Deletes a topic the matchingtopicNameand returns the HTTP response.- Parameters:
topicName- Name of topic to delete.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
getQueue
Gets information about the queue.- Parameters:
queueName- Name of queue to get information about.- Returns:
- Information about the queue.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
getQueueWithResponse
public com.azure.core.http.rest.Response<QueueProperties> getQueueWithResponse(String queueName, com.azure.core.util.Context context) Gets information about the queue along with its HTTP response.- Parameters:
queueName- Name of queue to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Information about the queue and the associated HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
getQueueExists
Gets whether a queue withqueueNameexists in the Service Bus namespace.- Parameters:
queueName- Name of the queue.- Returns:
trueif the queue exists; otherwisefalse.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.
-
getQueueExistsWithResponse
public com.azure.core.http.rest.Response<Boolean> getQueueExistsWithResponse(String queueName, com.azure.core.util.Context context) Gets whether a queue withqueueNameexists in the Service Bus namespace.- Parameters:
queueName- Name of the queue.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response and
trueif the queue exists; otherwisefalse. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.
-
getQueueRuntimeProperties
Gets runtime properties about the queue.- Parameters:
queueName- Name of queue to get information about.- Returns:
- Runtime properties about the queue.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
getQueueRuntimePropertiesWithResponse
public com.azure.core.http.rest.Response<QueueRuntimeProperties> getQueueRuntimePropertiesWithResponse(String queueName, com.azure.core.util.Context context) Gets runtime properties about the queue along with its HTTP response.- Parameters:
queueName- Name of queue to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Runtime properties about the queue and the associated HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifqueueNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thequeueNamedoes not exist.- See Also:
-
getNamespaceProperties
Gets information about the Service Bus namespace.- Returns:
- Information about the Service Bus namespace.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.
-
getNamespacePropertiesWithResponse
public com.azure.core.http.rest.Response<NamespaceProperties> getNamespacePropertiesWithResponse(com.azure.core.util.Context context) Gets information about the Service Bus namespace along with its HTTP response.- Parameters:
context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Information about the namespace and the associated HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.
-
getRule
Gets a rule from the service namespace. Only following data types are deserialized in Filters and Action parameters - string, int, long, boolean, double, and OffsetDateTime. Other data types would return its string value.- Parameters:
topicName- The name of the topic relative to service bus namespace.subscriptionName- The subscription name the rule belongs to.ruleName- The name of the rule to retrieve.- Returns:
- The associated rule.
-
getRuleWithResponse
public com.azure.core.http.rest.Response<RuleProperties> getRuleWithResponse(String topicName, String subscriptionName, String ruleName, com.azure.core.util.Context context) Gets a rule from the service namespace. Only following data types are deserialized in Filters and Action parameters - string, int, long, bool, double, and OffsetDateTime. Other data types would return its string value.- Parameters:
topicName- The name of the topic relative to service bus namespace.subscriptionName- The subscription name the rule belongs to.ruleName- The name of the rule to retrieve.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The associated rule with the corresponding HTTP response.
-
getSubscription
Gets information about the queue.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of subscription to get information about.- Returns:
- Information about the subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameare empty strings.NullPointerException- iftopicNameorsubscriptionNameare null.com.azure.core.exception.ResourceNotFoundException- if thesubscriptionNamedoes not exist in thetopicName.- See Also:
-
getSubscriptionWithResponse
public com.azure.core.http.rest.Response<SubscriptionProperties> getSubscriptionWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets information about the subscription along with its HTTP response.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of subscription to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Information about the subscription and the associated HTTP response.
- Throws:
com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException- If error occurred processing the request.IllegalArgumentException- iftopicNameorsubscriptionNameare null or empty strings.- See Also:
-
getSubscriptionExists
Gets whether a subscription within a topic exists.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of the subscription.- Returns:
trueif the subscription exists.- Throws:
com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException- If error occurred processing the request.IllegalArgumentException- ifsubscriptionNameis null or an empty string.NullPointerException- ifsubscriptionNameis null.
-
getSubscriptionExistsWithResponse
public com.azure.core.http.rest.Response<Boolean> getSubscriptionExistsWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets whether a subscription within a topic exists.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of the subscription.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response and
trueif the subscription exists; otherwisefalse. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifsubscriptionNameis null or an empty string.
-
getSubscriptionRuntimeProperties
public SubscriptionRuntimeProperties getSubscriptionRuntimeProperties(String topicName, String subscriptionName) Gets runtime properties about the subscription.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of subscription to get information about.- Returns:
- Runtime properties about the subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifsubscriptionNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thesubscriptionNamedoes not exist.- See Also:
-
getSubscriptionRuntimePropertiesWithResponse
public com.azure.core.http.rest.Response<SubscriptionRuntimeProperties> getSubscriptionRuntimePropertiesWithResponse(String topicName, String subscriptionName, com.azure.core.util.Context context) Gets runtime properties about the subscription.- Parameters:
topicName- Name of topic associated with subscription.subscriptionName- Name of subscription to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Runtime properties about the subscription.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- ifsubscriptionNameis an empty string.NullPointerException- ifsubscriptionNameis null.com.azure.core.exception.ResourceNotFoundException- if thesubscriptionNamedoes not exist.- See Also:
-
getTopic
Gets information about the topic.- Parameters:
topicName- Name of topic to get information about.- Returns:
- Information about the topic.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
getTopicWithResponse
public com.azure.core.http.rest.Response<TopicProperties> getTopicWithResponse(String topicName, com.azure.core.util.Context context) Gets information about the topic along with its HTTP response.- Parameters:
topicName- Name of topic to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Information about the topic and the associated HTTP response.
- Throws:
com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
getTopicExists
Gets whether a topic withtopicNameexists in the Service Bus namespace.- Parameters:
topicName- Name of the topic.- Returns:
trueif the topic exists.- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.
-
getTopicExistsWithResponse
public com.azure.core.http.rest.Response<Boolean> getTopicExistsWithResponse(String topicName, com.azure.core.util.Context context) Gets whether a topic withtopicNameexists in the Service Bus namespace.- Parameters:
topicName- Name of the topic.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The HTTP response and
trueif the topic exists; otherwisefalse. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.
-
getTopicRuntimeProperties
Gets runtime properties about the topic.- Parameters:
topicName- Name of topic to get information about.- Returns:
- Runtime properties about the topic.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
getTopicRuntimePropertiesWithResponse
public com.azure.core.http.rest.Response<TopicRuntimeProperties> getTopicRuntimePropertiesWithResponse(String topicName, com.azure.core.util.Context context) Gets runtime properties about the topic with its HTTP response.- Parameters:
topicName- Name of topic to get information about.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Runtime properties about the topic and the associated HTTP response.
- Throws:
com.azure.messaging.servicebus.administration.implementation.models.ServiceBusManagementErrorException- If error occurred processing the request.IllegalArgumentException- iftopicNameis null or an empty string.com.azure.core.exception.ResourceNotFoundException- if thetopicNamedoes not exist.- See Also:
-
listQueues
Fetches all the queues in the Service Bus namespace.- Returns:
- A PagedIterable of
queuesin the Service Bus namespace. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.- See Also:
-
listQueues
public com.azure.core.http.rest.PagedIterable<QueueProperties> listQueues(com.azure.core.util.Context context) Fetches all the queues in the Service Bus namespace.- Parameters:
context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A PagedIterable of
queuesin the Service Bus namespace. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.- See Also:
-
listRules
public com.azure.core.http.rest.PagedIterable<RuleProperties> listRules(String topicName, String subscriptionName) Fetches all the rules for a topic and subscription.- Parameters:
topicName- The topic name under which all the rules need to be retrieved.subscriptionName- The name of the subscription for which all rules need to be retrieved.- Returns:
- An iterable of
rulesfor thetopicNameandsubscriptionName. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.NullPointerException- iftopicNameorsubscriptionNameis null.IllegalArgumentException- iftopicNameorsubscriptionNameis an empty string.- See Also:
-
listRules
public com.azure.core.http.rest.PagedIterable<RuleProperties> listRules(String topicName, String subscriptionName, com.azure.core.util.Context context) Fetches all the rules for a topic and subscription.- Parameters:
topicName- The topic name under which all the rules need to be retrieved.subscriptionName- The name of the subscription for which all rules need to be retrieved.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- An iterable of
rulesfor thetopicNameandsubscriptionName. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.NullPointerException- iftopicNameorsubscriptionNameis null.IllegalArgumentException- iftopicNameorsubscriptionNameis an empty string.- See Also:
-
listSubscriptions
public com.azure.core.http.rest.PagedIterable<SubscriptionProperties> listSubscriptions(String topicName) Fetches all the subscriptions for a topic.- Parameters:
topicName- The topic name under which all the subscriptions need to be retrieved.- Returns:
- A paged iterable of
subscriptionsfor thetopicName. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.NullPointerException- iftopicNameis null.IllegalArgumentException- iftopicNameis an empty string.- See Also:
-
listSubscriptions
public com.azure.core.http.rest.PagedIterable<SubscriptionProperties> listSubscriptions(String topicName, com.azure.core.util.Context context) Fetches all the subscriptions for a topic.- Parameters:
topicName- The topic name under which all the subscriptions need to be retrieved.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A paged iterable of
subscriptionsfor thetopicName. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.NullPointerException- iftopicNameis null.IllegalArgumentException- iftopicNameis an empty string.- See Also:
-
listTopics
Fetches all the topics in the Service Bus namespace.- Returns:
- A paged iterable of
topicsin the Service Bus namespace. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.- See Also:
-
listTopics
public com.azure.core.http.rest.PagedIterable<TopicProperties> listTopics(com.azure.core.util.Context context) Fetches all the topics in the Service Bus namespace.- Parameters:
context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A paged iterable of
topicsin the Service Bus namespace. - Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.- See Also:
-
updateQueue
Updates a queue with the givenQueueProperties. TheQueuePropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get queue description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
queue- Information about the queue to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.- Returns:
- The updated queue.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the queue quota is exceeded, or an error occurred processing the request.NullPointerException- ifqueueis null.- See Also:
-
updateQueueWithResponse
public com.azure.core.http.rest.Response<QueueProperties> updateQueueWithResponse(QueueProperties queue, com.azure.core.util.Context context) Updates a queue with the givenQueueProperties. TheQueuePropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get queue description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
queue- Information about the queue to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The updated queue with its HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the queue quota is exceeded, or an error occurred processing the request.NullPointerException- ifqueueis null.- See Also:
-
updateRule
Updates a rule with the givenRuleProperties. TheRulePropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get rule description.- Update the required elements.
- Pass the updated description into this method.
- Parameters:
topicName- The topic name under which the rule is updated.subscriptionName- The name of the subscription for which the rule is updated.rule- Information about the rule to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.- Returns:
- The updated rule.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the rule quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifRuleProperties.getName()is null or an empty string.NullPointerException- ifruleis null.
-
updateRuleWithResponse
public com.azure.core.http.rest.Response<RuleProperties> updateRuleWithResponse(String topicName, String subscriptionName, RuleProperties rule, com.azure.core.util.Context context) Updates a rule with the givenRuleProperties. TheRulePropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get rule description.- Update the required elements.
- Pass the updated description into this method.
- Parameters:
topicName- The topic name under which the rule is updated.subscriptionName- The name of the subscription for which the rule is updated.rule- Information about the rule to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- A Mono that returns the updated rule in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the rule quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifRuleProperties.getName()is null or an empty string.NullPointerException- ifruleis null.- See Also:
-
updateSubscription
Updates a subscription with the givenSubscriptionProperties. TheSubscriptionPropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get subscription description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
subscription- Information about the subscription to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.- Returns:
- Updated subscription in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the subscription quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifSubscriptionProperties.getTopicName()orSubscriptionProperties.getSubscriptionName()is null or an empty string.NullPointerException- ifsubscriptionis null.- See Also:
-
updateSubscriptionWithResponse
public com.azure.core.http.rest.Response<SubscriptionProperties> updateSubscriptionWithResponse(SubscriptionProperties subscription, com.azure.core.util.Context context) Updates a subscription with the givenSubscriptionProperties. TheSubscriptionPropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get subscription description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
subscription- Information about the subscription to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- Updated subscription in addition to the HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the subscription quota is exceeded, or an error occurred processing the request.IllegalArgumentException- ifSubscriptionProperties.getTopicName()orSubscriptionProperties.getSubscriptionName()is null or an empty string.NullPointerException- ifsubscriptionis null.- See Also:
-
updateTopic
Updates a topic with the givenTopicProperties. TheTopicPropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get topic description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
topic- Information about the topic to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.- Returns:
- The updated topic.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the topic quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopic.getName()is null or an empty string.NullPointerException- iftopicis null.- See Also:
-
updateTopicWithResponse
public com.azure.core.http.rest.Response<TopicProperties> updateTopicWithResponse(TopicProperties topic, com.azure.core.util.Context context) Updates a topic with the givenTopicProperties. TheTopicPropertiesmust be fully populated as all the properties are replaced. If a property is not set the service default value is used. The suggested flow is:Get topic description.- Update the required elements.
- Pass the updated description into this method.
There are a subset of properties that can be updated. More information can be found in the links below. They are:
- Parameters:
topic- Information about the topic to update. You must provide all the property values that are desired on the updated entity. Any values not provided are set to the service default values.context- Additional context that is passed through the HTTP pipeline during the service call.- Returns:
- The updated topic with its HTTP response.
- Throws:
com.azure.core.exception.ClientAuthenticationException- if the client's credentials do not have access to modify the namespace.com.azure.core.exception.HttpResponseException- If the request body was invalid, the topic quota is exceeded, or an error occurred processing the request.IllegalArgumentException- iftopic.getName()is null or an empty string.NullPointerException- iftopicis null.- See Also:
-