Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #41

Merged
merged 74 commits into from
Jun 26, 2013
Merged

Dev #41

Changes from 9 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
6e5475c
Merge pull request #324 from gcheng/dev
Apr 12, 2013
17f6254
Merge pull request #329 from gcheng/dev
Apr 22, 2013
8886e89
Merge pull request #332 from gcheng/dev
Apr 24, 2013
37c0aab
Merge pull request #334 from gcheng/dev
Apr 30, 2013
671e917
message count details.
May 8, 2013
46c37e4
update for 0.4.3
guangyang May 9, 2013
4ebe62f
Merge pull request #338 from gcheng/dev
May 10, 2013
0b69853
Merge pull request #679 from WindowsAzure/release
May 15, 2013
a3c14da
Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr…
May 15, 2013
69b37ab
initial check in for forward to feature.
May 16, 2013
5481757
additional implementation of forward to feature.
May 16, 2013
a6a749f
implement subscription forward to feature.
May 16, 2013
ff2faf4
implementing update for forward to feature.
May 16, 2013
a1a095a
update forward to integration test.
May 16, 2013
0fcf775
Merge pull request #342 from WindowsAzure/dev
May 17, 2013
d85d0ff
Merge pull request #343 from gcheng/dev
May 17, 2013
f0609a8
add more integration tests for forward to feature.
May 17, 2013
eb11213
refactoring and documentation work.
May 18, 2013
36489bd
fix two scenario tests for CI machine.
May 20, 2013
aa4c680
Merge pull request #40 from gcheng/cibugfix
May 20, 2013
0487fcd
Merge pull request #344 from gcheng/release
May 20, 2013
d2b1d41
Merge pull request #120 from gcheng/forwardto
May 20, 2013
255b68b
Merge pull request #681 from gcheng/dev
May 20, 2013
928fafe
initial check in for multiple property filter
May 20, 2013
189c804
Merge branch 'dev' of https://github.com/guangyang/azure-sdk-for-java…
guangyang May 22, 2013
ab64e30
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
guangyang May 22, 2013
24b88f1
update pom.xml to 0.4.3
guangyang May 22, 2013
7f4c8e5
update changelog for 0.4.2 and 0.4.3
guangyang May 22, 2013
abd2999
update based on code review feedback
guangyang May 22, 2013
b095b91
Merge pull request #345 from guangyang/release
guangyang May 22, 2013
d6abcae
complete the schema change for correlation filter.
May 22, 2013
931004c
integration test for multiple properties filter.
May 23, 2013
92c356e
initial check in for OData support.
May 23, 2013
fc61698
implement the integration tests for odata query.
May 23, 2013
a7fddd0
Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr…
May 23, 2013
cdecace
modification of service bus integration test.
May 23, 2013
dc4e7d2
remove invalid scenarios.
May 24, 2013
8d1b771
fix a broken unit test for odata query.
May 24, 2013
2c564fc
separate message count details into a separated namespace.
May 25, 2013
d41dfe0
fix a typo for the schema.
May 25, 2013
8852c2f
Merge pull request #121 from gcheng/multipropfilter
May 25, 2013
73f1d90
Merge pull request #684 from gcheng/dev
May 25, 2013
54a3ff2
Merge pull request #682 from gcheng/odata
May 28, 2013
409a112
a fix for servicebus schema.
May 28, 2013
d039ddd
Merge pull request #351 from WindowsAzure/release
xuezhai May 30, 2013
810ca6a
Merge pull request #122 from WindowsAzure/dev
Jun 3, 2013
704be53
remove bad service bus design.
Jun 3, 2013
e63622e
fix the schema for message count details.
Jun 4, 2013
004e9e6
Merge pull request #687 from gcheng/removeBadSBDesign
Jun 4, 2013
9e8f4a9
Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr…
Jun 4, 2013
15a6307
Merge pull request #123 from WindowsAzure/dev
Jun 4, 2013
7a16f2d
Merge branch 'dev' of https://github.com/gcheng/azure-sdk-for-java-pr…
Jun 4, 2013
74def0c
improving unit test for message count details.
Jun 5, 2013
5576dea
add javadoc for message count details.
Jun 5, 2013
1a61a24
remove newly introduced TODOs
Jun 5, 2013
2bfbfca
code review feedback
Jun 5, 2013
fe36b1f
Merge pull request #683 from gcheng/messagecount
Jun 5, 2013
57f75cc
updated sample code to use containerPermissions. added java & xml for…
t-aniba Jun 7, 2013
c06f38c
Revert "updated sample code to use containerPermissions. added java &…
t-aniba Jun 7, 2013
8ee99c9
fixed README.md fixes #360
t-aniba Jun 10, 2013
07297a3
harmonize the design with mooncake requirement.
Jun 10, 2013
e419ce6
Merge pull request #363 from WindowsAzure/master
xuezhai Jun 10, 2013
400c45c
Merge pull request #688 from WindowsAzure/master
xuezhai Jun 10, 2013
3ebd298
improve the unit test to ensure that the created correlation filter d…
Jun 11, 2013
63e3fc9
address code review fedback by trimming the / at the end of the sts end
Jun 11, 2013
bb2dc56
Merge pull request #364 from gcheng/mooncake
Jun 11, 2013
60bb459
Merge branch 'dev' of https://github.com/WindowsAzure/azure-sdk-for-j…
t-aniba Jun 11, 2013
921395a
Merge pull request #362 from t-aniba/dev
t-aniba Jun 11, 2013
a458658
more test improvements to validate the properties on correlation filter.
Jun 11, 2013
dec8063
Merge pull request #689 from gcheng/getrule
Jun 11, 2013
f9fb1ff
fixed mislabeled string
t-aniba Jun 13, 2013
2f76b2d
Merge pull request #365 from t-aniba/dev
t-aniba Jun 14, 2013
9fd2c2b
Merge pull request #690 from WindowsAzure/dev
Jun 25, 2013
3413c7d
Merge branch 'release' of https://github.com/WindowsAzure/azure-sdk-f…
Jun 25, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -195,13 +195,13 @@ ReceiveSubscriptionMessageResult receiveSubscriptionMessage(String topicPath, St
/**
* Creates a queue.
*
* @param queue
* A <code>Queue</code> object that represents the queue to create.
* @param queueInfo
* A <code>QueueInfo</code> object that represents the queue to create.
* @return A <code>CreateQueueResult</code> object that represents the result.
* @throws ServiceException
* If a service exception is encountered.
*/
CreateQueueResult createQueue(QueueInfo queue) throws ServiceException;
CreateQueueResult createQueue(QueueInfo queueInfo) throws ServiceException;

/**
* Deletes a queue.
Original file line number Diff line number Diff line change
@@ -267,9 +267,13 @@ public void deleteMessage(BrokeredMessage message) throws ServiceException {
}

@Override
public CreateQueueResult createQueue(QueueInfo entry) throws ServiceException {
return new CreateQueueResult(getResource().path(entry.getPath())
.type("application/atom+xml;type=entry;charset=utf-8").put(QueueInfo.class, entry));
public CreateQueueResult createQueue(QueueInfo queueInfo) throws ServiceException {
Builder webResourceBuilder = getResource().path(queueInfo.getPath()).type(
"application/atom+xml;type=entry;charset=utf-8");
if ((queueInfo.getForwardTo() != null) && !queueInfo.getForwardTo().isEmpty()) {
webResourceBuilder.header("ServiceBusSupplementaryAuthorization", queueInfo.getForwardTo());
}
return new CreateQueueResult(webResourceBuilder.put(QueueInfo.class, queueInfo));
}

@Override
@@ -296,8 +300,12 @@ public ListQueuesResult listQueues(ListQueuesOptions options) throws ServiceExce

@Override
public QueueInfo updateQueue(QueueInfo queueInfo) throws ServiceException {
return getResource().path(queueInfo.getPath()).type("application/atom+xml;type=entry;charset=utf-8")
.header("If-Match", "*").put(QueueInfo.class, queueInfo);
Builder webResourceBuilder = getResource().path(queueInfo.getPath())
.type("application/atom+xml;type=entry;charset=utf-8").header("If-Match", "*");
if ((queueInfo.getForwardTo() != null) && !queueInfo.getForwardTo().isEmpty()) {
webResourceBuilder.header("ServiceBusSupplementaryAuthorization", queueInfo.getForwardTo());
}
return webResourceBuilder.put(QueueInfo.class, queueInfo);
}

private WebResource listOptions(AbstractListOptions<?> options, WebResource path) {
@@ -348,10 +356,14 @@ public TopicInfo updateTopic(TopicInfo topicInfo) throws ServiceException {
}

@Override
public CreateSubscriptionResult createSubscription(String topicPath, SubscriptionInfo subscription) {
return new CreateSubscriptionResult(getResource().path(topicPath).path("subscriptions")
.path(subscription.getName()).type("application/atom+xml;type=entry;charset=utf-8")
.put(SubscriptionInfo.class, subscription));
public CreateSubscriptionResult createSubscription(String topicPath, SubscriptionInfo subscriptionInfo) {
Builder webResourceBuilder = getResource().path(topicPath).path("subscriptions")
.path(subscriptionInfo.getName()).type("application/atom+xml;type=entry;charset=utf-8");
if ((subscriptionInfo.getForwardTo() != null) && (!subscriptionInfo.getForwardTo().isEmpty())) {
webResourceBuilder.header("ServiceBusSupplementaryAuthorization", subscriptionInfo.getForwardTo());

}
return new CreateSubscriptionResult(webResourceBuilder.put(SubscriptionInfo.class, subscriptionInfo));
}

@Override
@@ -380,9 +392,13 @@ public ListSubscriptionsResult listSubscriptions(String topicPath, ListSubscript
@Override
public SubscriptionInfo updateSubscription(String topicName, SubscriptionInfo subscriptionInfo)
throws ServiceException {
return getResource().path(topicName).path("subscriptions").path(subscriptionInfo.getName())
.type("application/atom+xml;type=entry;charset=utf-8").header("If-Match", "*")
.put(SubscriptionInfo.class, subscriptionInfo);
Builder webResourceBuilder = getResource().path(topicName).path("subscriptions")
.path(subscriptionInfo.getName()).type("application/atom+xml;type=entry;charset=utf-8")
.header("If-Match", "*");
if ((subscriptionInfo.getForwardTo() != null) && !subscriptionInfo.getForwardTo().isEmpty()) {
webResourceBuilder.header("ServiceBusSupplementaryAuthorization", subscriptionInfo.getForwardTo());
}
return webResourceBuilder.put(SubscriptionInfo.class, subscriptionInfo);
}

@Override
Original file line number Diff line number Diff line change
@@ -2,18 +2,19 @@
* Copyright Microsoft Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.microsoft.windowsazure.services.serviceBus.implementation;

import java.net.URI;
import java.net.URISyntaxException;

import com.microsoft.windowsazure.services.core.ServiceException;
@@ -31,10 +32,23 @@ public WrapFilter(WrapTokenManager tokenManager) {

@Override
public ClientResponse handle(ClientRequest cr) throws ClientHandlerException {
String accessToken = getWrapToken(cr.getURI());
cr.getHeaders().add("Authorization", accessToken);

String accessToken;
String secondaryAuthorizationUri = (String) cr.getHeaders().getFirst("ServiceBusSupplementaryAuthorization");
if ((secondaryAuthorizationUri != null) && (!secondaryAuthorizationUri.isEmpty())) {
String secondaryAccessToken = getWrapToken(URI.create(secondaryAuthorizationUri));
cr.getHeaders().remove("ServiceBusSupplementaryAuthorization");
cr.getHeaders().add("ServiceBusSupplementaryAuthorization", secondaryAccessToken);
}

return this.getNext().handle(cr);
}

private String getWrapToken(URI uri) {
String result;
try {
accessToken = tokenManager.getAccessToken(cr.getURI());
result = tokenManager.getAccessToken(uri);
}
catch (ServiceException e) {
// must wrap exception because of base class signature
@@ -45,8 +59,6 @@ public ClientResponse handle(ClientRequest cr) throws ClientHandlerException {
throw new ClientHandlerException(e);
}

cr.getHeaders().add("Authorization", "WRAP access_token=\"" + accessToken + "\"");

return this.getNext().handle(cr);
return "WRAP access_token=\"" + result + "\"";
}
}
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
*/
package com.microsoft.windowsazure.services.serviceBus.models;

import java.net.URI;
import java.util.Calendar;

import javax.ws.rs.core.MediaType;
@@ -538,4 +539,59 @@ public QueueInfo setUserMetadata(String userMetadata) {
getModel().setUserMetadata(userMetadata);
return this;
}

/**
* Sets the URI of the <code>QueueInfo</code> instance.
*
* @param uri
* the URI of the <code>QueueInfo</code>
*
* @return A <code>QueueInfo</code> object that represents the updated queue.
*/
public QueueInfo setUri(URI uri) {
getEntry().setId(uri.toString());
return this;
}

/**
* Gets the URI of the <code>QueueInfo</code> instance.
*
* @return A <code>URI</code> representing the <code>QueueInfo</code>.
*/
public URI getUri() {
return URI.create(removeQueryString(getEntry().getId()));
}

/**
* Removes the query string of the URI.
*
* @param uri
* A raw string representing the URI of queue.
* @return the string
*/
private String removeQueryString(String uri) {
String[] result = uri.split("\\?");
return result[0];
}

/**
* Sets the URI of the entity to forward to.
*
* @param forwardTo
* A <code>String</code> instance representing the URI of the entity to forward message to.
* @return A <code>QueueInfo</code> instance representing the updated queue information.
*/
public QueueInfo setForwardTo(String forwardTo) {
getModel().setForwardTo(forwardTo);
return this;
}

/**
* Gets a <code>String</code> instance representing entity to forward to.
*
* @return A <code>String</code> instance representing the URI of the instance to forward to.
*/
public String getForwardTo() {
return getModel().getForwardTo();
}
}
Original file line number Diff line number Diff line change
@@ -430,4 +430,25 @@ public EntityAvailabilityStatus getEntityAvailabilityStatus() {
return getModel().getEntityAvailabilityStatus();
}

/**
* Sets the forward to.
*
* @param forwardTo
* A <code>String</code> representing the string to forward to.
* @return the subscription info
*/
public SubscriptionInfo setForwardTo(String forwardTo) {
getModel().setForwardTo(forwardTo);
return this;
}

/**
* Gets a <code>String</code> representing the URI of the entity to forward to.
*
* @return A <code>String</code> representing the URI of the entity to forward to.
*/
public String getForwardTo() {
return getModel().getForwardTo();
}

}
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
*/
package com.microsoft.windowsazure.services.serviceBus.models;

import java.net.URI;
import java.util.Calendar;

import javax.ws.rs.core.MediaType;
@@ -467,4 +468,8 @@ public TopicInfo setEntityAvailabilityStatus(EntityAvailabilityStatus entityAvai
public EntityAvailabilityStatus getEntityAvailabilityStatus() {
return getModel().getEntityAvailabilityStatus();
}

public URI getUri() {
return URI.create(getEntry().getId());
}
}
Original file line number Diff line number Diff line change
@@ -115,6 +115,13 @@
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="ForwardTo" type="xs:string">
<xs:annotation>
<xs:appinfo>
<DefaultValue EmitDefaultValue="false" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="CreatedAt" type="xs:dateTime">
<xs:annotation>
<xs:appinfo>
@@ -246,6 +253,13 @@
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="ForwardTo" type="xs:string">
<xs:annotation>
<xs:appinfo>
<DefaultValue EmitDefaultValue="false" xmlns="http://schemas.microsoft.com/2003/10/Serialization/" />
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="CreatedAt" type="xs:dateTime">
<xs:annotation>
<xs:appinfo>
@@ -330,7 +344,7 @@
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="RuleDescription" nillable="true" type="tns:RuleDescription" />
<xs:element name="RuleDescription" type="tns:RuleDescription" />
<xs:complexType name="Filter">
<xs:sequence />
</xs:complexType>
4 changes: 2 additions & 2 deletions microsoft-azure-api/src/main/resources/servicebus-atom.xsd
Original file line number Diff line number Diff line change
@@ -12,15 +12,15 @@
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />

<xs:element ref="tns:entry" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="entry">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string" />
<xs:element name="id" type="xs:string" />
<xs:element name="title" type="xs:string" />
<xs:element name="content" type="tns:content" minOccurs="0" />
</xs:sequence>
</xs:complexType>
Loading