Skip to content

Commit

Permalink
Merge pull request Azure#85 from loudej/servicebus-list-options
Browse files Browse the repository at this point in the history
Add support for continuation uri (skip and top). fixes #4
  • Loading branch information
rpaquay committed Nov 19, 2011
2 parents 1c2a1a3 + c78e910 commit c4fd853
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@
import com.microsoft.windowsazure.services.serviceBus.models.GetRuleResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetSubscriptionResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetTopicResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsResult;
import com.microsoft.windowsazure.services.serviceBus.models.Message;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
Expand Down Expand Up @@ -52,6 +56,8 @@ ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, St

ListQueuesResult listQueues() throws ServiceException;

ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceException;

CreateTopicResult createTopic(Topic topic) throws ServiceException;

void deleteTopic(String topicName) throws ServiceException;
Expand All @@ -60,6 +66,8 @@ ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, St

ListTopicsResult listTopics() throws ServiceException;

ListTopicsResult listTopics(ListTopicsOptions options) throws ServiceException;

CreateSubscriptionResult createSubscription(String topicName, Subscription subscription) throws ServiceException;

void deleteSubscription(String topicName, String subscriptionName) throws ServiceException;
Expand All @@ -68,11 +76,17 @@ ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, St

ListSubscriptionsResult listSubscriptions(String topicName) throws ServiceException;

ListSubscriptionsResult listSubscriptions(String topicName, ListSubscriptionsOptions options)
throws ServiceException;

CreateRuleResult createRule(String topicName, String subscriptionName, Rule rule) throws ServiceException;

void deleteRule(String topicName, String subscriptionName, String ruleName) throws ServiceException;

GetRuleResult getRule(String topicName, String subscriptionName, String ruleName) throws ServiceException;

ListRulesResult listRules(String topicName, String subscriptionName) throws ServiceException;

ListRulesResult listRules(String topicName, String subscriptionName, ListRulesOptions options)
throws ServiceException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
import com.microsoft.windowsazure.services.serviceBus.models.GetRuleResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetSubscriptionResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetTopicResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsResult;
import com.microsoft.windowsazure.services.serviceBus.models.Message;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
Expand Down Expand Up @@ -54,36 +58,31 @@ public ServiceBusContract withFilter(ServiceFilter filter) {
return next.withFilter(filter);
}

public void sendQueueMessage(String queueName, Message message)
throws ServiceException {
public void sendQueueMessage(String queueName, Message message) throws ServiceException {
next.sendQueueMessage(queueName, message);
}

public ReceiveQueueMessageResult receiveQueueMessage(String queueName)
throws ServiceException {
public ReceiveQueueMessageResult receiveQueueMessage(String queueName) throws ServiceException {
return next.receiveQueueMessage(queueName);
}

public ReceiveQueueMessageResult receiveQueueMessage(String queueName,
ReceiveMessageOptions options) throws ServiceException {
public ReceiveQueueMessageResult receiveQueueMessage(String queueName, ReceiveMessageOptions options)
throws ServiceException {
return next.receiveQueueMessage(queueName, options);
}

public void sendTopicMessage(String topicName, Message message)
throws ServiceException {
public void sendTopicMessage(String topicName, Message message) throws ServiceException {
next.sendTopicMessage(topicName, message);
}

public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName,
String subscriptionName) throws ServiceException {
public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName)
throws ServiceException {
return next.receiveSubscriptionMessage(topicName, subscriptionName);
}

public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName,
String subscriptionName, ReceiveMessageOptions options)
throws ServiceException {
return next.receiveSubscriptionMessage(topicName, subscriptionName,
options);
public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName,
ReceiveMessageOptions options) throws ServiceException {
return next.receiveSubscriptionMessage(topicName, subscriptionName, options);
}

public void unlockMessage(Message message) throws ServiceException {
Expand Down Expand Up @@ -126,41 +125,54 @@ public ListTopicsResult listTopics() throws ServiceException {
return next.listTopics();
}

public CreateSubscriptionResult createSubscription(String topicName, Subscription subscription) throws ServiceException {
public CreateSubscriptionResult createSubscription(String topicName, Subscription subscription)
throws ServiceException {
return next.createSubscription(topicName, subscription);
}

public void deleteSubscription(String topicName, String subscriptionName)
throws ServiceException {
public void deleteSubscription(String topicName, String subscriptionName) throws ServiceException {
next.deleteSubscription(topicName, subscriptionName);
}

public GetSubscriptionResult getSubscription(String topicName, String subscriptionName)
throws ServiceException {
public GetSubscriptionResult getSubscription(String topicName, String subscriptionName) throws ServiceException {
return next.getSubscription(topicName, subscriptionName);
}

public ListSubscriptionsResult listSubscriptions(String topicName) throws ServiceException {
return next.listSubscriptions(topicName);
}

public CreateRuleResult createRule(String topicName, String subscriptionName,
Rule rule) throws ServiceException {
public CreateRuleResult createRule(String topicName, String subscriptionName, Rule rule) throws ServiceException {
return next.createRule(topicName, subscriptionName, rule);
}

public void deleteRule(String topicName, String subscriptionName,
String ruleName) throws ServiceException {
public void deleteRule(String topicName, String subscriptionName, String ruleName) throws ServiceException {
next.deleteRule(topicName, subscriptionName, ruleName);
}

public GetRuleResult getRule(String topicName, String subscriptionName,
String ruleName) throws ServiceException {
public GetRuleResult getRule(String topicName, String subscriptionName, String ruleName) throws ServiceException {
return next.getRule(topicName, subscriptionName, ruleName);
}

public ListRulesResult listRules(String topicName, String subscriptionName)
throws ServiceException {
public ListRulesResult listRules(String topicName, String subscriptionName) throws ServiceException {
return next.listRules(topicName, subscriptionName);
}

public ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceException {
return next.listQueues(options);
}

public ListTopicsResult listTopics(ListTopicsOptions options) throws ServiceException {
return next.listTopics(options);
}

public ListSubscriptionsResult listSubscriptions(String topicName, ListSubscriptionsOptions options)
throws ServiceException {
return next.listSubscriptions(topicName, options);
}

public ListRulesResult listRules(String topicName, String subscriptionName, ListRulesOptions options)
throws ServiceException {
return next.listRules(topicName, subscriptionName, options);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
import com.microsoft.windowsazure.services.serviceBus.models.GetRuleResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetSubscriptionResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetTopicResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListQueuesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsResult;
import com.microsoft.windowsazure.services.serviceBus.models.Message;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
Expand Down Expand Up @@ -55,8 +59,7 @@ private ServiceException processCatch(ServiceException e) {
return ServiceExceptionFactory.process("serviceBus", e);
}

public void sendQueueMessage(String path, Message message)
throws ServiceException {
public void sendQueueMessage(String path, Message message) throws ServiceException {
try {
next.sendQueueMessage(path, message);
}
Expand All @@ -68,8 +71,7 @@ public void sendQueueMessage(String path, Message message)
}
}

public ReceiveQueueMessageResult receiveQueueMessage(String queueName)
throws ServiceException {
public ReceiveQueueMessageResult receiveQueueMessage(String queueName) throws ServiceException {
try {
return next.receiveQueueMessage(queueName);
}
Expand All @@ -81,8 +83,8 @@ public ReceiveQueueMessageResult receiveQueueMessage(String queueName)
}
}

public ReceiveQueueMessageResult receiveQueueMessage(String queueName,
ReceiveMessageOptions options) throws ServiceException {
public ReceiveQueueMessageResult receiveQueueMessage(String queueName, ReceiveMessageOptions options)
throws ServiceException {
try {
return next.receiveQueueMessage(queueName, options);
}
Expand All @@ -94,8 +96,7 @@ public ReceiveQueueMessageResult receiveQueueMessage(String queueName,
}
}

public void sendTopicMessage(String path, Message message)
throws ServiceException {
public void sendTopicMessage(String path, Message message) throws ServiceException {
try {
next.sendTopicMessage(path, message);
}
Expand All @@ -107,11 +108,10 @@ public void sendTopicMessage(String path, Message message)
}
}

public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName,
String subscriptionName) throws ServiceException {
public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName)
throws ServiceException {
try {
return next.receiveSubscriptionMessage(topicName,
subscriptionName);
return next.receiveSubscriptionMessage(topicName, subscriptionName);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
Expand All @@ -121,12 +121,10 @@ public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicN
}
}

public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName,
String subscriptionName, ReceiveMessageOptions options)
throws ServiceException {
public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName,
ReceiveMessageOptions options) throws ServiceException {
try {
return next.receiveSubscriptionMessage(topicName,
subscriptionName, options);
return next.receiveSubscriptionMessage(topicName, subscriptionName, options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
Expand Down Expand Up @@ -256,7 +254,8 @@ public ListTopicsResult listTopics() throws ServiceException {
}
}

public CreateSubscriptionResult createSubscription(String topicPath, Subscription subscription) throws ServiceException {
public CreateSubscriptionResult createSubscription(String topicPath, Subscription subscription)
throws ServiceException {
try {
return next.createSubscription(topicPath, subscription);
}
Expand All @@ -268,8 +267,7 @@ public CreateSubscriptionResult createSubscription(String topicPath, Subscriptio
}
}

public void deleteSubscription(String topicPath, String subscriptionName)
throws ServiceException {
public void deleteSubscription(String topicPath, String subscriptionName) throws ServiceException {
try {
next.deleteSubscription(topicPath, subscriptionName);
}
Expand All @@ -281,8 +279,7 @@ public void deleteSubscription(String topicPath, String subscriptionName)
}
}

public GetSubscriptionResult getSubscription(String topicPath, String subscriptionName)
throws ServiceException {
public GetSubscriptionResult getSubscription(String topicPath, String subscriptionName) throws ServiceException {
try {
return next.getSubscription(topicPath, subscriptionName);
}
Expand All @@ -306,8 +303,7 @@ public ListSubscriptionsResult listSubscriptions(String topicPath) throws Servic
}
}

public CreateRuleResult createRule(String topicPath, String subscriptionName,
Rule rule) throws ServiceException {
public CreateRuleResult createRule(String topicPath, String subscriptionName, Rule rule) throws ServiceException {
try {
return next.createRule(topicPath, subscriptionName, rule);
}
Expand All @@ -319,8 +315,7 @@ public CreateRuleResult createRule(String topicPath, String subscriptionName,
}
}

public void deleteRule(String topicPath, String subscriptionName,
String ruleName) throws ServiceException {
public void deleteRule(String topicPath, String subscriptionName, String ruleName) throws ServiceException {
try {
next.deleteRule(topicPath, subscriptionName, ruleName);
}
Expand All @@ -332,8 +327,7 @@ public void deleteRule(String topicPath, String subscriptionName,
}
}

public GetRuleResult getRule(String topicPath, String subscriptionName,
String ruleName) throws ServiceException {
public GetRuleResult getRule(String topicPath, String subscriptionName, String ruleName) throws ServiceException {
try {
return next.getRule(topicPath, subscriptionName, ruleName);
}
Expand All @@ -345,8 +339,7 @@ public GetRuleResult getRule(String topicPath, String subscriptionName,
}
}

public ListRulesResult listRules(String topicPath, String subscriptionName)
throws ServiceException {
public ListRulesResult listRules(String topicPath, String subscriptionName) throws ServiceException {
try {
return next.listRules(topicPath, subscriptionName);
}
Expand All @@ -358,4 +351,54 @@ public ListRulesResult listRules(String topicPath, String subscriptionName)
}
}

public ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceException {
try {
return next.listQueues(options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
}
catch (ClientHandlerException e) {
throw processCatch(new ServiceException(e));
}
}

public ListTopicsResult listTopics(ListTopicsOptions options) throws ServiceException {
try {
return next.listTopics(options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
}
catch (ClientHandlerException e) {
throw processCatch(new ServiceException(e));
}
}

public ListSubscriptionsResult listSubscriptions(String topicName, ListSubscriptionsOptions options)
throws ServiceException {
try {
return next.listSubscriptions(topicName, options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
}
catch (ClientHandlerException e) {
throw processCatch(new ServiceException(e));
}
}

public ListRulesResult listRules(String topicName, String subscriptionName, ListRulesOptions options)
throws ServiceException {
try {
return next.listRules(topicName, subscriptionName, options);
}
catch (UniformInterfaceException e) {
throw processCatch(new ServiceException(e));
}
catch (ClientHandlerException e) {
throw processCatch(new ServiceException(e));
}
}

}
Loading

0 comments on commit c4fd853

Please sign in to comment.