共用方式為


ServiceBusAdministrationClient Class

  • java.lang.Object
    • com.azure.messaging.servicebus.administration.ServiceBusAdministrationClient

public final class ServiceBusAdministrationClient

A synchronous client for managing a Service Bus namespace. Instantiated via 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);
 }

Method Summary

Modifier and Type Method and Description
QueueProperties createQueue(String queueName)

Creates a queue with the given name.

QueueProperties createQueue(String queueName, CreateQueueOptions queueOptions)

Creates a queue with the CreateQueueOptions.

Response<QueueProperties> createQueueWithResponse(String queueName, CreateQueueOptions queueOptions, Context context)

Creates a queue and returns the created queue in addition to the HTTP response.

RuleProperties createRule(String topicName, String subscriptionName, String ruleName)

Creates a rule under the given topic and subscription

RuleProperties createRule(String topicName, String ruleName, String subscriptionName, CreateRuleOptions ruleOptions)

Creates a rule with the CreateRuleOptions.

Response<RuleProperties> createRuleWithResponse(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions, Context context)

Creates a rule and returns the created rule in addition to the HTTP response.

SubscriptionProperties createSubscription(String topicName, String subscriptionName)

Creates a subscription with the given topic and subscription names.

SubscriptionProperties createSubscription(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions)

Creates a subscription with the CreateSubscriptionOptions.

SubscriptionProperties createSubscription(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions)

Creates a subscription with default rule using the CreateSubscriptionOptions and CreateRuleOptions.

Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions, Context context)

Creates a subscription and returns the created subscription in addition to the HTTP response.

Response<SubscriptionProperties> createSubscriptionWithResponse(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions, Context context)

Creates a subscription with default rule configured and returns the created subscription in addition to the HTTP response.

TopicProperties createTopic(String topicName)

Creates a topic with the given name.

TopicProperties createTopic(String topicName, CreateTopicOptions topicOptions)

Creates a topic with the CreateTopicOptions.

Response<TopicProperties> createTopicWithResponse(String topicName, CreateTopicOptions topicOptions, Context context)

Creates a topic and returns the created topic in addition to the HTTP response.

void deleteQueue(String queueName)

Deletes a queue the matching queueName.

Response<Void> deleteQueueWithResponse(String queueName, Context context)

Deletes a queue the matching queueName and returns the HTTP response.

void deleteRule(String topicName, String subscriptionName, String ruleName)

Deletes a rule the matching ruleName.

Response<Void> deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName, Context context)

Deletes a rule the matching ruleName and returns the HTTP response.

void deleteSubscription(String topicName, String subscriptionName)

Deletes a subscription matching the subscriptionName in topic topicName.

Response<Void> deleteSubscriptionWithResponse(String topicName, String subscriptionName, Context context)

Deletes a subscription the matching subscriptionName and returns the HTTP response.

void deleteTopic(String topicName)

Deletes a topic the matching topicName.

Response<Void> deleteTopicWithResponse(String topicName, Context context)

Deletes a topic the matching topicName and returns the HTTP response.

NamespaceProperties getNamespaceProperties()

Gets information about the Service Bus namespace.

Response<NamespaceProperties> getNamespacePropertiesWithResponse(Context context)

Gets information about the Service Bus namespace along with its HTTP response.

QueueProperties getQueue(String queueName)

Gets information about the queue.

boolean getQueueExists(String queueName)

Gets whether a queue with queueName exists in the Service Bus namespace.

Response<Boolean> getQueueExistsWithResponse(String queueName, Context context)

Gets whether a queue with queueName exists in the Service Bus namespace.

QueueRuntimeProperties getQueueRuntimeProperties(String queueName)

Gets runtime properties about the queue.

Response<QueueRuntimeProperties> getQueueRuntimePropertiesWithResponse(String queueName, Context context)

Gets runtime properties about the queue along with its HTTP response.

Response<QueueProperties> getQueueWithResponse(String queueName, Context context)

Gets information about the queue along with its HTTP response.

RuleProperties getRule(String topicName, String subscriptionName, String ruleName)

Gets a rule from the service namespace.

Response<RuleProperties> getRuleWithResponse(String topicName, String subscriptionName, String ruleName, Context context)

Gets a rule from the service namespace.

SubscriptionProperties getSubscription(String topicName, String subscriptionName)

Gets information about the queue.

boolean getSubscriptionExists(String topicName, String subscriptionName)

Gets whether a subscription within a topic exists.

Response<Boolean> getSubscriptionExistsWithResponse(String topicName, String subscriptionName, Context context)

Gets whether a subscription within a topic exists.

SubscriptionRuntimeProperties getSubscriptionRuntimeProperties(String topicName, String subscriptionName)

Gets runtime properties about the subscription.

Response<SubscriptionRuntimeProperties> getSubscriptionRuntimePropertiesWithResponse(String topicName, String subscriptionName, Context context)

Gets runtime properties about the subscription.

Response<SubscriptionProperties> getSubscriptionWithResponse(String topicName, String subscriptionName, Context context)

Gets information about the subscription along with its HTTP response.

TopicProperties getTopic(String topicName)

Gets information about the topic.

boolean getTopicExists(String topicName)

Gets whether a topic with topicName exists in the Service Bus namespace.

Response<Boolean> getTopicExistsWithResponse(String topicName, Context context)

Gets whether a topic with topicName exists in the Service Bus namespace.

TopicRuntimeProperties getTopicRuntimeProperties(String topicName)

Gets runtime properties about the topic.

Response<TopicRuntimeProperties> getTopicRuntimePropertiesWithResponse(String topicName, Context context)

Gets runtime properties about the topic with its HTTP response.

Response<TopicProperties> getTopicWithResponse(String topicName, Context context)

Gets information about the topic along with its HTTP response.

PagedIterable<QueueProperties> listQueues()

Fetches all the queues in the Service Bus namespace.

PagedIterable<QueueProperties> listQueues(Context context)

Fetches all the queues in the Service Bus namespace.

PagedIterable<RuleProperties> listRules(String topicName, String subscriptionName)

Fetches all the rules for a topic and subscription.

PagedIterable<RuleProperties> listRules(String topicName, String subscriptionName, Context context)

Fetches all the rules for a topic and subscription.

PagedIterable<SubscriptionProperties> listSubscriptions(String topicName)

Fetches all the subscriptions for a topic.

PagedIterable<SubscriptionProperties> listSubscriptions(String topicName, Context context)

Fetches all the subscriptions for a topic.

PagedIterable<TopicProperties> listTopics()

Fetches all the topics in the Service Bus namespace.

PagedIterable<TopicProperties> listTopics(Context context)

Fetches all the topics in the Service Bus namespace.

QueueProperties updateQueue(QueueProperties queue)

Updates a queue with the given QueueProperties.

Response<QueueProperties> updateQueueWithResponse(QueueProperties queue, Context context)

Updates a queue with the given QueueProperties.

RuleProperties updateRule(String topicName, String subscriptionName, RuleProperties rule)

Updates a rule with the given RuleProperties.

Response<RuleProperties> updateRuleWithResponse(String topicName, String subscriptionName, RuleProperties rule, Context context)

Updates a rule with the given RuleProperties.

SubscriptionProperties updateSubscription(SubscriptionProperties subscription)

Updates a subscription with the given SubscriptionProperties.

Response<SubscriptionProperties> updateSubscriptionWithResponse(SubscriptionProperties subscription, Context context)

Updates a subscription with the given SubscriptionProperties.

TopicProperties updateTopic(TopicProperties topic)

Updates a topic with the given TopicProperties.

Response<TopicProperties> updateTopicWithResponse(TopicProperties topic, Context context)

Updates a topic with the given TopicProperties.

Methods inherited from java.lang.Object

Method Details

createQueue

public QueueProperties createQueue(String queueName)

Creates a queue with the given name.

Parameters:

queueName - Name of the queue to create.

Returns:

The created queue.

createQueue

public QueueProperties createQueue(String queueName, CreateQueueOptions queueOptions)

Creates a queue with the CreateQueueOptions.

Parameters:

queueName - Name of the queue to create.
queueOptions - Information about the queue to create.

Returns:

The created queue.

createQueueWithResponse

public Response createQueueWithResponse(String queueName, CreateQueueOptions queueOptions, 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.

createRule

public RuleProperties createRule(String topicName, String subscriptionName, String ruleName)

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.

createRule

public RuleProperties createRule(String topicName, String ruleName, String subscriptionName, CreateRuleOptions ruleOptions)

Creates a rule with the CreateRuleOptions.

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.

createRuleWithResponse

public Response createRuleWithResponse(String topicName, String subscriptionName, String ruleName, CreateRuleOptions ruleOptions, 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.

createSubscription

public SubscriptionProperties createSubscription(String topicName, String subscriptionName)

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.

createSubscription

public SubscriptionProperties createSubscription(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions)

Creates a subscription with the CreateSubscriptionOptions.

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.

createSubscription

public SubscriptionProperties createSubscription(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions)

Creates a subscription with default rule using the CreateSubscriptionOptions and CreateRuleOptions.

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 - A CreateSubscriptionOptions object describing the subscription to create.
ruleOptions - A CreateRuleOptions object describing the default rule. If null, then pass-through filter will be created.

Returns:

Information about the created subscription.

createSubscriptionWithResponse

public Response createSubscriptionWithResponse(String topicName, String subscriptionName, CreateSubscriptionOptions subscriptionOptions, 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.

createSubscriptionWithResponse

public Response createSubscriptionWithResponse(String topicName, String subscriptionName, String ruleName, CreateSubscriptionOptions subscriptionOptions, CreateRuleOptions ruleOptions, 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 - A CreateSubscriptionOptions object describing the subscription to create.
ruleOptions - A CreateRuleOptions object 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.

createTopic

public TopicProperties createTopic(String topicName)

Creates a topic with the given name.

Parameters:

topicName - Name of the topic to create.

Returns:

Information about the created topic.

createTopic

public TopicProperties createTopic(String topicName, CreateTopicOptions topicOptions)

Creates a topic with the CreateTopicOptions.

Parameters:

topicName - Name of the topic to create.
topicOptions - Information about the topic to create.

Returns:

Information about the created topic.

createTopicWithResponse

public Response createTopicWithResponse(String topicName, CreateTopicOptions topicOptions, 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.

deleteQueue

public void deleteQueue(String queueName)

Deletes a queue the matching queueName.

Parameters:

queueName - Name of queue to delete.

deleteQueueWithResponse

public Response deleteQueueWithResponse(String queueName, Context context)

Deletes a queue the matching queueName and 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.

deleteRule

public void deleteRule(String topicName, String subscriptionName, String ruleName)

Deletes a rule the matching ruleName.

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.

deleteRuleWithResponse

public Response deleteRuleWithResponse(String topicName, String subscriptionName, String ruleName, Context context)

Deletes a rule the matching ruleName and 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.

deleteSubscription

public void deleteSubscription(String topicName, String subscriptionName)

Deletes a subscription matching the subscriptionName in topic topicName.

Parameters:

topicName - Name of topic associated with subscription to delete.
subscriptionName - Name of subscription to delete.

deleteSubscriptionWithResponse

public Response deleteSubscriptionWithResponse(String topicName, String subscriptionName, Context context)

Deletes a subscription the matching subscriptionName and 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.

deleteTopic

public void deleteTopic(String topicName)

Deletes a topic the matching topicName.

Parameters:

topicName - Name of topic to delete.

deleteTopicWithResponse

public Response deleteTopicWithResponse(String topicName, Context context)

Deletes a topic the matching topicName and 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.

getNamespaceProperties

public NamespaceProperties getNamespaceProperties()

Gets information about the Service Bus namespace.

Returns:

Information about the Service Bus namespace.

getNamespacePropertiesWithResponse

public Response getNamespacePropertiesWithResponse(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.

getQueue

public QueueProperties getQueue(String queueName)

Gets information about the queue.

Parameters:

queueName - Name of queue to get information about.

Returns:

Information about the queue.

getQueueExists

public boolean getQueueExists(String queueName)

Gets whether a queue with queueName exists in the Service Bus namespace.

Parameters:

queueName - Name of the queue.

Returns:

true if the queue exists; otherwise false.

getQueueExistsWithResponse

public Response getQueueExistsWithResponse(String queueName, Context context)

Gets whether a queue with queueName exists 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 true if the queue exists; otherwise false.

getQueueRuntimeProperties

public QueueRuntimeProperties getQueueRuntimeProperties(String queueName)

Gets runtime properties about the queue.

Parameters:

queueName - Name of queue to get information about.

Returns:

Runtime properties about the queue.

getQueueRuntimePropertiesWithResponse

public Response getQueueRuntimePropertiesWithResponse(String queueName, 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.

getQueueWithResponse

public Response getQueueWithResponse(String queueName, 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.

getRule

public RuleProperties getRule(String topicName, String subscriptionName, String ruleName)

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 Response getRuleWithResponse(String topicName, String subscriptionName, String ruleName, 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

public SubscriptionProperties getSubscription(String topicName, String subscriptionName)

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.

getSubscriptionExists

public boolean getSubscriptionExists(String topicName, String subscriptionName)

Gets whether a subscription within a topic exists.

Parameters:

topicName - Name of topic associated with subscription.
subscriptionName - Name of the subscription.

Returns:

true if the subscription exists.

getSubscriptionExistsWithResponse

public Response getSubscriptionExistsWithResponse(String topicName, String subscriptionName, 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 true if the subscription exists; otherwise false.

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.

getSubscriptionRuntimePropertiesWithResponse

public Response getSubscriptionRuntimePropertiesWithResponse(String topicName, String subscriptionName, 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.

getSubscriptionWithResponse

public Response getSubscriptionWithResponse(String topicName, String subscriptionName, 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.

getTopic

public TopicProperties getTopic(String topicName)

Gets information about the topic.

Parameters:

topicName - Name of topic to get information about.

Returns:

Information about the topic.

getTopicExists

public boolean getTopicExists(String topicName)

Gets whether a topic with topicName exists in the Service Bus namespace.

Parameters:

topicName - Name of the topic.

Returns:

true if the topic exists.

getTopicExistsWithResponse

public Response getTopicExistsWithResponse(String topicName, Context context)

Gets whether a topic with topicName exists 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 true if the topic exists; otherwise false.

getTopicRuntimeProperties

public TopicRuntimeProperties getTopicRuntimeProperties(String topicName)

Gets runtime properties about the topic.

Parameters:

topicName - Name of topic to get information about.

Returns:

Runtime properties about the topic.

getTopicRuntimePropertiesWithResponse

public Response getTopicRuntimePropertiesWithResponse(String topicName, 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.

getTopicWithResponse

public Response getTopicWithResponse(String topicName, 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.

listQueues

public PagedIterable listQueues()

Fetches all the queues in the Service Bus namespace.

Returns:

A PagedIterable of QueueProperties in the Service Bus namespace.

listQueues

public PagedIterable listQueues(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 QueueProperties in the Service Bus namespace.

listRules

public PagedIterable 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 RuleProperties for the topicName and subscriptionName.

listRules

public PagedIterable listRules(String topicName, String subscriptionName, 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 RuleProperties for the topicName and subscriptionName.

listSubscriptions

public PagedIterable 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 SubscriptionProperties for the topicName.

listSubscriptions

public PagedIterable listSubscriptions(String topicName, 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 SubscriptionProperties for the topicName.

listTopics

public PagedIterable listTopics()

Fetches all the topics in the Service Bus namespace.

Returns:

A paged iterable of TopicProperties in the Service Bus namespace.

listTopics

public PagedIterable listTopics(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 TopicProperties in the Service Bus namespace.

updateQueue

public QueueProperties updateQueue(QueueProperties queue)

Updates a queue with the given QueueProperties. The QueueProperties must 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:

  1. getQueue(String queueName)
  2. Update the required elements.
  3. 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.

updateQueueWithResponse

public Response updateQueueWithResponse(QueueProperties queue, Context context)

Updates a queue with the given QueueProperties. The QueueProperties must 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:

  1. getQueue(String queueName)
  2. Update the required elements.
  3. 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.

updateRule

public RuleProperties updateRule(String topicName, String subscriptionName, RuleProperties rule)

Updates a rule with the given RuleProperties. The RuleProperties must 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:

  1. getRule(String topicName, String subscriptionName, String ruleName)
  2. Update the required elements.
  3. 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.

updateRuleWithResponse

public Response updateRuleWithResponse(String topicName, String subscriptionName, RuleProperties rule, Context context)

Updates a rule with the given RuleProperties. The RuleProperties must 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:

  1. getRule(String topicName, String subscriptionName, String ruleName)
  2. Update the required elements.
  3. 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.

updateSubscription

public SubscriptionProperties updateSubscription(SubscriptionProperties subscription)

Updates a subscription with the given SubscriptionProperties. The SubscriptionProperties must 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:

  1. getSubscription(String topicName, String subscriptionName)
  2. Update the required elements.
  3. 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.

updateSubscriptionWithResponse

public Response updateSubscriptionWithResponse(SubscriptionProperties subscription, Context context)

Updates a subscription with the given SubscriptionProperties. The SubscriptionProperties must 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:

  1. getSubscription(String topicName, String subscriptionName)
  2. Update the required elements.
  3. 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.

updateTopic

public TopicProperties updateTopic(TopicProperties topic)

Updates a topic with the given TopicProperties. The TopicProperties must 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:

  1. getTopic(String topicName)
  2. Update the required elements.
  3. 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.

updateTopicWithResponse

public Response updateTopicWithResponse(TopicProperties topic, Context context)

Updates a topic with the given TopicProperties. The TopicProperties must 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:

  1. getTopic(String topicName)
  2. Update the required elements.
  3. 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.

Applies to