Skip to content

Commit

Permalink
Merge pull request Azure#57 from loudej/d1af2a6c0b7403ab45211d5e1dfa0…
Browse files Browse the repository at this point in the history
…79bd81f028c

Implements remaining serviceBus operations
  • Loading branch information
rpaquay committed Nov 15, 2011
2 parents 83a6598 + d1af2a6 commit b4bc4a9
Show file tree
Hide file tree
Showing 36 changed files with 829 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.util.Map;

import com.microsoft.windowsazure.configuration.builder.Builder;
import com.microsoft.windowsazure.services.serviceBus.client.MessagingClient;
import com.microsoft.windowsazure.services.serviceBus.implementation.BrokerPropertiesMapper;
import com.microsoft.windowsazure.services.serviceBus.implementation.EntryModelProvider;
import com.microsoft.windowsazure.services.serviceBus.implementation.MarshallerProvider;
Expand All @@ -20,7 +19,6 @@ public void register(Builder.Registry registry) {
registry.add(ServiceBusService.class);
registry.add(ServiceBusExceptionProcessor.class);
registry.add(ServiceBusRestProxy.class);
registry.add(MessagingClient.class);

// alter jersey client config for serviceBus
registry.alter(ClientConfig.class, new Builder.Alteration<ClientConfig>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,76 @@

import com.microsoft.windowsazure.ServiceException;
import com.microsoft.windowsazure.http.ServiceFilter;
import com.microsoft.windowsazure.services.serviceBus.implementation.Entry;
import com.microsoft.windowsazure.services.serviceBus.implementation.Feed;
import com.microsoft.windowsazure.services.serviceBus.models.CreateQueueResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateRuleResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateSubscriptionResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateTopicResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetQueueResult;
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.ListQueuesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsResult;
import com.microsoft.windowsazure.services.serviceBus.models.Message;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveMessageOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveQueueMessageResult;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveSubscriptionMessageResult;
import com.microsoft.windowsazure.services.serviceBus.models.Rule;
import com.microsoft.windowsazure.services.serviceBus.models.Subscription;
import com.microsoft.windowsazure.services.serviceBus.models.Topic;

public interface ServiceBusContract {
ServiceBusContract withFilter(ServiceFilter filter);

void sendQueueMessage(String queueName, Message message) throws ServiceException;

Message receiveQueueMessage(String queueName) throws ServiceException;
ReceiveQueueMessageResult receiveQueueMessage(String queueName) throws ServiceException;

Message receiveQueueMessage(String queueName, ReceiveMessageOptions options) throws ServiceException;
ReceiveQueueMessageResult receiveQueueMessage(String queueName, ReceiveMessageOptions options) throws ServiceException;

void sendTopicMessage(String topicName, Message message) throws ServiceException;

Message receiveSubscriptionMessage(String topicName, String subscriptionName) throws ServiceException;
ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName) throws ServiceException;

Message receiveSubscriptionMessage(String topicName, String subscriptionName, ReceiveMessageOptions options) throws ServiceException;
ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName, String subscriptionName, ReceiveMessageOptions options)
throws ServiceException;

void unlockMessage(Message message) throws ServiceException;

void deleteMessage(Message message) throws ServiceException;

Queue createQueue(Queue queue) throws ServiceException;
CreateQueueResult createQueue(Queue queue) throws ServiceException;

void deleteQueue(String queueName) throws ServiceException;

Queue getQueue(String queueName) throws ServiceException;
GetQueueResult getQueue(String queueName) throws ServiceException;

ListQueuesResult listQueues() throws ServiceException;

Topic createTopic(Topic topic) throws ServiceException;
CreateTopicResult createTopic(Topic topic) throws ServiceException;

void deleteTopic(String topicName) throws ServiceException;

Topic getTopic(String topicName) throws ServiceException;
GetTopicResult getTopic(String topicName) throws ServiceException;

ListTopicsResult listTopics() throws ServiceException;

void addSubscription(String topicName, String subscriptionName, Entry subscription) throws ServiceException;
CreateSubscriptionResult createSubscription(String topicName, Subscription subscription) throws ServiceException;

void removeSubscription(String topicName, String subscriptionName) throws ServiceException;
void deleteSubscription(String topicName, String subscriptionName) throws ServiceException;

Entry getSubscription(String topicName, String subscriptionName) throws ServiceException;
GetSubscriptionResult getSubscription(String topicName, String subscriptionName) throws ServiceException;

Feed getSubscriptions(String topicName) throws ServiceException;
ListSubscriptionsResult listSubscriptions(String topicName) throws ServiceException;

void addRule(String topicName, String subscriptionName, String ruleName, Entry rule) throws ServiceException;
CreateRuleResult createRule(String topicName, String subscriptionName, Rule rule) throws ServiceException;

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

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

Feed getRules(String topicName, String subscriptionName) throws ServiceException;
ListRulesResult listRules(String topicName, String subscriptionName) throws ServiceException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,29 @@

import javax.inject.Inject;

import com.microsoft.windowsazure.services.serviceBus.implementation.Entry;
import com.microsoft.windowsazure.services.serviceBus.implementation.Feed;
import com.microsoft.windowsazure.ServiceException;
import com.microsoft.windowsazure.configuration.Configuration;
import com.microsoft.windowsazure.http.ServiceFilter;
import com.microsoft.windowsazure.services.serviceBus.models.CreateQueueResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateRuleResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateSubscriptionResult;
import com.microsoft.windowsazure.services.serviceBus.models.CreateTopicResult;
import com.microsoft.windowsazure.services.serviceBus.models.GetQueueResult;
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.ListQueuesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListRulesResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListSubscriptionsResult;
import com.microsoft.windowsazure.services.serviceBus.models.ListTopicsResult;
import com.microsoft.windowsazure.services.serviceBus.models.Message;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveMessageOptions;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveQueueMessageResult;
import com.microsoft.windowsazure.services.serviceBus.models.ReceiveSubscriptionMessageResult;
import com.microsoft.windowsazure.services.serviceBus.models.Rule;
import com.microsoft.windowsazure.services.serviceBus.models.Subscription;
import com.microsoft.windowsazure.services.serviceBus.models.Topic;

public class ServiceBusService implements ServiceBusContract {
final ServiceBusContract next;
Expand Down Expand Up @@ -41,12 +59,12 @@ public void sendQueueMessage(String queueName, Message message)
next.sendQueueMessage(queueName, message);
}

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

public Message receiveQueueMessage(String queueName,
public ReceiveQueueMessageResult receiveQueueMessage(String queueName,
ReceiveMessageOptions options) throws ServiceException {
return next.receiveQueueMessage(queueName, options);
}
Expand All @@ -56,12 +74,12 @@ public void sendTopicMessage(String topicName, Message message)
next.sendTopicMessage(topicName, message);
}

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

public Message receiveSubscriptionMessage(String topicName,
public ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicName,
String subscriptionName, ReceiveMessageOptions options)
throws ServiceException {
return next.receiveSubscriptionMessage(topicName, subscriptionName,
Expand All @@ -76,74 +94,73 @@ public void deleteMessage(Message message) throws ServiceException {
next.deleteMessage(message);
}

public Queue createQueue(Queue queue) throws ServiceException {
public CreateQueueResult createQueue(Queue queue) throws ServiceException {
return next.createQueue(queue);
}

public void deleteQueue(String queueName) throws ServiceException {
next.deleteQueue(queueName);
}

public Queue getQueue(String queueName) throws ServiceException {
public GetQueueResult getQueue(String queueName) throws ServiceException {
return next.getQueue(queueName);
}

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

public Topic createTopic(Topic topic) throws ServiceException {
public CreateTopicResult createTopic(Topic topic) throws ServiceException {
return next.createTopic(topic);
}

public void deleteTopic(String topicName) throws ServiceException {
next.deleteTopic(topicName);
}

public Topic getTopic(String topicName) throws ServiceException {
public GetTopicResult getTopic(String topicName) throws ServiceException {
return next.getTopic(topicName);
}

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

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

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

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

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

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

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

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

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

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.microsoft.windowsazure.services.serviceBus;

import com.microsoft.windowsazure.ServiceException;
import com.microsoft.windowsazure.services.serviceBus.models.Queue;
import com.microsoft.windowsazure.services.serviceBus.models.Topic;

public class Util {
public static Iterable<Queue> iterateQueues(ServiceBusContract service)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit b4bc4a9

Please sign in to comment.