qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgodf...@apache.org
Subject svn commit: r1170621 - in /qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type: codec/AMQPDescribedTypeRegistry.java messaging/codec/NoLocalFilterConstructor.java messaging/codec/NoLocalFilterWriter.java
Date Wed, 14 Sep 2011 13:46:44 GMT
Author: rgodfrey
Date: Wed Sep 14 13:46:44 2011
New Revision: 1170621

URL: http://svn.apache.org/viewvc?rev=1170621&view=rev
Log:
NO-JIRA : add preliminary filter support

Added:
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java
      - copied, changed from r1170618, qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/JMSSelectorFilterConstructor.java
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java
      - copied, changed from r1170124, qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedWriter.java
Modified:
    qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java

Modified: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java?rev=1170621&r1=1170620&r2=1170621&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
(original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
Wed Sep 14 13:46:44 2011
@@ -186,6 +186,7 @@ public class AMQPDescribedTypeRegistry i
         ExactSubjectFilterWriter.register(registry);
         MatchingSubjectFilterWriter.register(registry);
         JMSSelectorFilterWriter.register(registry);
+        NoLocalFilterWriter.register(registry);
     }
 
     private static void registerTransactionsWriters(final AMQPDescribedTypeRegistry registry)
@@ -253,6 +254,7 @@ public class AMQPDescribedTypeRegistry i
         ExactSubjectFilterConstructor.register(registry);
         MatchingSubjectFilterConstructor.register(registry);
         JMSSelectorFilterConstructor.register(registry);
+        NoLocalFilterConstructor.register(registry);
     }
 
     private static void registerTransactionsConstructors(final AMQPDescribedTypeRegistry
registry)

Copied: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java
(from r1170618, qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/JMSSelectorFilterConstructor.java)
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java?p2=qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java&p1=qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/JMSSelectorFilterConstructor.java&r1=1170618&r2=1170621&rev=1170621&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/JMSSelectorFilterConstructor.java
(original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java
Wed Sep 14 13:46:44 2011
@@ -27,15 +27,16 @@ import org.apache.qpid.amqp_1_0.codec.De
 import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructorRegistry;
 import org.apache.qpid.amqp_1_0.type.Symbol;
 import org.apache.qpid.amqp_1_0.type.messaging.JMSSelectorFilter;
+import org.apache.qpid.amqp_1_0.type.messaging.NoLocalFilter;
 
-public class JMSSelectorFilterConstructor extends DescribedTypeConstructor<JMSSelectorFilter>
+public class NoLocalFilterConstructor extends DescribedTypeConstructor<NoLocalFilter>
 {
     private static final Object[] DESCRIPTORS =
     {
-            Symbol.valueOf("amqp:jms-selector-filter:string"),
+            Symbol.valueOf("amqp:no-local-filter:list"),
     };
 
-    private static final JMSSelectorFilterConstructor INSTANCE = new JMSSelectorFilterConstructor();
+    private static final NoLocalFilterConstructor INSTANCE = new NoLocalFilterConstructor();
 
     public static void register(DescribedTypeConstructorRegistry registry)
     {
@@ -46,18 +47,9 @@ public class JMSSelectorFilterConstructo
     }
 
 
-    public JMSSelectorFilter construct(Object underlying)
+    public NoLocalFilter construct(Object underlying)
     {
-
-        if(underlying instanceof String)
-        {
-            return new JMSSelectorFilter((String)underlying);
-        }
-        else
-        {
-            // TODO - error
-            return null;
-        }
+        return new NoLocalFilter();
     }
 
 

Copied: qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java
(from r1170124, qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedWriter.java)
URL: http://svn.apache.org/viewvc/qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java?p2=qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java&p1=qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedWriter.java&r1=1170124&r2=1170621&rev=1170621&view=diff
==============================================================================
--- qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedWriter.java
(original)
+++ qpid/branches/rg-amqp-1-0-sandbox/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java
Wed Sep 14 13:46:44 2011
@@ -24,25 +24,23 @@
 package org.apache.qpid.amqp_1_0.type.messaging.codec;
 
 import org.apache.qpid.amqp_1_0.codec.AbstractDescribedTypeWriter;
-import org.apache.qpid.amqp_1_0.codec.AbstractListWriter;
 import org.apache.qpid.amqp_1_0.codec.ListWriter;
 import org.apache.qpid.amqp_1_0.codec.ValueWriter;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.messaging.NoLocalFilter;
 
-import org.apache.qpid.amqp_1_0.type.UnsignedLong;
-import org.apache.qpid.amqp_1_0.type.messaging.Accepted;
-
-public class AcceptedWriter extends AbstractDescribedTypeWriter<Accepted>
+public class NoLocalFilterWriter extends AbstractDescribedTypeWriter<NoLocalFilter>
 {
-    private Accepted _value;
+    private NoLocalFilter _value;
     private int _count = -1;
 
-    public AcceptedWriter(final Registry registry)
+    public NoLocalFilterWriter(final Registry registry)
     {
         super(registry);
     }
 
     @Override
-    protected void onSetValue(final Accepted value)
+    protected void onSetValue(final NoLocalFilter value)
     {
         _value = value;
         _count = calculateCount();
@@ -65,87 +63,27 @@ public class AcceptedWriter extends Abst
 
     protected Object getDescriptor()
     {
-        return UnsignedLong.valueOf(0x0000000000000024L);
+        return Symbol.valueOf("amqp:no-local-filter:list");
     }
 
     @Override
     protected ValueWriter createDescribedWriter()
     {
-        if(_count != 0)
-        {
-            final Writer writer = new Writer(getRegistry());
-            writer.setValue(_value);
-            return writer;
-        }
-        else
-        {
-            return new ListWriter.EmptyListValueWriter();
-        }
-
-    }
-
-    private class Writer extends AbstractListWriter<Accepted>
-    {
-        private int _field;
-
-        public Writer(final Registry registry)
-        {
-            super(registry);
-        }
-
-        @Override
-        protected void onSetValue(final Accepted value)
-        {
-            reset();
-        }
-
-        @Override
-        protected int getCount()
-        {
-            return _count;
-        }
-
-        @Override
-        protected boolean hasNext()
-        {
-            return _field < _count;
-        }
-
-        @Override
-        protected Object next()
-        {
-            switch(_field++)
-            {
-
-                default:
-                    return null;
-            }
-        }
-
-        @Override
-        protected void clear()
-        {
-        }
-
-        @Override
-        protected void reset()
-        {
-            _field = 0;
-        }
+        return new ListWriter.EmptyListValueWriter();
     }
 
-    private static Factory<Accepted> FACTORY = new Factory<Accepted>()
+    private static Factory<NoLocalFilter> FACTORY = new Factory<NoLocalFilter>()
     {
 
-        public ValueWriter<Accepted> newInstance(Registry registry)
+        public ValueWriter<NoLocalFilter> newInstance(Registry registry)
         {
-            return new AcceptedWriter(registry);
+            return new NoLocalFilterWriter(registry);
         }
     };
 
-    public static void register(ValueWriter.Registry registry)
+    public static void register(Registry registry)
     {
-        registry.register(Accepted.class, FACTORY);
+        registry.register(NoLocalFilter.class, FACTORY);
     }
 
 }



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


Mime
View raw message