Skip to content

Commit f4631c3

Browse files
author
Emile Joubert
committed
Merged bug20589 into default
2 parents 1454cfc + 1c510c2 commit f4631c3

File tree

91 files changed

+1150
-1234
lines changed

Some content is hidden

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

91 files changed

+1150
-1234
lines changed

codegen.py

Lines changed: 353 additions & 162 deletions
Large diffs are not rendered by default.

nexus-upload.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ for artifact in $@; do
1919
rm -f $artifact.asc
2020
gpg --homedir $GNUPG_PATH/.gnupg --local-user $SIGNING_KEY --no-tty --armor --detach-sign --output $artifact.asc $artifact
2121
for ext in '' .asc ; do
22-
curl -XPUT --data-binary @$artifact$ext $NEXUS_ROOT/$artifact$ext
22+
curl --upload-file $artifact$ext $NEXUS_ROOT/$artifact$ext
2323
for sum in md5 sha1 ; do
2424
${sum}sum $artifact$ext | (read a rest ; echo -n "$a") >$artifact$ext.$sum
25-
curl -XPUT --data-binary @$artifact$ext.$sum $NEXUS_ROOT/$artifact$ext.$sum
25+
curl --upload-file $artifact$ext.$sum $NEXUS_ROOT/$artifact$ext.$sum
2626
done
2727
done
2828
done

src/com/rabbitmq/client/AlreadyClosedException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
* which was already closed
2323
*/
2424
public class AlreadyClosedException extends ShutdownSignalException {
25+
/** Default for suppressing warnings without version check. */
26+
private static final long serialVersionUID = 1L;
27+
2528
public AlreadyClosedException(String s, Object ref)
2629
{
2730
super(true, true, s, ref);

src/com/rabbitmq/client/BasicProperties.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,78 +104,91 @@ public interface BasicProperties {
104104
* Set the contentType field, or null indicating the field is not set
105105
* @param contentType the value to set the field to
106106
*/
107+
@Deprecated
107108
public abstract void setContentType(String contentType);
108109

109110
/**
110111
* Set the contentEncoding field, or null indicating the field is not set
111112
* @param contentEncoding - the value to set the field to
112113
*/
114+
@Deprecated
113115
public abstract void setContentEncoding(String contentEncoding);
114116

115117
/**
116118
* Set the headers table, or null indicating the field is not set
117119
* @param headers a map of table field names and values
118120
*/
121+
@Deprecated
119122
public abstract void setHeaders(Map<String, Object> headers);
120123

121124
/**
122125
* Set the deliveryMode field, or null indicating the field is not set
123126
* @param deliveryMode the value to set the field to
124127
*/
128+
@Deprecated
125129
public abstract void setDeliveryMode(Integer deliveryMode);
126130

127131
/**
128132
* Set the priority field, or null indicating the field is not set
129133
* @param priority the value to set the field to
130134
*/
135+
@Deprecated
131136
public abstract void setPriority(Integer priority);
132137

133138
/**
134139
* Set the correlationId field, or null indicating the field is not set
135140
* @param correlationId the value to set the field to
136141
*/
142+
@Deprecated
137143
public abstract void setCorrelationId(String correlationId);
138144

139145
/**
140146
* Set the replyTo field, or null indicating the field is not set
141147
* @param replyTo the value to set the field to
142148
*/
149+
@Deprecated
143150
public abstract void setReplyTo(String replyTo);
144151

145152
/**
146153
* Set the expiration field, or null indicating the field is not set
147154
* @param expiration the value to set the field to
148155
*/
156+
@Deprecated
149157
public abstract void setExpiration(String expiration);
150158

151159
/**
152160
* Set the messageId field, or null indicating the field is not set
153161
* @param messageId the value to set the field to
154162
*/
163+
@Deprecated
155164
public abstract void setMessageId(String messageId);
156165

157166
/**
158167
* Set the timestamp field, or null indicating the field is not set
159168
* @param timestamp the value to set the field to
160169
*/
170+
@Deprecated
161171
public abstract void setTimestamp(Date timestamp);
162172

163173
/**
164174
* Set the type field, or null indicating the field is not set
165175
* @param type the value to set the field to
166176
*/
177+
@Deprecated
167178
public abstract void setType(String type);
168179

169180
/**
170181
* Set the userId field, or null indicating the field is not set
171182
* @param userId the value to set the field to
172183
*/
184+
@Deprecated
173185
public abstract void setUserId(String userId);
174186

175187
/**
176188
* Set the appId field, or null indicating the field is not set
177189
* @param appId the value to set the field to
178190
*/
191+
@Deprecated
179192
public abstract void setAppId(String appId);
180-
193+
181194
}

src/com/rabbitmq/client/Channel.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,4 +696,19 @@ void basicNack(long deliveryTag, boolean multiple, boolean requeue)
696696
* @return the sequence number of the next message to be published
697697
*/
698698
long getNextPublishSeqNo();
699+
700+
/**
701+
* Asynchronously send a method over this channel.
702+
* @param method method to transmit over this channel.
703+
* @throws IOException Problem transmitting method.
704+
*/
705+
void asyncRpc(Method method) throws IOException;
706+
707+
/**
708+
* Synchronously send a method over this channel.
709+
* @param method method to transmit over this channel.
710+
* @return response to method. Caller should cast as appropriate.
711+
* @throws IOException Problem transmitting method.
712+
*/
713+
Method rpc(Method method) throws IOException;
699714
}

src/com/rabbitmq/client/ConnectionFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public class ConnectionFactory implements Cloneable {
8989
private int connectionTimeout = DEFAULT_CONNECTION_TIMEOUT;
9090
private Map<String, Object> _clientProperties = AMQConnection.defaultClientProperties();
9191
private SocketFactory factory = SocketFactory.getDefault();
92-
private SaslConfig saslConfig = new DefaultSaslConfig(this);
92+
private SaslConfig saslConfig = DefaultSaslConfig.PLAIN;
9393

9494
/**
9595
* Instantiate a ConnectionFactory with a default set of parameters.

src/com/rabbitmq/client/ConsumerCancelledException.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
public class ConsumerCancelledException extends RuntimeException implements
2222
SensibleClone<ConsumerCancelledException> {
2323

24+
/** Default for non-checking. */
25+
private static final long serialVersionUID = 1L;
26+
2427
@Override
2528
public ConsumerCancelledException sensibleClone() {
2629
try {

src/com/rabbitmq/client/ContentHeader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,5 @@ public interface ContentHeader extends Cloneable {
3838
* A debugging utility - enable properties to be appended to a string buffer for use as trace messages.
3939
* @param buffer a place to append the properties as a string
4040
*/
41-
public void appendPropertyDebugStringTo(StringBuffer buffer);
41+
public void appendPropertyDebugStringTo(StringBuilder buffer);
4242
}

src/com/rabbitmq/client/DefaultSaslConfig.java

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,56 +16,40 @@
1616

1717
package com.rabbitmq.client;
1818

19-
import javax.security.auth.callback.CallbackHandler;
20-
import javax.security.sasl.Sasl;
21-
import javax.security.sasl.SaslClient;
22-
import javax.security.sasl.SaslException;
19+
import com.rabbitmq.client.impl.ExternalMechanism;
20+
import com.rabbitmq.client.impl.PlainMechanism;
21+
2322
import java.util.Arrays;
2423
import java.util.HashSet;
25-
import java.util.List;
2624
import java.util.Set;
2725

2826
/**
29-
* Default implementation of SaslConfig that uses the standard Java
30-
* algorithm for selecting a sasl client.
31-
* @see com.rabbitmq.client.ConnectionFactory
27+
* Default SASL configuration. Uses one of our built-in mechanisms.
3228
*/
3329
public class DefaultSaslConfig implements SaslConfig {
34-
public static final String[] DEFAULT_PREFERRED_MECHANISMS = new String[]{"PLAIN"};
30+
private final String mechanism;
3531

36-
private final ConnectionFactory factory;
37-
private final List<String> mechanisms;
38-
private final CallbackHandler callbackHandler;
32+
public static final DefaultSaslConfig PLAIN = new DefaultSaslConfig("PLAIN");
33+
public static final DefaultSaslConfig EXTERNAL = new DefaultSaslConfig("EXTERNAL");
3934

4035
/**
41-
* Create a DefaultSaslConfig which only wants to use PLAIN.
36+
* Create a DefaultSaslConfig with an explicit mechanism to use.
4237
*
43-
* @param factory - the ConnectionFactory to use to obtain username, password and host
38+
* @param mechanism - a SASL mechanism to use
4439
*/
45-
public DefaultSaslConfig(ConnectionFactory factory) {
46-
this(factory, DEFAULT_PREFERRED_MECHANISMS);
40+
private DefaultSaslConfig(String mechanism) {
41+
this.mechanism = mechanism;
4742
}
4843

49-
/**
50-
* Create a DefaultSaslConfig with a list of mechanisms to use.
51-
*
52-
* @param factory - the ConnectionFactory to use to obtain username, password and host
53-
* @param mechanisms - a list of SASL mechanisms to use (in descending order of preference)
54-
*/
55-
public DefaultSaslConfig(ConnectionFactory factory, String[] mechanisms) {
56-
this.factory = factory;
57-
callbackHandler = new UsernamePasswordCallbackHandler(factory);
58-
this.mechanisms = Arrays.asList(mechanisms);
59-
}
60-
61-
public SaslClient getSaslClient(String[] serverMechanisms) throws SaslException {
44+
public SaslMechanism getSaslMechanism(String[] serverMechanisms) {
6245
Set<String> server = new HashSet<String>(Arrays.asList(serverMechanisms));
6346

64-
for (String mechanism: mechanisms) {
65-
if (server.contains(mechanism)) {
66-
SaslClient saslClient = Sasl.createSaslClient(new String[]{mechanism},
67-
null, "AMQP", factory.getHost(), null, callbackHandler);
68-
if (saslClient != null) return saslClient;
47+
if (server.contains(mechanism)) {
48+
if (mechanism.equals("PLAIN")) {
49+
return new PlainMechanism();
50+
}
51+
else if (mechanism.equals("EXTERNAL")) {
52+
return new ExternalMechanism();
6953
}
7054
}
7155
return null;

src/com/rabbitmq/client/FileProperties.java

Lines changed: 0 additions & 133 deletions
This file was deleted.

0 commit comments

Comments
 (0)