summaryrefslogtreecommitdiff
path: root/java/client
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2012-02-05 20:55:38 +0000
committerRobert Gemmell <robbie@apache.org>2012-02-05 20:55:38 +0000
commit7b189df7fbc75216eaacc7d372bf3052a5710f5c (patch)
tree69476c7066801b57c6d1875daac600579c189df4 /java/client
parent315a7622924f4303d120ac33ccef23ef6cdf0041 (diff)
downloadqpid-python-7b189df7fbc75216eaacc7d372bf3052a5710f5c.tar.gz
QPID-3814: ensure the 0-10 client sends its version number during ConnectionStart(Ok) process, align properties better across protocol versions, general tidy up of the property handling
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1240813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client')
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java3
-rw-r--r--java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java42
2 files changed, 16 insertions, 29 deletions
diff --git a/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java b/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
index a18a3fcbd4..56ee56d178 100644
--- a/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
+++ b/java/client/src/main/java/org/apache/qpid/client/AMQConnectionDelegate_0_10.java
@@ -34,6 +34,7 @@ import org.apache.qpid.framing.ProtocolVersion;
import org.apache.qpid.jms.BrokerDetails;
import org.apache.qpid.jms.ChannelLimitReachedException;
import org.apache.qpid.jms.Session;
+import org.apache.qpid.properties.ConnectionStartProperties;
import org.apache.qpid.protocol.AMQConstant;
import org.apache.qpid.transport.Connection;
import org.apache.qpid.transport.ConnectionClose;
@@ -428,7 +429,7 @@ public class AMQConnectionDelegate_0_10 implements AMQConnectionDelegate, Connec
Map<String, Object> clientProps = new HashMap<String, Object>();
try
{
- clientProps.put("clientName", _conn.getClientID());
+ clientProps.put(ConnectionStartProperties.CLIENT_ID_0_10, _conn.getClientID());
conSettings.setClientProperties(clientProps);
}
catch (JMSException e)
diff --git a/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java b/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
index 8fc51f7799..66c4821f60 100644
--- a/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
+++ b/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
@@ -29,14 +29,15 @@ import org.apache.qpid.client.security.AMQCallbackHandler;
import org.apache.qpid.client.security.CallbackHandlerRegistry;
import org.apache.qpid.client.state.AMQState;
import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.common.ClientProperties;
import org.apache.qpid.common.QpidProperties;
+import org.apache.qpid.configuration.ClientProperties;
import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.framing.ConnectionStartBody;
import org.apache.qpid.framing.ConnectionStartOkBody;
import org.apache.qpid.framing.FieldTable;
import org.apache.qpid.framing.FieldTableFactory;
import org.apache.qpid.framing.ProtocolVersion;
+import org.apache.qpid.properties.ConnectionStartProperties;
import javax.security.sasl.Sasl;
import javax.security.sasl.SaslClient;
@@ -148,14 +149,18 @@ public class ConnectionStartMethodHandler implements StateAwareMethodListener<Co
session.getStateManager().changeState(AMQState.CONNECTION_NOT_TUNED);
FieldTable clientProperties = FieldTableFactory.newFieldTable();
- clientProperties.setString(new AMQShortString(ClientProperties.instance.toString()),
- session.getClientID());
- clientProperties.setString(new AMQShortString(ClientProperties.product.toString()),
- QpidProperties.getProductName());
- clientProperties.setString(new AMQShortString(ClientProperties.version.toString()),
- QpidProperties.getReleaseVersion());
- clientProperties.setString(new AMQShortString(ClientProperties.platform.toString()), getFullSystemInfo());
-
+ clientProperties.setString(ConnectionStartProperties.CLIENT_ID_0_8,
+ session.getClientID());
+ clientProperties.setString(ConnectionStartProperties.PRODUCT,
+ QpidProperties.getProductName());
+ clientProperties.setString(ConnectionStartProperties.VERSION_0_8,
+ QpidProperties.getReleaseVersion());
+ clientProperties.setString(ConnectionStartProperties.PLATFORM,
+ ConnectionStartProperties.getPlatformInfo());
+ clientProperties.setString(ConnectionStartProperties.PROCESS,
+ System.getProperty(ClientProperties.PROCESS_NAME, "Qpid Java Client"));
+ clientProperties.setInteger(ConnectionStartProperties.PID,
+ ConnectionStartProperties.getPID());
ConnectionStartOkBody connectionStartOkBody = session.getMethodRegistry().createConnectionStartOkBody(clientProperties,new AMQShortString(mechanism),saslResponse,new AMQShortString(locales));
// AMQP version change: Hardwire the version to 0-8 (major=8, minor=0)
@@ -178,25 +183,6 @@ public class ConnectionStartMethodHandler implements StateAwareMethodListener<Co
}
}
- private String getFullSystemInfo()
- {
- StringBuilder fullSystemInfo = new StringBuilder(System.getProperty("java.runtime.name"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("java.runtime.version"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("java.vendor"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("os.arch"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("os.name"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("os.version"));
- fullSystemInfo.append(", ");
- fullSystemInfo.append(System.getProperty("sun.os.patch.level"));
-
- return fullSystemInfo.toString();
- }
-
private String chooseMechanism(byte[] availableMechanisms) throws UnsupportedEncodingException
{
final String mechanisms = new String(availableMechanisms, "utf8");