qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject qpid-jms-amqp-0-x git commit: QPID-7779 : [Qpid JMS Client 0-x] [0-8..0-91] sasl_mechs and other SASL connection options not supported
Date Mon, 15 May 2017 08:35:24 GMT
Repository: qpid-jms-amqp-0-x
Updated Branches:
  refs/heads/master 65f1b91b4 -> 5df5d1382


QPID-7779 : [Qpid JMS Client 0-x] [0-8..0-91] sasl_mechs and other SASL connection options
not supported


Project: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/commit/5df5d138
Tree: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/tree/5df5d138
Diff: http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/diff/5df5d138

Branch: refs/heads/master
Commit: 5df5d1382bd89f8d7b53fa5c7a62a22c172d7a45
Parents: 65f1b91
Author: rgodfrey <rgodfrey@apache.org>
Authored: Mon May 15 10:34:16 2017 +0200
Committer: rgodfrey <rgodfrey@apache.org>
Committed: Mon May 15 10:34:16 2017 +0200

----------------------------------------------------------------------
 .../handler/ConnectionStartMethodHandler.java   |  2 +-
 .../client/protocol/AMQProtocolSession.java     | 36 ++++++++++++--------
 2 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/5df5d138/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
b/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
index 13ac6c6..bb027e9 100644
--- a/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
+++ b/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
@@ -100,7 +100,7 @@ public class ConnectionStartMethodHandler implements StateAwareMethodListener<Co
             {
                 // Used to hold the SASL mechanism to authenticate with.
                 String mechanism;
-                final ConnectionSettings connectionSettings = session.getAMQConnection().getConnectionSettings();
+                final ConnectionSettings connectionSettings = session.getConnectionSettings();
 
                 if (body.getMechanisms()== null)
                 {

http://git-wip-us.apache.org/repos/asf/qpid-jms-amqp-0-x/blob/5df5d138/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
----------------------------------------------------------------------
diff --git a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
index 895ceb1..1739a78 100644
--- a/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ b/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
@@ -101,6 +101,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
 
     private static final int FAST_CHANNEL_ACCESS_MASK = 0xFFFFFFF0;
     private volatile ByteBufferSender _sender;
+    private ConnectionSettings _connectionSettings;
 
     public AMQProtocolSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
     {
@@ -117,23 +118,29 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
 
     public void init(ConnectionSettings settings)
     {
+        _connectionSettings = settings;
         // start the process of setting up the connection. This is the first place that
         // data is written to the server.
-        initialiseTuneParameters(settings);
+        initialiseTuneParameters();
 
         _protocolHandler.writeFrame(new ProtocolInitiation(_connection.getProtocolVersion()));
     }
 
+    public ConnectionSettings getConnectionSettings()
+    {
+        return _connectionSettings;
+    }
+
     public ConnectionTuneParameters getConnectionTuneParameters()
     {
         return _connectionTuneParameters;
     }
 
-    private void initialiseTuneParameters(ConnectionSettings settings)
+    private void initialiseTuneParameters()
     {
         _connectionTuneParameters = new ConnectionTuneParameters();
-        _connectionTuneParameters.setHeartbeat(settings.getHeartbeatInterval08());
-        _connectionTuneParameters.setHeartbeatTimeoutFactor(settings.getHeartbeatTimeoutFactor());
+        _connectionTuneParameters.setHeartbeat(getConnectionSettings().getHeartbeatInterval08());
+        _connectionTuneParameters.setHeartbeatTimeoutFactor(getConnectionSettings().getHeartbeatTimeoutFactor());
     }
 
     public void tuneConnection(ConnectionTuneParameters params)
@@ -148,11 +155,11 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         initHeartbeats(params.getHeartbeat(), params.getHeartbeatTimeoutFactor());
     }
 
-    void initHeartbeats(int delay, float timeoutFactor)
+    private void initHeartbeats(int delay, float timeoutFactor)
     {
         if (delay > 0)
         {
-            NetworkConnection network = getProtocolHandler().getNetworkConnection();
+            NetworkConnection network = _protocolHandler.getNetworkConnection();
             network.setMaxWriteIdleMillis(1000L*delay);
             int readerIdle = (int)(delay * timeoutFactor);
             network.setMaxReadIdleMillis(1000L * readerIdle);
@@ -219,6 +226,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         }
     }
 
+    @Override
     public void contentHeaderReceived(int channelId, ContentHeaderBody contentHeader) throws
QpidException
     {
         final UnprocessedMessage_0_8 msg = (UnprocessedMessage_0_8) ((channelId & FAST_CHANNEL_ACCESS_MASK)
== 0 ? _channelId2UnprocessedMsgArray[channelId]
@@ -241,6 +249,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         }
     }
 
+    @Override
     public void contentBodyReceived(final int channelId, ContentBody contentBody) throws
QpidException
     {
         UnprocessedMessage_0_8 msg;
@@ -280,6 +289,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         }
     }
 
+    @Override
     public void heartbeatBodyReceived(int channelId, HeartbeatBody body) throws QpidException
     {
         _protocolHandler.heartbeatBodyReceived();
@@ -310,6 +320,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         return _connection.getSession(channelId);
     }
 
+    @Override
     public void writeFrame(AMQDataBlock frame)
     {
         _protocolHandler.writeFrame(frame);
@@ -414,11 +425,13 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         _methodDispatcher = ClientMethodDispatcherImpl.newMethodDispatcher(pv, this);
   }
 
+    @Override
     public ProtocolVersion getProtocolVersion()
     {
         return _protocolVersion;
     }
 
+    @Override
     public MethodRegistry getMethodRegistry()
     {
         return _methodRegistry;
@@ -441,6 +454,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         session.setFlowControl(active);
     }
 
+    @Override
     public void methodFrameReceived(final int channel, final AMQMethodBody amqMethodBody)
throws QpidException
     {
         _protocolHandler.methodBodyReceived(channel, amqMethodBody);
@@ -451,6 +465,7 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         _protocolHandler.propagateExceptionToAllWaiters(error);
     }
 
+    @Override
     public void setSender(ByteBufferSender sender)
     {
         _sender = sender;
@@ -463,15 +478,6 @@ public class AMQProtocolSession implements AMQVersionAwareProtocolSession
         return "AMQProtocolSession[" + _connection + ']';
     }
 
-    /**
-     * The handler from which this session was created and which is used to handle protocol
events. We send failover
-     * events to the handler.
-     */
-    protected AMQProtocolHandler getProtocolHandler()
-    {
-        return _protocolHandler;
-    }
-
     protected AMQConnection getConnection()
     {
         return _connection;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message