qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1228748 [2/2] - in /qpid/trunk/qpid/java: bdbstore/src/main/java/org/apache/qpid/server/store/berkeleydb/ broker/src/main/java/org/apache/qpid/qmf/ broker/src/main/java/org/apache/qpid/server/configuration/ broker/src/main/java/org/apache/...
Date Sat, 07 Jan 2012 22:47:18 GMT
Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
Sat Jan  7 22:47:17 2012
@@ -31,6 +31,8 @@ import org.apache.qpid.AMQStoreException
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.federation.Bridge;
+import org.apache.qpid.server.federation.BrokerLink;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.actors.CurrentActor;
 import org.apache.qpid.server.logging.messages.ConfigStoreMessages;
@@ -157,6 +159,26 @@ public class MemoryMessageStore implemen
         // Not required to do anything
     }
 
+    public void createBrokerLink(final BrokerLink link) throws AMQStoreException
+    {
+
+    }
+
+    public void deleteBrokerLink(final BrokerLink link) throws AMQStoreException
+    {
+
+    }
+
+    public void createBridge(final Bridge bridge) throws AMQStoreException
+    {
+
+    }
+
+    public void deleteBridge(final Bridge bridge) throws AMQStoreException
+    {
+
+    }
+
     public void configureTransactionLog(String name,
                                         TransactionLogRecoveryHandler recoveryHandler,
                                         Configuration storeConfiguration,

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/transport/ServerSession.java
Sat Jan  7 22:47:17 2012
@@ -724,11 +724,18 @@ public class ServerSession extends Sessi
 
     public String toLogString()
     {
-       return "[" +
+        long connectionId = getConnection() instanceof ServerConnection
+                            ? ((ServerConnection) getConnection()).getConnectionId()
+                            : -1;
+
+        String remoteAddress = _connectionConfig instanceof ProtocolEngine
+                                ? ((ProtocolEngine) _connectionConfig).getRemoteAddress().toString()
+                                : "";
+        return "[" +
                MessageFormat.format(CHANNEL_FORMAT,
-                                   ((ServerConnection) getConnection()).getConnectionId(),
+                                    connectionId,
                                    getClientID(),
-                                   ((ProtocolEngine) _connectionConfig).getRemoteAddress().toString(),
+                                   remoteAddress,
                                    getVirtualHost().getName(),
                                    getChannel())
             + "] ";

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
Sat Jan  7 22:47:17 2012
@@ -20,6 +20,7 @@
 */
 package org.apache.qpid.server.virtualhost;
 
+import java.util.Map;
 import java.util.UUID;
 
 import org.apache.qpid.common.Closeable;
@@ -91,6 +92,8 @@ public interface VirtualHost extends Dur
                                 boolean durable,
                                 String authMechanism, String username, String password);
 
+    public BrokerLink createBrokerConnection(UUID id, long createTime, Map<String,String>
arguments);
+
     ConfigStore getConfigStore();
 
     void removeBrokerConnection(BrokerLink brokerLink);

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostConfigRecoveryHandler.java
Sat Jan  7 22:47:17 2012
@@ -20,6 +20,7 @@
 */
 package org.apache.qpid.server.virtualhost;
 
+import org.apache.qpid.server.federation.BrokerLink;
 import org.apache.qpid.server.message.EnqueableMessage;
 import org.apache.qpid.server.store.ConfigurationRecoveryHandler;
 import org.apache.qpid.server.store.MessageStore;
@@ -54,11 +55,13 @@ import java.util.ArrayList;
 import java.util.Map;
 import java.util.HashMap;
 import java.util.TreeMap;
+import java.util.UUID;
 
 public class VirtualHostConfigRecoveryHandler implements ConfigurationRecoveryHandler,
                                                         ConfigurationRecoveryHandler.QueueRecoveryHandler,
                                                         ConfigurationRecoveryHandler.ExchangeRecoveryHandler,
                                                         ConfigurationRecoveryHandler.BindingRecoveryHandler,
+                                                        ConfigurationRecoveryHandler.BrokerLinkRecoveryHandler,
                                                         MessageStoreRecoveryHandler,
                                                         MessageStoreRecoveryHandler.StoredMessageRecoveryHandler,
                                                         TransactionLogRecoveryHandler,
@@ -180,7 +183,19 @@ public class VirtualHostConfigRecoveryHa
     public void completeMessageRecovery()
     {
         //TODO - log end
-        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public BridgeRecoveryHandler brokerLink(final UUID id,
+                                            final long createTime,
+                                            final Map<String, String> arguments)
+    {
+        BrokerLink blink = _virtualHost.createBrokerConnection(id, createTime, arguments);
+        return new BridgeRecoveryHandlerImpl(blink);
+        
+    }
+
+    public void completeBrokerLinkRecovery()
+    {
     }
 
     private static final class ProcessAction
@@ -261,9 +276,9 @@ public class VirtualHostConfigRecoveryHa
 
     }
 
-    public void completeBindingRecovery()
+    public BrokerLinkRecoveryHandler completeBindingRecovery()
     {
-        //return this;
+        return this;
     }
 
     public void complete()
@@ -386,4 +401,23 @@ public class VirtualHostConfigRecoveryHa
             return null;
         }
     }
+
+    private class BridgeRecoveryHandlerImpl implements BridgeRecoveryHandler
+    {
+        private final BrokerLink _blink;
+
+        public BridgeRecoveryHandlerImpl(final BrokerLink blink)
+        {
+            _blink = blink;
+        }
+
+        public void bridge(final UUID id, final long createTime, final Map<String, String>
arguments)
+        {
+            _blink.createBridge(id, createTime, arguments);
+        }
+
+        public void completeBridgeRecoveryForLink()
+        {
+        }
+    }
 }

Modified: qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
(original)
+++ qpid/trunk/qpid/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostImpl.java
Sat Jan  7 22:47:17 2012
@@ -54,6 +54,7 @@ import org.apache.qpid.server.exchange.D
 import org.apache.qpid.server.exchange.Exchange;
 import org.apache.qpid.server.exchange.ExchangeFactory;
 import org.apache.qpid.server.exchange.ExchangeRegistry;
+import org.apache.qpid.server.federation.Bridge;
 import org.apache.qpid.server.federation.BrokerLink;
 import org.apache.qpid.server.logging.LogSubject;
 import org.apache.qpid.server.logging.actors.CurrentActor;
@@ -730,6 +731,16 @@ public class VirtualHostImpl implements 
         _statisticsEnabled = enabled;
     }
 
+    public BrokerLink createBrokerConnection(UUID id, long createTime, Map<String,String>
arguments)
+    {
+        BrokerLink blink = new BrokerLink(this, id, createTime, arguments);
+        // TODO - cope with duplicate broker link creation requests
+        _links.putIfAbsent(blink,blink);
+        getConfigStore().addConfiguredObject(blink);
+        return blink;
+    }
+
+    
     public void createBrokerConnection(final String transport,
                                        final String host,
                                        final int port,
@@ -740,10 +751,11 @@ public class VirtualHostImpl implements 
                                        final String password)
     {
         BrokerLink blink = new BrokerLink(this, transport, host, port, vhost, durable, authMechanism,
username, password);
-        if(_links.putIfAbsent(blink,blink) != null)
-        {
-            getConfigStore().addConfiguredObject(blink);
-        }
+
+        // TODO - cope with duplicate broker link creation requests
+        _links.putIfAbsent(blink,blink);
+        getConfigStore().addConfiguredObject(blink);
+
     }
 
     public void removeBrokerConnection(final String transport,
@@ -782,7 +794,9 @@ public class VirtualHostImpl implements 
         public List<Exchange> exchange = new LinkedList<Exchange>();
         public List<CreateQueueTuple> queue = new LinkedList<CreateQueueTuple>();
         public List<CreateBindingTuple> bindings = new LinkedList<CreateBindingTuple>();
-
+        public List<BrokerLink> links = new LinkedList<BrokerLink>();
+        public List<Bridge> bridges = new LinkedList<Bridge>();
+        
         public void configure(VirtualHost virtualHost, String base, VirtualHostConfiguration
config) throws Exception
         {
         }
@@ -877,6 +891,30 @@ public class VirtualHostImpl implements 
         public void updateQueue(AMQQueue queue) throws AMQStoreException
         {
         }
+
+        public void createBrokerLink(final BrokerLink link) throws AMQStoreException
+        {
+            if(link.isDurable())
+            {
+                links.add(link);
+            }
+        }
+
+        public void deleteBrokerLink(final BrokerLink link) throws AMQStoreException
+        {
+        }
+
+        public void createBridge(final Bridge bridge) throws AMQStoreException
+        {
+            if(bridge.isDurable())
+            {
+                bridges.add(bridge);
+            }
+        }
+
+        public void deleteBridge(final Bridge bridge) throws AMQStoreException
+        {
+        }
     }
 
     @Override

Modified: qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
(original)
+++ qpid/trunk/qpid/java/broker/src/test/java/org/apache/qpid/server/virtualhost/MockVirtualHost.java
Sat Jan  7 22:47:17 2012
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.server.virtualhost;
 
+import java.util.Map;
 import java.util.UUID;
 
 import org.apache.qpid.server.binding.BindingFactory;
@@ -63,6 +64,11 @@ public class MockVirtualHost implements 
 
     }
 
+    public BrokerLink createBrokerConnection(final UUID id, final long createTime, final
Map<String, String> arguments)
+    {
+        return null;
+    }
+
     public IApplicationRegistry getApplicationRegistry()
     {
         return null;

Modified: qpid/trunk/qpid/java/broker/src/xsl/qmf.xsl
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker/src/xsl/qmf.xsl?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker/src/xsl/qmf.xsl (original)
+++ qpid/trunk/qpid/java/broker/src/xsl/qmf.xsl Sat Jan  7 22:47:17 2012
@@ -288,6 +288,17 @@ public class <xsl:value-of select="$Clas
             <xsl:apply-templates select="node()[name()='property' or name()='statistic']"
mode="optionalPropertyPresence"/>
             <xsl:apply-templates select="node()[name()='property' or name()='statistic']"
mode="encodeProperty"/>
         }
+
+        public String toString()
+        {
+            return "QMF<xsl:value-of select="@name"/>GetQueryResponseCommand{id=" +
getObject().getId()   
+<xsl:for-each select="node()[name()='property' or name()='statistic']">
+<xsl:if test="@type!='hilo32' and @type!='mmaTime' ">
+                + ", <xsl:value-of select="@name"/>=" + getObject().get<xsl:call-template
name="initCap"><xsl:with-param name="input"><xsl:value-of select="@name"/></xsl:with-param></xsl:call-template>()
+</xsl:if>
+</xsl:for-each>
+                   + "}";
+        }
     }
     
     
@@ -530,6 +541,11 @@ public class <xsl:value-of select="$Clas
             {
                 return obj.<xsl:value-of select="@name"/>( new <xsl:value-of select="$ClassName"/>ResponseCommandFactory(cmd)<xsl:if
test="node()[name()='arg' and ( @dir='I' or @dir='IO' ) ]">, </xsl:if><xsl:apply-templates
select="node()[name()='arg' and ( @dir='I' or @dir='IO' ) ]" mode="methodArgList"><xsl:with-param
name="prefix">_</xsl:with-param></xsl:apply-templates> );
             }
+
+            public String toString()
+            {
+                return "<xsl:value-of select="$ClassName"/>["<xsl:for-each select="node()[name()='arg'
and ( @dir='I' or @dir='IO' ) ]"><xsl:if test="preceding-sibling::node()[name()='arg'
and ( @dir='I' or @dir='IO' ) ]">+ ", "</xsl:if>+ "<xsl:value-of select="@name"/>
= " + _<xsl:value-of select="@name"/> </xsl:for-each>+"]";
+            }
         }
         
         public final class <xsl:value-of select="$ClassName"/>ResponseCommandFactory

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java?rev=1228748&r1=1228747&r2=1228748&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
(original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/store/SlowMessageStore.java
Sat Jan  7 22:47:17 2012
@@ -26,6 +26,8 @@ import org.apache.qpid.AMQStoreException
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.server.exchange.Exchange;
+import org.apache.qpid.server.federation.Bridge;
+import org.apache.qpid.server.federation.BrokerLink;
 import org.apache.qpid.server.message.EnqueableMessage;
 import org.apache.qpid.server.queue.AMQQueue;
 import org.apache.qpid.server.message.ServerMessage;
@@ -320,4 +322,31 @@ public class SlowMessageStore implements
     }
 
 
+    public void createBrokerLink(final BrokerLink link) throws AMQStoreException
+    {
+        doPreDelay("createBrokerLink");
+        _durableConfigurationStore.createBrokerLink(link);
+        doPostDelay("createBrokerLink");
+    }
+
+    public void deleteBrokerLink(final BrokerLink link) throws AMQStoreException
+    {
+        doPreDelay("deleteBrokerLink");
+        _durableConfigurationStore.deleteBrokerLink(link);
+        doPostDelay("deleteBrokerLink");
+    }
+
+    public void createBridge(final Bridge bridge) throws AMQStoreException
+    {
+        doPreDelay("createBridge");
+        _durableConfigurationStore.createBridge(bridge);
+        doPostDelay("createBridge");
+    }
+
+    public void deleteBridge(final Bridge bridge) throws AMQStoreException
+    {
+        doPreDelay("deleteBridge");
+        _durableConfigurationStore.deleteBridge(bridge);
+        doPostDelay("deleteBridge");
+    }
 }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message