Skip to content

Commit 9e6e6dc

Browse files
authored
Merge pull request #91 from Azure/dev
Merge 1.0.0 RC to master
2 parents 3bfb5ec + 4b69099 commit 9e6e6dc

File tree

96 files changed

+4537
-2458
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4537
-2458
lines changed

THIRD PARTY NOTICES

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,4 +182,28 @@ Apache Qpid Proton, obtained from https://github.com/apache/qpid-proton
182182
incurred by, or claims asserted against, such Contributor by reason
183183
of your accepting any such warranty or additional liability.
184184

185-
END OF TERMS AND CONDITIONS
185+
END OF TERMS AND CONDITIONS
186+
187+
Simple Logging Facade for Java, obtained from https://www.slf4j.org/
188+
189+
Copyright (c) 2004-2017 QOS.ch
190+
All rights reserved.
191+
192+
Permission is hereby granted, free of charge, to any person obtaining
193+
a copy of this software and associated documentation files (the
194+
"Software"), to deal in the Software without restriction, including
195+
without limitation the rights to use, copy, modify, merge, publish,
196+
distribute, sublicense, and/or sell copies of the Software, and to
197+
permit persons to whom the Software is furnished to do so, subject to
198+
the following conditions:
199+
200+
The above copyright notice and this permission notice shall be
201+
included in all copies or substantial portions of the Software.
202+
203+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
204+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
205+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
206+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
207+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
208+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
209+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
2+
<name>azure-servicebus</name>
3+
<description>Java library for Azure Service Bus</description>
4+
<modelVersion>4.0.0</modelVersion>
5+
<groupId>com.microsoft.azure</groupId>
6+
<artifactId>azure-servicebus</artifactId>
7+
<version>1.0.0-RC-1</version>
8+
<licenses>
9+
<license>
10+
<name>The MIT License (MIT)</name>
11+
<url>http://opensource.org/licenses/MIT</url>
12+
<distribution>repo</distribution>
13+
</license>
14+
</licenses>
15+
<url>https://github.com/Azure/azure-service-bus-java</url>
16+
<scm>
17+
<url>scm:git:https://github.com/Azure/azure-service-bus-java</url>
18+
<connection>scm:git:git@github.com:Azure/azure-service-bus-java.git</connection>
19+
<tag>HEAD</tag>
20+
</scm>
21+
<developers>
22+
<developer>
23+
<id>microsoft</id>
24+
<name>Microsoft</name>
25+
</developer>
26+
</developers>
27+
28+
<build>
29+
<plugins>
30+
<plugin>
31+
<groupId>org.apache.maven.plugins</groupId>
32+
<artifactId>maven-compiler-plugin</artifactId>
33+
<version>3.5</version>
34+
<configuration>
35+
<source>1.8</source>
36+
<target>1.8</target>
37+
<optimize>true</optimize>
38+
<showDeprecation>true</showDeprecation>
39+
<showWarnings>true</showWarnings>
40+
</configuration>
41+
</plugin>
42+
<plugin>
43+
<groupId>org.apache.maven.plugins</groupId>
44+
<artifactId>maven-surefire-plugin</artifactId>
45+
<version>2.20</version>
46+
</plugin>
47+
</plugins>
48+
</build>
49+
50+
<dependencies>
51+
<dependency>
52+
<groupId>org.apache.qpid</groupId>
53+
<artifactId>proton-j</artifactId>
54+
<version>0.13.1</version>
55+
</dependency>
56+
<dependency>
57+
<groupId>org.bouncycastle</groupId>
58+
<artifactId>bcpkix-jdk15on</artifactId>
59+
<version>1.49</version>
60+
</dependency>
61+
<dependency>
62+
<groupId>junit</groupId>
63+
<artifactId>junit</artifactId>
64+
<version>4.12</version>
65+
<scope>test</scope>
66+
</dependency>
67+
<dependency>
68+
<groupId>org.slf4j</groupId>
69+
<artifactId>slf4j-api</artifactId>
70+
<version>1.8.0-alpha2</version>
71+
</dependency>
72+
</dependencies>
73+
</project>

azure-servicebus/pom.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<groupId>com.microsoft.azure</groupId>
1111
<artifactId>azure-servicebus-parent</artifactId>
12-
<version>1.0.0-PREVIEW</version>
12+
<version>1.0.0-RC</version>
1313
</parent>
1414

1515
<build>
@@ -51,5 +51,15 @@
5151
<version>${junit-version}</version>
5252
<scope>test</scope>
5353
</dependency>
54+
<dependency>
55+
<groupId>org.slf4j</groupId>
56+
<artifactId>slf4j-api</artifactId>
57+
<version>${slf4j-version}</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.slf4j</groupId>
61+
<artifactId>slf4j-jdk14</artifactId>
62+
<version>${slf4j-version}</version>
63+
</dependency>
5464
</dependencies>
5565
</project>
Lines changed: 117 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,135 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
14
package com.microsoft.azure.servicebus;
25

3-
import java.io.IOException;
46
import java.time.Duration;
57
import java.time.Instant;
68
import java.util.Collection;
79
import java.util.Map;
810
import java.util.UUID;
911
import java.util.concurrent.CompletableFuture;
10-
import java.util.concurrent.ExecutionException;
1112

12-
import com.microsoft.azure.servicebus.primitives.CoreMessageReceiver;
1313
import com.microsoft.azure.servicebus.primitives.MessagingFactory;
1414
import com.microsoft.azure.servicebus.primitives.ServiceBusException;
1515

16-
final class BrowsableMessageSession extends MessageSession
17-
{
18-
private static final String INVALID_OPERATION_ERROR_MESSAGE = "Unsupported operation on a browse only session.";
19-
20-
BrowsableMessageSession(String sessionId, MessagingFactory messagingFactory, String entityPath)
21-
{
22-
super(messagingFactory, entityPath, sessionId, ReceiveMode.PeekLock);
16+
/**
17+
* A session object that can only be used to browse messages and state of a server side session. It cannot be used to receive messages from the service or to set state of the session.
18+
*/
19+
final class BrowsableMessageSession extends MessageSession {
20+
private static final String INVALID_OPERATION_ERROR_MESSAGE = "Unsupported operation on a browse only session.";
21+
22+
BrowsableMessageSession(String sessionId, MessagingFactory messagingFactory, String entityPath) {
23+
super(messagingFactory, entityPath, sessionId, ReceiveMode.PEEKLOCK);
2324
// try {
2425
// this.initializeAsync().get();
2526
// } catch (InterruptedException | ExecutionException e) {
2627
//
2728
// }
28-
}
29-
30-
@Override
31-
protected boolean isBrowsableSession()
32-
{
33-
return true;
34-
}
35-
36-
@Override
37-
public String getSessionId()
38-
{
39-
return this.getRequestedSessionId();
40-
}
41-
42-
@Override
43-
public Instant getLockedUntilUtc() {
44-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
45-
}
46-
47-
@Override
48-
public int getPrefetchCount()
49-
{
50-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
51-
}
52-
53-
@Override
54-
public void setPrefetchCount(int prefetchCount) throws ServiceBusException
55-
{
56-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
57-
}
58-
59-
@Override
60-
public CompletableFuture<Void> setStateAsync(byte[] sessionState) {
61-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
62-
}
63-
64-
@Override
65-
public CompletableFuture<Void> renewLockAsync() {
66-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
67-
}
68-
69-
@Override
70-
public ReceiveMode getReceiveMode() {
71-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
72-
}
73-
74-
@Override
75-
public CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify)
76-
{
77-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
78-
}
79-
80-
@Override
81-
public CompletableFuture<Void> completeAsync(UUID lockToken)
82-
{
83-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
84-
}
85-
86-
@Override
87-
public CompletableFuture<Void> completeBatchAsync(Collection<? extends IMessage> messages) {
88-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
89-
}
90-
91-
@Override
92-
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify)
93-
{
94-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
95-
}
96-
97-
@Override
98-
public CompletableFuture<Void> deferAsync(UUID lockToken, Map<String, Object> propertiesToModify)
99-
{
100-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
101-
}
102-
103-
@Override
104-
public CompletableFuture<IMessage> receiveAsync()
105-
{
106-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
107-
}
108-
109-
@Override
110-
public CompletableFuture<IMessage> receiveAsync(Duration serverWaitTime)
111-
{
112-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
113-
}
114-
115-
@Override
116-
public CompletableFuture<IMessage> receiveAsync(long sequenceNumber)
117-
{
118-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
119-
}
120-
121-
@Override
122-
public CompletableFuture<Collection<IMessage>> receiveBatchAsync(int maxMessageCount)
123-
{
124-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
125-
}
126-
127-
@Override
128-
public CompletableFuture<Collection<IMessage>> receiveBatchAsync(int maxMessageCount, Duration serverWaitTime)
129-
{
130-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
131-
}
132-
133-
@Override
134-
public CompletableFuture<Collection<IMessage>> receiveBatchAsync(Collection<Long> sequenceNumbers)
135-
{
136-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
137-
}
138-
139-
@Override
140-
public CompletableFuture<Instant> renewMessageLockAsync(IMessage message)
141-
{
142-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
143-
}
144-
145-
@Override
146-
public CompletableFuture<Collection<Instant>> renewMessageLockBatchAsync(Collection<? extends IMessage> messages)
147-
{
148-
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
149-
}
29+
}
30+
31+
@Override
32+
protected boolean isBrowsableSession() {
33+
return true;
34+
}
35+
36+
@Override
37+
public String getSessionId() {
38+
return this.getRequestedSessionId();
39+
}
40+
41+
@Override
42+
public Instant getLockedUntilUtc() {
43+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
44+
}
45+
46+
@Override
47+
public int getPrefetchCount() {
48+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
49+
}
50+
51+
@Override
52+
public void setPrefetchCount(int prefetchCount) throws ServiceBusException {
53+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
54+
}
55+
56+
@Override
57+
public CompletableFuture<Void> setStateAsync(byte[] sessionState) {
58+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
59+
}
60+
61+
@Override
62+
public CompletableFuture<Void> renewSessionLockAsync() {
63+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
64+
}
65+
66+
@Override
67+
public ReceiveMode getReceiveMode() {
68+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
69+
}
70+
71+
@Override
72+
public CompletableFuture<Void> abandonAsync(UUID lockToken, Map<String, Object> propertiesToModify) {
73+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
74+
}
75+
76+
@Override
77+
public CompletableFuture<Void> completeAsync(UUID lockToken) {
78+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
79+
}
80+
81+
@Override
82+
public CompletableFuture<Void> completeBatchAsync(Collection<? extends IMessage> messages) {
83+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
84+
}
85+
86+
@Override
87+
public CompletableFuture<Void> deadLetterAsync(UUID lockToken, String deadLetterReason, String deadLetterErrorDescription, Map<String, Object> propertiesToModify) {
88+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
89+
}
90+
91+
@Override
92+
public CompletableFuture<Void> deferAsync(UUID lockToken, Map<String, Object> propertiesToModify) {
93+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
94+
}
95+
96+
@Override
97+
public CompletableFuture<IMessage> receiveAsync() {
98+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
99+
}
100+
101+
@Override
102+
public CompletableFuture<IMessage> receiveAsync(Duration serverWaitTime) {
103+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
104+
}
105+
106+
@Override
107+
public CompletableFuture<IMessage> receiveDeferredMessageAsync(long sequenceNumber) {
108+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
109+
}
110+
111+
@Override
112+
public CompletableFuture<Collection<IMessage>> receiveBatchAsync(int maxMessageCount) {
113+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
114+
}
115+
116+
@Override
117+
public CompletableFuture<Collection<IMessage>> receiveBatchAsync(int maxMessageCount, Duration serverWaitTime) {
118+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
119+
}
120+
121+
@Override
122+
public CompletableFuture<Collection<IMessage>> receiveDeferredMessageBatchAsync(Collection<Long> sequenceNumbers) {
123+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
124+
}
125+
126+
@Override
127+
public CompletableFuture<Instant> renewMessageLockAsync(IMessage message) {
128+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
129+
}
130+
131+
@Override
132+
public CompletableFuture<Collection<Instant>> renewMessageLockBatchAsync(Collection<? extends IMessage> messages) {
133+
throw new UnsupportedOperationException(INVALID_OPERATION_ERROR_MESSAGE);
134+
}
150135
}

0 commit comments

Comments
 (0)