qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1586783 [2/2] - in /qpid/trunk/qpid/java: broker-core/src/main/java/org/apache/qpid/server/binding/ broker-core/src/main/java/org/apache/qpid/server/exchange/ broker-core/src/main/java/org/apache/qpid/server/model/ broker-core/src/main/jav...
Date Fri, 11 Apr 2014 21:45:29 GMT
Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/TransportProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/TransportProvider.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/TransportProvider.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/transport/TransportProvider.java Fri Apr 11 21:45:28 2014
@@ -20,19 +20,19 @@
  */
 package org.apache.qpid.server.transport;
 
-import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
+import java.util.Set;
 
 import javax.net.ssl.SSLContext;
-import java.net.InetSocketAddress;
-import java.util.Set;
+
+import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
+import org.apache.qpid.server.model.Transport;
 
 public interface TransportProvider
 {
     AcceptingTransport createTransport(Set<Transport> transports,
                                        SSLContext sslContext,
                                        Port port,
-                                       Set<AmqpProtocolVersion> supported,
-                                       AmqpProtocolVersion defaultSupportedProtocolReply);
+                                       Set<Protocol> supported,
+                                       Protocol defaultSupportedProtocolReply);
 }

Modified: qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/main/java/org/apache/qpid/server/virtualhost/AbstractVirtualHost.java Fri Apr 11 21:45:28 2014
@@ -167,7 +167,6 @@ public abstract class AbstractVirtualHos
     public AbstractVirtualHost(final Map<String, Object> attributes, Broker<?> broker)
     {
         super(parentsMap(broker),
-              Collections.<String,Object>emptyMap(),
               enhanceWithId(attributes), broker.getTaskExecutor());
         _broker = broker;
         _dtxRegistry = new DtxRegistry();
@@ -250,7 +249,7 @@ public abstract class AbstractVirtualHos
         {
             for(Port port :_broker.getPorts())
             {
-                if (Protocol.hasAmqpProtocol(port.getProtocols()))
+                if (Protocol.hasAmqpProtocol(port.getAvailableProtocols()))
                 {
                     _aliases.add(new VirtualHostAliasAdapter(this, port));
                 }
@@ -1480,13 +1479,6 @@ public abstract class AbstractVirtualHos
         return super.getAttribute(name);
     }
 
-
-    Object getAttribute(String name, String brokerAttributeName)
-    {
-        return getAttribute(name, _broker, brokerAttributeName);
-    }
-
-
     @Override
     public Collection<String> getAttributeNames()
     {

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/model/adapter/PortFactoryTest.java Fri Apr 11 21:45:28 2014
@@ -89,10 +89,12 @@ public class PortFactoryTest extends Qpi
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.PORT, 1);
+        attributes.put(Port.NAME, getName());
+
         attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
-        Port port = _portFactory.createPort(_portId, _broker, attributes);
+        Port<?> port = _portFactory.createPort(_portId, _broker, attributes);
 
-        Collection<Protocol> protocols = port.getProtocols();
+        Collection<Protocol> protocols = port.getAvailableProtocols();
 
         EnumSet<Protocol> expected = EnumSet.of(Protocol.AMQP_0_8, Protocol.AMQP_0_9, Protocol.AMQP_0_9_1, Protocol.AMQP_0_10,
                 Protocol.AMQP_1_0);
@@ -106,10 +108,11 @@ public class PortFactoryTest extends Qpi
 
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.PORT, 1);
+        attributes.put(Port.NAME, getName());
         attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
-        Port port = _portFactory.createPort(_portId, _broker, attributes);
+        Port<?> port = _portFactory.createPort(_portId, _broker, attributes);
 
-        Collection<Protocol> protocols = port.getProtocols();
+        Collection<Protocol> protocols = port.getAvailableProtocols();
 
         EnumSet<Protocol> expected = EnumSet.of(Protocol.AMQP_0_8, Protocol.AMQP_0_9, Protocol.AMQP_0_9_1);
         assertEquals("Unexpected protocols", new HashSet<Protocol>(expected), new HashSet<Protocol>(protocols));
@@ -124,10 +127,11 @@ public class PortFactoryTest extends Qpi
 
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.PORT, 1);
+        attributes.put(Port.NAME, getName());
         attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
-        Port port = _portFactory.createPort(_portId, _broker, attributes);
+        Port<?> port = _portFactory.createPort(_portId, _broker, attributes);
 
-        Collection<Protocol> protocols = port.getProtocols();
+        Collection<Protocol> protocols = port.getAvailableProtocols();
 
         EnumSet<Protocol> expected = EnumSet.of(Protocol.AMQP_0_8, Protocol.AMQP_0_9, Protocol.AMQP_0_9_1, Protocol.AMQP_0_10);
         assertEquals("Unexpected protocols", new HashSet<Protocol>(expected), new HashSet<Protocol>(protocols));
@@ -137,6 +141,7 @@ public class PortFactoryTest extends Qpi
     {
         Map<String, Object> attributes = new HashMap<String, Object>();
         attributes.put(Port.PORT, 1);
+        attributes.put(Port.NAME, getName());
         attributes.put(Port.AUTHENTICATION_PROVIDER, _authProviderName);
         Port port = _portFactory.createPort(_portId, _broker, attributes);
 
@@ -145,7 +150,7 @@ public class PortFactoryTest extends Qpi
         assertEquals("Unexpected port", 1, port.getPort());
         assertEquals("Unexpected transports", Collections.singleton(PortFactory.DEFAULT_TRANSPORT), port.getTransports());
         assertEquals("Unexpected protocols", EnumSet.of(Protocol.AMQP_0_8, Protocol.AMQP_0_9, Protocol.AMQP_0_9_1, Protocol.AMQP_0_10,
-                                                        Protocol.AMQP_1_0), port.getProtocols());
+                                                        Protocol.AMQP_1_0), port.getAvailableProtocols());
         assertEquals("Unexpected send buffer size", PortFactory.DEFAULT_AMQP_SEND_BUFFER_SIZE,
                 port.getAttribute(Port.SEND_BUFFER_SIZE));
         assertEquals("Unexpected receive buffer size", PortFactory.DEFAULT_AMQP_RECEIVE_BUFFER_SIZE,
@@ -291,7 +296,7 @@ public class PortFactoryTest extends Qpi
         {
             assertEquals(_tcpTransports, port.getTransports());
         }
-        assertEquals(amqp010ProtocolSet, port.getProtocols());
+        assertEquals(amqp010ProtocolSet, port.getAvailableProtocols());
         assertEquals("Unexpected send buffer size", 2, port.getAttribute(Port.SEND_BUFFER_SIZE));
         assertEquals("Unexpected receive buffer size", 1, port.getAttribute(Port.RECEIVE_BUFFER_SIZE));
         assertEquals("Unexpected need client auth", needClientAuth, port.getAttribute(Port.NEED_CLIENT_AUTH));
@@ -318,13 +323,12 @@ public class PortFactoryTest extends Qpi
         assertEquals(_portId, port.getId());
         assertEquals(_portNumber, port.getPort());
         assertEquals(_tcpTransports, port.getTransports());
-        assertEquals(nonAmqpProtocolSet, port.getProtocols());
+        assertEquals(nonAmqpProtocolSet, port.getAvailableProtocols());
         assertNull("Unexpected send buffer size", port.getAttribute(Port.SEND_BUFFER_SIZE));
         assertNull("Unexpected receive buffer size", port.getAttribute(Port.RECEIVE_BUFFER_SIZE));
         assertNull("Unexpected need client auth", port.getAttribute(Port.NEED_CLIENT_AUTH));
         assertNull("Unexpected want client auth", port.getAttribute(Port.WANT_CLIENT_AUTH));
         assertNull("Unexpected tcp no delay", port.getAttribute(Port.TCP_NO_DELAY));
-        assertNull("Unexpected binding", port.getAttribute(Port.BINDING_ADDRESS));
     }
 
     public void testCreateNonAmqpPortWithPartiallySetAttributes()
@@ -344,13 +348,12 @@ public class PortFactoryTest extends Qpi
         assertEquals(_portId, port.getId());
         assertEquals(_portNumber, port.getPort());
         assertEquals(Collections.singleton(PortFactory.DEFAULT_TRANSPORT), port.getTransports());
-        assertEquals(nonAmqpProtocolSet, port.getProtocols());
+        assertEquals(nonAmqpProtocolSet, port.getAvailableProtocols());
         assertNull("Unexpected send buffer size", port.getAttribute(Port.SEND_BUFFER_SIZE));
         assertNull("Unexpected receive buffer size", port.getAttribute(Port.RECEIVE_BUFFER_SIZE));
         assertNull("Unexpected need client auth", port.getAttribute(Port.NEED_CLIENT_AUTH));
         assertNull("Unexpected want client auth", port.getAttribute(Port.WANT_CLIENT_AUTH));
         assertNull("Unexpected tcp no delay", port.getAttribute(Port.TCP_NO_DELAY));
-        assertNull("Unexpected binding", port.getAttribute(Port.BINDING_ADDRESS));
     }
 
     public void testCreateMixedAmqpAndNonAmqpThrowsException()
@@ -378,7 +381,7 @@ public class PortFactoryTest extends Qpi
         attributes.put(Port.PROTOCOLS, Collections.singleton(Protocol.RMI));
 
         Port rmiPort = mock(Port.class);
-        when(rmiPort.getProtocols()).thenReturn(Collections.singleton(Protocol.RMI));
+        when(rmiPort.getAvailableProtocols()).thenReturn(Collections.singleton(Protocol.RMI));
         when(_broker.getPorts()).thenReturn(Collections.singletonList(rmiPort));
 
         try

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/AnonymousAuthenticationManagerTest.java Fri Apr 11 21:45:28 2014
@@ -31,7 +31,6 @@ import org.apache.qpid.server.model.Brok
 import org.apache.qpid.server.security.auth.AuthenticationResult;
 import org.apache.qpid.test.utils.QpidTestCase;
 
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -47,7 +46,7 @@ public class AnonymousAuthenticationMana
         Map<String,Object> attrs = new HashMap<String, Object>();
         attrs.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrs.put(AuthenticationProvider.NAME, getTestName());
-        _manager = new AnonymousAuthenticationManager(mock(Broker.class), Collections.<String,Object>emptyMap(), attrs);
+        _manager = new AnonymousAuthenticationManager(mock(Broker.class), attrs);
 
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ExternalAuthenticationManagerTest.java Fri Apr 11 21:45:28 2014
@@ -21,7 +21,6 @@ package org.apache.qpid.server.security.
 import static org.apache.qpid.server.security.auth.AuthenticatedPrincipalTestHelper.assertOnlyContainsWrapped;
 import static org.mockito.Mockito.mock;
 
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -49,13 +48,13 @@ public class ExternalAuthenticationManag
         attrs.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrs.put(AuthenticationProvider.NAME, getTestName());
         attrs.put("useFullDN",false);
-        _manager = new ExternalAuthenticationManager(mock(Broker.class), Collections.<String,Object>emptyMap(), attrs);
+        _manager = new ExternalAuthenticationManager(mock(Broker.class), attrs);
         _manager.open();
         HashMap<String, Object> attrsFullDN = new HashMap<String, Object>();
         attrsFullDN.put(AuthenticationProvider.ID, UUID.randomUUID());
         attrsFullDN.put(AuthenticationProvider.NAME, getTestName()+"FullDN");
         attrsFullDN.put("useFullDN",true);
-        _managerUsingFullDN = new ExternalAuthenticationManager(mock(Broker.class), Collections.<String,Object>emptyMap(), attrsFullDN);
+        _managerUsingFullDN = new ExternalAuthenticationManager(mock(Broker.class), attrsFullDN);
         _managerUsingFullDN.open();
     }
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManagerTest.java Fri Apr 11 21:45:28 2014
@@ -28,7 +28,6 @@ import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.security.Principal;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -106,7 +105,7 @@ public class PrincipalDatabaseAuthentica
         attrs.put(ConfiguredObject.ID, UUID.randomUUID());
         attrs.put(ConfiguredObject.NAME, getTestName());
         attrs.put("path", _passwordFileLocation);
-        _manager = new PrincipalDatabaseAuthenticationManager(mock(Broker.class), Collections.<String,Object>emptyMap(), attrs, recovering)
+        _manager = new PrincipalDatabaseAuthenticationManager(mock(Broker.class), attrs)
         {
             @Override
             protected PrincipalDatabase createDatabase()

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/ScramSHA1AuthenticationManagerTest.java Fri Apr 11 21:45:28 2014
@@ -58,7 +58,7 @@ public class ScramSHA1AuthenticationMana
         final Map<String, Object> attributesMap = new HashMap<String, Object>();
         attributesMap.put(AuthenticationProvider.NAME, getTestName());
         attributesMap.put(AuthenticationProvider.ID, UUID.randomUUID());
-        _authManager = new ScramSHA1AuthenticationManager(_broker, Collections.<String,Object>emptyMap(),attributesMap);
+        _authManager = new ScramSHA1AuthenticationManager(_broker, attributesMap);
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/security/auth/manager/SimpleAuthenticationManagerTest.java Fri Apr 11 21:45:28 2014
@@ -21,7 +21,6 @@
 package org.apache.qpid.server.security.auth.manager;
 
 import java.security.Principal;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Set;
@@ -52,7 +51,8 @@ public class SimpleAuthenticationManager
         Map<String,Object> authManagerAttrs = new HashMap<String, Object>();
         authManagerAttrs.put(AuthenticationProvider.NAME,"MANAGEMENT_MODE_AUTHENTICATION");
         authManagerAttrs.put(AuthenticationProvider.ID, UUID.randomUUID());
-        final SimpleAuthenticationManager authManager = new SimpleAuthenticationManager(mock(Broker.class), Collections.<String,Object>emptyMap(),authManagerAttrs);
+        final SimpleAuthenticationManager authManager = new SimpleAuthenticationManager(mock(Broker.class),
+                                                                                        authManagerAttrs);
         authManager.addUser(TEST_USER, TEST_PASSWORD);
         _authenticationManager = authManager;
 

Modified: qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java (original)
+++ qpid/trunk/qpid/java/broker-core/src/test/java/org/apache/qpid/server/store/TestMessageMetaDataType.java Fri Apr 11 21:45:28 2014
@@ -26,12 +26,12 @@ import org.apache.qpid.server.message.AM
 import org.apache.qpid.server.message.MessageReference;
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageMetaDataType;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 
 public class TestMessageMetaDataType implements MessageMetaDataType<TestMessageMetaData>
 {
     //largest metadata type value the BDBMessageStore can store (it uses a byte)
     private static final byte TYPE = 7;
+    public static final String V0_8 = "v0_8";
 
     @Override
     public int ordinal()
@@ -64,7 +64,7 @@ public class TestMessageMetaDataType imp
     @Override
     public String getType()
     {
-        return AmqpProtocolVersion.v0_8.toString();
+        return V0_8;
     }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProvider.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProvider.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/access-control/src/main/java/org/apache/qpid/server/security/access/plugins/ACLFileAccessControlProvider.java Fri Apr 11 21:45:28 2014
@@ -54,7 +54,7 @@ public class ACLFileAccessControlProvide
                                         Map<String, Object> attributes)
     {
         super(Collections.<Class<? extends ConfiguredObject>,ConfiguredObject<?>>singletonMap(Broker.class, broker),
-              Collections.<String,Object>emptyMap(), attributes, broker.getTaskExecutor());
+              attributes, broker.getTaskExecutor());
 
 
         _broker = broker;

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaDataType_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaDataType_0_10.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaDataType_0_10.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/MessageMetaDataType_0_10.java Fri Apr 11 21:45:28 2014
@@ -21,15 +21,16 @@
 package org.apache.qpid.server.protocol.v0_10;
 
 import java.nio.ByteBuffer;
+
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageMetaDataType;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.store.StoredMessage;
 
 public class MessageMetaDataType_0_10 implements MessageMetaDataType<MessageMetaData_0_10>
 {
 
     public static final int TYPE = 1;
+    public static final String V0_10 = "v0_10";
 
     @Override
     public int ordinal()
@@ -62,6 +63,6 @@ public class MessageMetaDataType_0_10 im
     @Override
     public String getType()
     {
-        return AmqpProtocolVersion.v0_10.toString();
+        return V0_10;
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEngineCreator_0_10.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEngineCreator_0_10.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEngineCreator_0_10.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/ProtocolEngineCreator_0_10.java Fri Apr 11 21:45:28 2014
@@ -22,11 +22,12 @@ package org.apache.qpid.server.protocol.
 
 import java.net.InetSocketAddress;
 import java.net.SocketAddress;
+
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.transport.ConnectionDelegate;
 import org.apache.qpid.transport.network.NetworkConnection;
@@ -50,9 +51,9 @@ public class ProtocolEngineCreator_0_10 
     {
     }
 
-    public AmqpProtocolVersion getVersion()
+    public Protocol getVersion()
     {
-        return AmqpProtocolVersion.v0_10;
+        return Protocol.AMQP_0_10;
     }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/MessageMetaDataType_0_8.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/MessageMetaDataType_0_8.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/MessageMetaDataType_0_8.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/MessageMetaDataType_0_8.java Fri Apr 11 21:45:28 2014
@@ -21,15 +21,16 @@
 package org.apache.qpid.server.protocol.v0_8;
 
 import java.nio.ByteBuffer;
+
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageMetaDataType;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.store.StoredMessage;
 
 public class MessageMetaDataType_0_8 implements MessageMetaDataType<MessageMetaData>
 {
 
     public static final int TYPE = 0;
+    public static final String V0_8 = "v0_8";
 
     @Override
     public int ordinal()
@@ -62,6 +63,6 @@ public class MessageMetaDataType_0_8 imp
     @Override
     public String getType()
     {
-        return AmqpProtocolVersion.v0_8.toString();
+        return V0_8;
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_8.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_8.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_8.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_8.java Fri Apr 11 21:45:28 2014
@@ -23,8 +23,8 @@ package org.apache.qpid.server.protocol.
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.transport.network.NetworkConnection;
 
@@ -46,9 +46,9 @@ public class ProtocolEngineCreator_0_8 i
     {
     }
 
-    public AmqpProtocolVersion getVersion()
+    public Protocol getVersion()
     {
-        return AmqpProtocolVersion.v0_8;
+        return Protocol.AMQP_0_8;
     }
 
     public byte[] getHeaderIdentifier()

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9.java Fri Apr 11 21:45:28 2014
@@ -23,8 +23,8 @@ package org.apache.qpid.server.protocol.
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.transport.network.NetworkConnection;
 
@@ -45,9 +45,9 @@ public class ProtocolEngineCreator_0_9 i
     {
     }
 
-    public AmqpProtocolVersion getVersion()
+    public Protocol getVersion()
     {
-        return AmqpProtocolVersion.v0_9;
+        return Protocol.AMQP_0_9;
     }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9_1.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9_1.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9_1.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-0-8-protocol/src/main/java/org/apache/qpid/server/protocol/v0_8/ProtocolEngineCreator_0_9_1.java Fri Apr 11 21:45:28 2014
@@ -23,8 +23,8 @@ package org.apache.qpid.server.protocol.
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.transport.network.NetworkConnection;
 
@@ -46,9 +46,9 @@ public class ProtocolEngineCreator_0_9_1
     {
     }
 
-    public AmqpProtocolVersion getVersion()
+    public Protocol getVersion()
     {
-        return AmqpProtocolVersion.v0_9_1;
+        return Protocol.AMQP_0_9_1;
     }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaDataType_1_0.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaDataType_1_0.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaDataType_1_0.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaDataType_1_0.java Fri Apr 11 21:45:28 2014
@@ -21,15 +21,16 @@
 package org.apache.qpid.server.protocol.v1_0;
 
 import java.nio.ByteBuffer;
+
 import org.apache.qpid.server.message.ServerMessage;
 import org.apache.qpid.server.plugin.MessageMetaDataType;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.store.StoredMessage;
 
 public class MessageMetaDataType_1_0 implements MessageMetaDataType<MessageMetaData_1_0>
 {
 
     public static final int TYPE = 2;
+    public static final String V1_0_0 = "v1_0_0";
 
     @Override
     public int ordinal()
@@ -62,6 +63,6 @@ public class MessageMetaDataType_1_0 imp
     @Override
     public String getType()
     {
-        return AmqpProtocolVersion.v1_0_0.toString();
+        return V1_0_0;
     }
 }

Modified: qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngineCreator_1_0_0_SASL.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngineCreator_1_0_0_SASL.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngineCreator_1_0_0_SASL.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ProtocolEngineCreator_1_0_0_SASL.java Fri Apr 11 21:45:28 2014
@@ -23,8 +23,8 @@ package org.apache.qpid.server.protocol.
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.plugin.ProtocolEngineCreator;
 import org.apache.qpid.transport.network.NetworkConnection;
 
@@ -45,9 +45,9 @@ public class ProtocolEngineCreator_1_0_0
     {
     }
 
-    public AmqpProtocolVersion getVersion()
+    public Protocol getVersion()
     {
-        return AmqpProtocolVersion.v1_0_0;
+        return Protocol.AMQP_1_0;
     }
 
 

Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/org/apache/qpid/server/management/plugin/HttpManagement.java Fri Apr 11 21:45:28 2014
@@ -124,7 +124,7 @@ public class HttpManagement extends Abst
 
     public HttpManagement(UUID id, Broker broker, Map<String, Object> attributes)
     {
-        super(id, Collections.<String,Object>emptyMap(), attributes, broker);
+        super(id, attributes, broker);
     }
 
     @Override
@@ -419,7 +419,7 @@ public class HttpManagement extends Abst
         Collection<Port> httpPorts = new HashSet<Port>();
         for (Port port : ports)
         {
-            if (port.getProtocols().contains(Protocol.HTTP))
+            if (port.getAvailableProtocols().contains(Protocol.HTTP))
             {
                 httpPorts.add(port);
             }

Modified: qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-jmx/src/main/java/org/apache/qpid/server/jmx/JMXManagement.java Fri Apr 11 21:45:28 2014
@@ -24,7 +24,6 @@ package org.apache.qpid.server.jmx;
 import java.io.IOException;
 import java.lang.reflect.Type;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -89,7 +88,7 @@ public class JMXManagement extends Abstr
 
     public JMXManagement(UUID id, Broker broker, Map<String, Object> attributes)
     {
-        super(id, Collections.<String,Object>emptyMap(), attributes, broker);
+        super(id, attributes, broker);
     }
 
     @Override
@@ -192,12 +191,12 @@ public class JMXManagement extends Abstr
 
     private boolean isConnectorPort(Port port)
     {
-        return port.getProtocols().contains(Protocol.JMX_RMI);
+        return port.getAvailableProtocols().contains(Protocol.JMX_RMI);
     }
 
     private boolean isRegistryPort(Port port)
     {
-        return port.getProtocols().contains(Protocol.RMI);
+        return port.getAvailableProtocols().contains(Protocol.RMI);
     }
 
     private void stop()

Modified: qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketProvider.java Fri Apr 11 21:45:28 2014
@@ -20,38 +20,37 @@
  */
 package org.apache.qpid.server.transport.websocket;
 
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.security.Principal;
+import java.security.cert.X509Certificate;
+import java.util.Collections;
+import java.util.Set;
+
+import javax.net.ssl.SSLContext;
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
+import org.eclipse.jetty.websocket.WebSocket;
+import org.eclipse.jetty.websocket.WebSocketHandler;
+
 import org.apache.qpid.protocol.ProtocolEngine;
 import org.apache.qpid.protocol.ProtocolEngineFactory;
 import org.apache.qpid.server.model.Broker;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.protocol.MultiVersionProtocolEngineFactory;
 import org.apache.qpid.server.transport.AcceptingTransport;
 import org.apache.qpid.server.util.ServerScopedRuntimeException;
-import org.apache.qpid.transport.Binary;
 import org.apache.qpid.transport.Sender;
 import org.apache.qpid.transport.network.NetworkConnection;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
-import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
-import org.eclipse.jetty.util.ssl.SslContextFactory;
-import org.eclipse.jetty.websocket.WebSocket;
-import org.eclipse.jetty.websocket.WebSocketHandler;
-
-import javax.net.ssl.SSLContext;
-import javax.servlet.http.HttpServletRequest;
-import java.io.IOException;
-import java.net.InetSocketAddress;
-import java.net.SocketAddress;
-import java.nio.ByteBuffer;
-import java.security.Principal;
-import java.security.cert.X509Certificate;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Set;
 
 class WebSocketProvider implements AcceptingTransport
 {
@@ -59,16 +58,16 @@ class WebSocketProvider implements Accep
     private final Transport _transport;
     private final SSLContext _sslContext;
     private final Port<?> _port;
-    private final Set<AmqpProtocolVersion> _supported;
-    private final AmqpProtocolVersion _defaultSupportedProtocolReply;
+    private final Set<Protocol> _supported;
+    private final Protocol _defaultSupportedProtocolReply;
     private final ProtocolEngineFactory _factory;
     private Server _server;
 
     WebSocketProvider(final Transport transport,
                       final SSLContext sslContext,
                       final Port<?> port,
-                      final Set<AmqpProtocolVersion> supported,
-                      final AmqpProtocolVersion defaultSupportedProtocolReply)
+                      final Set<Protocol> supported,
+                      final Protocol defaultSupportedProtocolReply)
     {
         _transport = transport;
         _sslContext = sslContext;

Modified: qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketTransportProvider.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketTransportProvider.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketTransportProvider.java (original)
+++ qpid/trunk/qpid/java/broker-plugins/websocket/src/main/java/org/apache/qpid/server/transport/websocket/WebSocketTransportProvider.java Fri Apr 11 21:45:28 2014
@@ -20,15 +20,16 @@
  */
 package org.apache.qpid.server.transport.websocket;
 
+import java.util.Set;
+
+import javax.net.ssl.SSLContext;
+
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Transport;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.transport.AcceptingTransport;
 import org.apache.qpid.server.transport.TransportProvider;
 
-import javax.net.ssl.SSLContext;
-import java.util.Set;
-
 class WebSocketTransportProvider implements TransportProvider
 {
     public WebSocketTransportProvider()
@@ -39,8 +40,8 @@ class WebSocketTransportProvider impleme
     public AcceptingTransport createTransport(final Set<Transport> transports,
                                               final SSLContext sslContext,
                                               final Port port,
-                                              final Set<AmqpProtocolVersion> supported,
-                                              final AmqpProtocolVersion defaultSupportedProtocolReply)
+                                              final Set<Protocol> supported,
+                                              final Protocol defaultSupportedProtocolReply)
     {
         return new WebSocketProvider(transports.iterator().next(),
                                      sslContext,

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/protocol/MultiVersionProtocolEngineFactoryTest.java Fri Apr 11 21:45:28 2014
@@ -27,10 +27,12 @@ import java.net.SocketAddress;
 import java.nio.ByteBuffer;
 import java.security.Principal;
 import java.util.EnumSet;
+import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.qpid.protocol.ServerProtocolEngine;
 import org.apache.qpid.server.model.Broker;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.util.BrokerTestHelper;
 import org.apache.qpid.server.virtualhost.VirtualHostImpl;
 import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
@@ -130,19 +132,19 @@ public class MultiVersionProtocolEngineF
             };
 
 
-    private byte[] getAmqpHeader(final AmqpProtocolVersion version)
+    private byte[] getAmqpHeader(final Protocol version)
     {
         switch(version)
         {
-            case v0_8:
+            case AMQP_0_8:
                 return AMQP_0_8_HEADER;
-            case v0_9:
+            case AMQP_0_9:
                 return AMQP_0_9_HEADER;
-            case v0_9_1:
+            case AMQP_0_9_1:
                 return AMQP_0_9_1_HEADER;
-            case v0_10:
+            case AMQP_0_10:
                 return AMQP_0_10_HEADER;
-            case v1_0_0:
+            case AMQP_1_0:
                 return AMQP_1_0_0_HEADER;
             default:
                 fail("unknown AMQP version, appropriate header must be added for new protocol version");
@@ -156,10 +158,10 @@ public class MultiVersionProtocolEngineF
      */
     public void testDifferentProtocolVersionsShareCommonIDNumberingSequence()
     {
-        Set<AmqpProtocolVersion> versions = EnumSet.allOf(AmqpProtocolVersion.class);
+        Set<Protocol> protocols = getAllAMQPProtocols();
 
         MultiVersionProtocolEngineFactory factory =
-            new MultiVersionProtocolEngineFactory(_broker, null, false, false, versions, null, null,
+            new MultiVersionProtocolEngineFactory(_broker, null, false, false, protocols, null, null,
                     org.apache.qpid.server.model.Transport.TCP);
 
         //create a dummy to retrieve the 'current' ID number
@@ -167,10 +169,10 @@ public class MultiVersionProtocolEngineF
 
         //create a protocol engine and send the AMQP header for all supported AMQP verisons,
         //ensuring the ID assigned increases as expected
-        for(AmqpProtocolVersion version : versions)
+        for(Protocol protocol : protocols)
         {
             long expectedID = previousId + 1;
-            byte[] header = getAmqpHeader(version);
+            byte[] header = getAmqpHeader(protocol);
             assertNotNull("protocol header should not be null", header);
 
             ServerProtocolEngine engine = factory.newProtocolEngine();
@@ -187,18 +189,33 @@ public class MultiVersionProtocolEngineF
         }
     }
 
+    protected Set<Protocol> getAllAMQPProtocols()
+    {
+        Set<Protocol> protocols = EnumSet.allOf(Protocol.class);
+        Iterator<Protocol> protoIter = protocols.iterator();
+        while(protoIter.hasNext())
+        {
+            Protocol protocol = protoIter.next();
+            if(protocol.getProtocolType() != Protocol.ProtocolType.AMQP)
+            {
+                protoIter.remove();
+            }
+        }
+        return protocols;
+    }
+
     /**
      * Test to verify that when requesting a ProtocolEngineFactory to produce engines having a default reply to unsupported
      * version initiations, there is enforcement that the default reply is itself a supported protocol version.
      */
     public void testUnsupportedDefaultReplyCausesIllegalArgumentException()
     {
-        Set<AmqpProtocolVersion> versions = EnumSet.allOf(AmqpProtocolVersion.class);
-        versions.remove(AmqpProtocolVersion.v0_9);
+        Set<Protocol> versions = getAllAMQPProtocols();
+        versions.remove(Protocol.AMQP_0_9);
 
         try
         {
-            new MultiVersionProtocolEngineFactory(_broker, null, false, false, versions, AmqpProtocolVersion.v0_9, null,
+            new MultiVersionProtocolEngineFactory(_broker, null, false, false, versions, Protocol.AMQP_0_9, null,
                     org.apache.qpid.server.model.Transport.TCP);
             fail("should not have been allowed to create the factory");
         }

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/Asserts.java Fri Apr 11 21:45:28 2014
@@ -40,7 +40,6 @@ import org.apache.qpid.server.model.Exch
 import org.apache.qpid.server.model.ExclusivityPolicy;
 import org.apache.qpid.server.model.LifetimePolicy;
 import org.apache.qpid.server.model.Port;
-import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.Queue;
 import org.apache.qpid.server.model.State;
 import org.apache.qpid.server.model.VirtualHost;
@@ -266,17 +265,8 @@ public class Asserts
 
         @SuppressWarnings("unchecked")
         Collection<String> protocols = (Collection<String>) port.get(Port.PROTOCOLS);
-        assertNotNull("Unexpected value of attribute " + Port.PROTOCOLS, protocols);
-        boolean isAMQPPort = false;
-        for (String protocolName : protocols)
-        {
-            if (Protocol.valueOf(protocolName).isAMQP())
-            {
-                isAMQPPort = true;
-                break;
-            }
-        }
-        if (isAMQPPort)
+
+        if ("AMQP".equals(port.get(ConfiguredObject.TYPE)))
         {
             assertAttributesPresent(port,
                                     AbstractConfiguredObject.getAttributeNames(Port.class),
@@ -289,7 +279,8 @@ public class Asserts
                                     ConfiguredObject.CONTEXT,
                                     Port.AUTHENTICATION_PROVIDER,
                                     Port.KEY_STORE,
-                                    Port.TRUST_STORES);
+                                    Port.TRUST_STORES,
+                                    Port.PROTOCOLS);
             assertNotNull("Unexpected value of attribute " + Port.BINDING_ADDRESS, port.get(Port.BINDING_ADDRESS));
         }
         else
@@ -311,7 +302,8 @@ public class Asserts
                                     Port.NEED_CLIENT_AUTH,
                                     Port.WANT_CLIENT_AUTH,
                                     Port.KEY_STORE,
-                                    Port.TRUST_STORES);
+                                    Port.TRUST_STORES,
+                                    Port.PROTOCOLS);
         }
 
         @SuppressWarnings("unchecked")

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/systest/rest/BrokerRestTest.java Fri Apr 11 21:45:28 2014
@@ -88,7 +88,7 @@ public class BrokerRestTest extends Qpid
 
         @SuppressWarnings("unchecked")
         Collection<String> port1Protocols = (Collection<String>) amqpPort.get(Port.PROTOCOLS);
-        assertFalse("AMQP protocol list cannot contain HTTP", port1Protocols.contains("HTTP"));
+        assertFalse("AMQP protocol list cannot contain HTTP", port1Protocols != null && port1Protocols.contains("HTTP"));
 
         @SuppressWarnings("unchecked")
         Collection<String> port2Protocols = (Collection<String>) httpPort.get(Port.PROTOCOLS);

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java?rev=1586783&r1=1586782&r2=1586783&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/utils/QpidBrokerTestCase.java Fri Apr 11 21:45:28 2014
@@ -63,8 +63,8 @@ import org.apache.qpid.server.Broker;
 import org.apache.qpid.server.BrokerOptions;
 import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.Port;
+import org.apache.qpid.server.model.Protocol;
 import org.apache.qpid.server.model.VirtualHost;
-import org.apache.qpid.server.protocol.AmqpProtocolVersion;
 import org.apache.qpid.server.store.MemoryMessageStore;
 import org.apache.qpid.server.store.MessageStore;
 import org.apache.qpid.server.virtualhost.StandardVirtualHost;
@@ -155,7 +155,7 @@ public class QpidBrokerTestCase extends 
     protected BrokerCommandHelper _brokerCommandHelper = new BrokerCommandHelper(BROKER_COMMAND_TEMPLATE);
 
     private Boolean _brokerCleanBetweenTests = Boolean.getBoolean(BROKER_CLEAN_BETWEEN_TESTS);
-    private final AmqpProtocolVersion _brokerVersion = AmqpProtocolVersion.valueOf(System.getProperty(BROKER_VERSION, ""));
+    private final Protocol _brokerVersion = Protocol.valueOf("AMQP_" + System.getProperty(BROKER_VERSION, " ").substring(1));
     protected String _output = System.getProperty(TEST_OUTPUT, System.getProperty("java.io.tmpdir"));
     protected Boolean _brokerPersistent = Boolean.getBoolean(BROKER_PERSITENT);
 
@@ -978,12 +978,12 @@ public class QpidBrokerTestCase extends 
      */
     public boolean isBroker08()
     {
-        return _brokerVersion.equals(AmqpProtocolVersion.v0_8);
+        return _brokerVersion.equals(Protocol.AMQP_0_8);
     }
 
     public boolean isBroker010()
     {
-        return _brokerVersion.equals(AmqpProtocolVersion.v0_10);
+        return _brokerVersion.equals(Protocol.AMQP_0_10);
     }
 
     protected boolean isJavaBroker()



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


Mime
View raw message