summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Godfrey <rgodfrey@apache.org>2011-09-14 13:46:44 +0000
committerRobert Godfrey <rgodfrey@apache.org>2011-09-14 13:46:44 +0000
commit55c58ea5ad9f0e35d4290862a15d844ed39a7a6d (patch)
tree0b55d1d6472fecb1d5669037e50214ed400dc24d
parent2a52b44531691857472c34daef841d63dfc6f641 (diff)
downloadqpid-python-55c58ea5ad9f0e35d4290862a15d844ed39a7a6d.tar.gz
NO-JIRA : add preliminary filter support
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rg-amqp-1-0-sandbox@1170621 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java2
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java56
-rw-r--r--qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java89
3 files changed, 147 insertions, 0 deletions
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
index 17a19cbbcf..5ffa96e094 100644
--- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/codec/AMQPDescribedTypeRegistry.java
@@ -186,6 +186,7 @@ public class AMQPDescribedTypeRegistry implements DescribedTypeConstructorRegist
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 implements DescribedTypeConstructorRegist
ExactSubjectFilterConstructor.register(registry);
MatchingSubjectFilterConstructor.register(registry);
JMSSelectorFilterConstructor.register(registry);
+ NoLocalFilterConstructor.register(registry);
}
private static void registerTransactionsConstructors(final AMQPDescribedTypeRegistry registry)
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java
new file mode 100644
index 0000000000..ca4359c1d0
--- /dev/null
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterConstructor.java
@@ -0,0 +1,56 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+package org.apache.qpid.amqp_1_0.type.messaging.codec;
+
+import org.apache.qpid.amqp_1_0.codec.DescribedTypeConstructor;
+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 NoLocalFilterConstructor extends DescribedTypeConstructor<NoLocalFilter>
+{
+ private static final Object[] DESCRIPTORS =
+ {
+ Symbol.valueOf("amqp:no-local-filter:list"),
+ };
+
+ private static final NoLocalFilterConstructor INSTANCE = new NoLocalFilterConstructor();
+
+ public static void register(DescribedTypeConstructorRegistry registry)
+ {
+ for(Object descriptor : DESCRIPTORS)
+ {
+ registry.register(descriptor, INSTANCE);
+ }
+ }
+
+
+ public NoLocalFilter construct(Object underlying)
+ {
+ return new NoLocalFilter();
+ }
+
+
+}
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java
new file mode 100644
index 0000000000..1e7dce7600
--- /dev/null
+++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/NoLocalFilterWriter.java
@@ -0,0 +1,89 @@
+
+/*
+*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*
+*/
+
+
+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.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;
+
+public class NoLocalFilterWriter extends AbstractDescribedTypeWriter<NoLocalFilter>
+{
+ private NoLocalFilter _value;
+ private int _count = -1;
+
+ public NoLocalFilterWriter(final Registry registry)
+ {
+ super(registry);
+ }
+
+ @Override
+ protected void onSetValue(final NoLocalFilter value)
+ {
+ _value = value;
+ _count = calculateCount();
+ }
+
+ private int calculateCount()
+ {
+
+
+ return 0;
+ }
+
+ @Override
+ protected void clear()
+ {
+ _value = null;
+ _count = -1;
+ }
+
+
+ protected Object getDescriptor()
+ {
+ return Symbol.valueOf("amqp:no-local-filter:list");
+ }
+
+ @Override
+ protected ValueWriter createDescribedWriter()
+ {
+ return new ListWriter.EmptyListValueWriter();
+ }
+
+ private static Factory<NoLocalFilter> FACTORY = new Factory<NoLocalFilter>()
+ {
+
+ public ValueWriter<NoLocalFilter> newInstance(Registry registry)
+ {
+ return new NoLocalFilterWriter(registry);
+ }
+ };
+
+ public static void register(Registry registry)
+ {
+ registry.register(NoLocalFilter.class, FACTORY);
+ }
+
+}