diff options
author | Robert Godfrey <rgodfrey@apache.org> | 2011-08-16 11:33:54 +0000 |
---|---|---|
committer | Robert Godfrey <rgodfrey@apache.org> | 2011-08-16 11:33:54 +0000 |
commit | f832d0306f947d230aa16108a1b0f588268c8cd3 (patch) | |
tree | b316ce531bd058c50cb4e127aa686c032261dbb4 | |
parent | 84773a0a92836e4fc1983866a06db91e3e850e54 (diff) | |
download | qpid-python-f832d0306f947d230aa16108a1b0f588268c8cd3.tar.gz |
NO-JIRA : Add consuming from exchanges, filters for 0-x style bindings
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/rg-amqp-1-0-sandbox@1158212 13f79535-47bb-0310-9956-ffa450edef68
72 files changed, 674 insertions, 1108 deletions
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receive.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receive.java index 4c804a0121..2600d4a74f 100644 --- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receive.java +++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receive.java @@ -21,9 +21,15 @@ package org.apache.qpid.amqp_1_0.client; +import org.apache.qpid.amqp_1_0.type.Symbol; import org.apache.qpid.amqp_1_0.type.UnsignedInteger; import org.apache.qpid.amqp_1_0.type.UnsignedLong; import org.apache.commons.cli.*; +import org.apache.qpid.amqp_1_0.type.messaging.ExactSubjectFilter; +import org.apache.qpid.amqp_1_0.type.messaging.Filter; +import org.apache.qpid.amqp_1_0.type.messaging.MatchingSubjectFilter; + +import java.util.Collections; public class Receive extends Util { @@ -102,6 +108,12 @@ public class Receive extends Util return true; } + @Override + protected boolean hasFilterOption() + { + return true; + } + protected void run() { @@ -116,9 +128,28 @@ public class Receive extends Util Session session = conn.createSession(); + Filter filter = null; + if(getFilter() != null) + { + String[] filterParts = getFilter().split("=",2); + if("exact-subject".equals(filterParts[0])) + { + filter = new ExactSubjectFilter(filterParts[1]); + } + else if("matching-subject".equals(filterParts[0])) + { + filter = new MatchingSubjectFilter(filterParts[1]); + } + else + { + System.err.println("Unknown filter type: " + filterParts[0]); + } + } - - Receiver r = session.createReceiver(queue, getMode(), getLinkName(), isDurableLink()); + Receiver r = + filter == null + ? session.createReceiver(queue, getMode(), getLinkName(), isDurableLink()) + : session.createReceiver(queue, getMode(), getLinkName(), isDurableLink(), Collections.singletonMap(Symbol.valueOf("filter"), filter), null); Transaction txn = null; int credit = 0; diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java index 8049327c87..f60e066c20 100644 --- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java +++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Receiver.java @@ -49,70 +49,6 @@ public class Receiver implements DeliveryStateHandler private Queue<Transfer> _prefetchQueue = new ConcurrentLinkedQueue<Transfer>();
private Map<Binary, SettledAction> _unsettledMap = new HashMap<Binary, SettledAction>();
-
-
- public Receiver(final Session session, final String linkName, final String targetAddr, final String sourceAddr)
- {
- this(session, linkName, targetAddr, sourceAddr, null);
- }
- public Receiver(final Session session, final String linkName, final String targetAddr, final String sourceAddr, DistributionMode mode)
- {
- this(session, linkName, targetAddr, sourceAddr, mode, AcknowledgeMode.ALO);
- }
-
-
- public Receiver(final Session session,
- final String linkName,
- final String targetAddr,
- final String sourceAddr,
- final DistributionMode distMode,
- final AcknowledgeMode ackMode)
- {
- this(session, linkName, createTarget(targetAddr), createSource(sourceAddr, distMode), ackMode);
-
- }
-
- public Receiver(final Session session,
- final String linkName,
- final String targetAddr,
- final String sourceAddr,
- final DistributionMode distMode,
- final AcknowledgeMode ackMode,
- boolean isDurable)
- {
- this(session, linkName, createTarget(targetAddr), createSource(sourceAddr, distMode), ackMode, isDurable);
- }
-
-
- public Receiver(final Session session,
- final String linkName,
- final String targetAddr,
- final String sourceAddr,
- final DistributionMode distMode,
- final AcknowledgeMode ackMode,
- boolean isDurable,
- Map<Binary, Outcome> unsettled)
- {
- this(session, linkName, createTarget(targetAddr), createSource(sourceAddr, distMode), ackMode, isDurable,
- unsettled);
- }
-
-
- private static Source createSource(final String sourceAddr, final DistributionMode distMode)
- {
- Source source = new Source();
- source.setAddress(sourceAddr);
- source.setDistributionMode(distMode);
- return source;
- }
-
- private static Target createTarget(final String targetAddr)
- {
- Target target = new Target();
- target.setAddress(targetAddr);
- return target;
- }
-
public Receiver(final Session session,
final String linkName,
final Target target,
@@ -121,6 +57,7 @@ public class Receiver implements DeliveryStateHandler {
this(session, linkName, target, source, ackMode, false);
}
+
public Receiver(final Session session,
final String linkName,
final Target target,
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java index 74847cbb30..78611f670d 100644 --- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java +++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Session.java @@ -29,6 +29,8 @@ import org.apache.qpid.amqp_1_0.transport.SessionEndpoint; import org.apache.qpid.amqp_1_0.type.Binary;
import org.apache.qpid.amqp_1_0.type.DistributionMode;
import org.apache.qpid.amqp_1_0.type.Outcome;
+import org.apache.qpid.amqp_1_0.type.Symbol;
+import org.apache.qpid.amqp_1_0.type.messaging.Filter;
import org.apache.qpid.amqp_1_0.type.messaging.Source;
import org.apache.qpid.amqp_1_0.type.messaging.StdDistMode;
import org.apache.qpid.amqp_1_0.type.messaging.Target;
@@ -123,6 +125,13 @@ public class Session return createReceiver(queue, null, mode, linkName, isDurable);
}
+ public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName, boolean isDurable,
+ Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
+ {
+ return createReceiver(queue, null, mode, linkName, isDurable, filters, unsettled);
+ }
+
+
public Receiver createReceiver(final String queue, final AcknowledgeMode mode, String linkName,
boolean isDurable, Map<Binary, Outcome> unsettled)
{
@@ -163,13 +172,30 @@ public class Session final AcknowledgeMode ackMode, String linkName, boolean isDurable,
Map<Binary, Outcome> unsettled)
{
+ return createReceiver(sourceAddr,mode,ackMode, linkName, isDurable, null, unsettled);
+ }
+
+ private synchronized Receiver createReceiver(final String sourceAddr, DistributionMode mode,
+ final AcknowledgeMode ackMode, String linkName, boolean isDurable,
+ Map<Symbol, Filter> filters, Map<Binary, Outcome> unsettled)
+ {
+
+ final Target target = new Target();
+ final Source source = new Source();
+ source.setAddress(sourceAddr);
+ source.setDistributionMode(mode);
+ source.setFilter(filters);
+
+ if(linkName == null)
+ {
+ linkName = sourceAddr + "-> (" + UUID.randomUUID().toString() + ")";
+ }
final Receiver receiver =
- new Receiver(this, linkName == null
- ? sourceAddr + "-> (" + UUID.randomUUID().toString() + ")"
- : linkName,
- null, sourceAddr, mode, ackMode, isDurable, unsettled);
+ new Receiver(this, linkName,
+ target, source, ackMode, isDurable, unsettled);
_receivers.add(receiver);
+
return receiver;
}
diff --git a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java index aec5796867..f71eef05bd 100644 --- a/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java +++ b/qpid/java/amqp-1-0-client/src/main/java/org/apache/qpid/amqp_1_0/client/Util.java @@ -51,6 +51,7 @@ public abstract class Util private boolean _useMultipleConnections; private int _windowSize = 100; private String _subject; + private String _filter; protected Util(String[] args) { @@ -120,6 +121,13 @@ public abstract class Util .hasArg(false) .create('Z')); + if(hasFilterOption()) + options.addOption(OptionBuilder.withLongOpt("filter") + .withDescription("filter, e.g. exact-subject=hello; matching-subject=%.a.#") + .hasArg(true) + .withArgName("<TYPE>=<VALUE>") + .create('F')); + if(hasTxnOption()) { @@ -224,6 +232,11 @@ public abstract class Util _password = cmdLine.getOptionValue('w'); } + if(cmdLine.hasOption('F')) + { + _filter = cmdLine.getOptionValue('F'); + } + _port = Integer.parseInt(portStr); _containerName = cmdLine.getOptionValue('C'); @@ -327,6 +340,11 @@ public abstract class Util } + protected boolean hasFilterOption() + { + return false; + } + protected boolean hasSubjectOption() { return false; @@ -486,4 +504,9 @@ public abstract class Util { _windowSize = windowSize; } + + public String getFilter() + { + return _filter; + } } diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/messaging/Predicate.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/messaging/Predicate.java deleted file mode 100644 index c678a4894a..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/messaging/Predicate.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.messaging; - - -import org.apache.qpid.amqp_1_0.type.WrapperType; - -public class Predicate implements org.apache.qpid.amqp_1_0.type.Predicate, WrapperType -{ - public Object getValue() - { - return null; - } -} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java index dd98d0238f..85bcf2febf 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/transport/ConnectionEndpoint.java @@ -63,7 +63,7 @@ public class ConnectionEndpoint implements DescribedTypeConstructorRegistry.Sour private Principal _user;
private static final short DEFAULT_CHANNEL_MAX = 255;
- private static final int DEFAULT_MAX_FRAME = Integer.getInteger("apache.qpid.amqp_1_0.max_frame_size",1<<15);
+ private static final int DEFAULT_MAX_FRAME = Integer.getInteger("amqp.max_frame_size",1<<15);
private ConnectionState _state = ConnectionState.UNOPENED;
diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/Predicate.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/Predicate.java deleted file mode 100644 index a27945c77f..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/Predicate.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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; - -public interface Predicate -{ -} 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 087c73890a..9e8189bec0 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 @@ -181,6 +181,10 @@ public class AMQPDescribedTypeRegistry implements DescribedTypeConstructorRegist DeleteOnNoLinksWriter.register(registry); DeleteOnNoMessagesWriter.register(registry); DeleteOnNoLinksOrMessagesWriter.register(registry); + + + ExactSubjectFilterWriter.register(registry); + MatchingSubjectFilterWriter.register(registry); } private static void registerTransactionsWriters(final AMQPDescribedTypeRegistry registry) @@ -244,6 +248,9 @@ public class AMQPDescribedTypeRegistry implements DescribedTypeConstructorRegist DeleteOnNoLinksConstructor.register(registry); DeleteOnNoMessagesConstructor.register(registry); DeleteOnNoLinksOrMessagesConstructor.register(registry); + + ExactSubjectFilterConstructor.register(registry); + MatchingSubjectFilterConstructor.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/DeliveryState.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/DeliveryState.java deleted file mode 100644 index 8d62bbb052..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/DeliveryState.java +++ /dev/null @@ -1,154 +0,0 @@ - -/* -* -* 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; - - - -import java.util.Map; - - -import org.apache.qpid.amqp_1_0.type.*; - -public class DeliveryState - implements org.apache.qpid.amqp_1_0.type.DeliveryState - { - - - private Map _options; - - private UnsignedInteger _sectionNumber; - - private UnsignedLong _sectionOffset; - - private Outcome _outcome; - - private Binary _txnId; - - public Map getOptions() - { - return _options; - } - - public void setOptions(Map options) - { - _options = options; - } - - public UnsignedInteger getSectionNumber() - { - return _sectionNumber; - } - - public void setSectionNumber(UnsignedInteger sectionNumber) - { - _sectionNumber = sectionNumber; - } - - public UnsignedLong getSectionOffset() - { - return _sectionOffset; - } - - public void setSectionOffset(UnsignedLong sectionOffset) - { - _sectionOffset = sectionOffset; - } - - public Outcome getOutcome() - { - return _outcome; - } - - public void setOutcome(Outcome outcome) - { - _outcome = outcome; - } - - public Binary getTxnId() - { - return _txnId; - } - - public void setTxnId(Binary txnId) - { - _txnId = txnId; - } - - @Override - public String toString() - { - StringBuilder builder = new StringBuilder("DeliveryState{"); - final int origLength = builder.length(); - - if(_options != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("options=").append(_options); - } - - if(_sectionNumber != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("sectionNumber=").append(_sectionNumber); - } - - if(_sectionOffset != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("sectionOffset=").append(_sectionOffset); - } - - if(_outcome != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("outcome=").append(_outcome); - } - - if(_txnId != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("txnId=").append(_txnId); - } - - builder.append('}'); - return builder.toString(); - } - - - } diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/ExactSubjectFilter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/ExactSubjectFilter.java new file mode 100644 index 0000000000..2209069609 --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/ExactSubjectFilter.java @@ -0,0 +1,54 @@ + +/* +* +* 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; + + +import org.apache.qpid.amqp_1_0.messaging.SectionEncoder; +import org.apache.qpid.amqp_1_0.type.Binary; +import org.apache.qpid.amqp_1_0.type.Section; + +public class ExactSubjectFilter implements Filter +{ + + + + private final String _value; + + public ExactSubjectFilter(String value) + { + _value = value; + } + + public String getValue() + { + return _value; + } + + + @Override + public String toString() + { + return "ExactSubjectFilter{" + _value + '}'; + } +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Filter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Filter.java index 6f66e55e24..46f391bf4d 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Filter.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/Filter.java @@ -23,65 +23,6 @@ package org.apache.qpid.amqp_1_0.type.messaging; - - -import org.apache.qpid.amqp_1_0.type.*; - -public class Filter - { - - - private Symbol _type; - - private Predicate _predicate; - - public Symbol getType() - { - return _type; - } - - public void setType(Symbol type) - { - _type = type; - } - - public Predicate getPredicate() - { - return _predicate; - } - - public void setPredicate(Predicate predicate) - { - _predicate = predicate; - } - - @Override - public String toString() - { - StringBuilder builder = new StringBuilder("Filter{"); - final int origLength = builder.length(); - - if(_type != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("type=").append(_type); - } - - if(_predicate != null) - { - if(builder.length() != origLength) - { - builder.append(','); - } - builder.append("predicate=").append(_predicate); - } - - builder.append('}'); - return builder.toString(); - } - - - } +public interface Filter +{ +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/MatchingSubjectFilter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/MatchingSubjectFilter.java new file mode 100644 index 0000000000..b717f02dba --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/MatchingSubjectFilter.java @@ -0,0 +1,53 @@ + +/* +* +* 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; + + +import org.apache.qpid.amqp_1_0.messaging.SectionEncoder; +import org.apache.qpid.amqp_1_0.type.Binary; +import org.apache.qpid.amqp_1_0.type.Section; + +public class MatchingSubjectFilter implements Filter +{ + + + + private final String _value; + + public MatchingSubjectFilter(String value) + { + _value = value; + } + + public String getValue() + { + return _value; + } + + @Override + public String toString() + { + return "MatchingSubjectFilter{" + _value + '}'; + } + } diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java index 38b7394248..8000853a4d 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AcceptedConstructor.java @@ -36,7 +36,7 @@ public class AcceptedConstructor extends DescribedTypeConstructor<Accepted> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:accepted:list"),UnsignedLong.valueOf(0x0000000000000024L), + Symbol.valueOf("amqp:accepted:list"),UnsignedLong.valueOf(0x0000000000000024L), }; private static final AcceptedConstructor INSTANCE = new AcceptedConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpSequenceConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpSequenceConstructor.java index 161a3014f3..7304a50b18 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpSequenceConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpSequenceConstructor.java @@ -36,7 +36,7 @@ public class AmqpSequenceConstructor extends DescribedTypeConstructor<AmqpSequen { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:apache.qpid.amqp_1_0-sequence:list"),UnsignedLong.valueOf(0x0000000000000076L), + Symbol.valueOf("amqp:amqp-sequence:list"),UnsignedLong.valueOf(0x0000000000000076L), }; private static final AmqpSequenceConstructor INSTANCE = new AmqpSequenceConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpValueConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpValueConstructor.java index 3ca8d26e34..2000880361 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpValueConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/AmqpValueConstructor.java @@ -33,7 +33,7 @@ public class AmqpValueConstructor extends DescribedTypeConstructor<AmqpValue> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:apache.qpid.amqp_1_0-value:*"),UnsignedLong.valueOf(0x0000000000000077L), + Symbol.valueOf("amqp:amqp-value:*"),UnsignedLong.valueOf(0x0000000000000077L), }; private static final AmqpValueConstructor INSTANCE = new AmqpValueConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ApplicationPropertiesConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ApplicationPropertiesConstructor.java index 4300344460..f2bf26b7b4 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ApplicationPropertiesConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ApplicationPropertiesConstructor.java @@ -36,7 +36,7 @@ public class ApplicationPropertiesConstructor extends DescribedTypeConstructor<A { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:application-properties:map"),UnsignedLong.valueOf(0x0000000000000074L), + Symbol.valueOf("amqp:application-properties:map"),UnsignedLong.valueOf(0x0000000000000074L), }; private static final ApplicationPropertiesConstructor INSTANCE = new ApplicationPropertiesConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DataConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DataConstructor.java index 94b7adc36c..75e921c1b8 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DataConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DataConstructor.java @@ -33,7 +33,7 @@ public class DataConstructor extends DescribedTypeConstructor<Data> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:data:binary"),UnsignedLong.valueOf(0x0000000000000075L), + Symbol.valueOf("amqp:data:binary"),UnsignedLong.valueOf(0x0000000000000075L), }; private static final DataConstructor INSTANCE = new DataConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnCloseConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnCloseConstructor.java index 1e3c31e1f6..31236a00cc 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnCloseConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnCloseConstructor.java @@ -36,7 +36,7 @@ public class DeleteOnCloseConstructor extends DescribedTypeConstructor<DeleteOnC { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:delete-on-close:list"),UnsignedLong.valueOf(0x000000000000002bL), + Symbol.valueOf("amqp:delete-on-close:list"),UnsignedLong.valueOf(0x000000000000002bL), }; private static final DeleteOnCloseConstructor INSTANCE = new DeleteOnCloseConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksConstructor.java index ebb340ab61..e5ea6e923e 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksConstructor.java @@ -36,7 +36,7 @@ public class DeleteOnNoLinksConstructor extends DescribedTypeConstructor<DeleteO { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:delete-on-no-links:list"),UnsignedLong.valueOf(0x000000000000002cL), + Symbol.valueOf("amqp:delete-on-no-links:list"),UnsignedLong.valueOf(0x000000000000002cL), }; private static final DeleteOnNoLinksConstructor INSTANCE = new DeleteOnNoLinksConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksOrMessagesConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksOrMessagesConstructor.java index 389cf6ba9b..c9bafe9550 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksOrMessagesConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoLinksOrMessagesConstructor.java @@ -36,7 +36,7 @@ public class DeleteOnNoLinksOrMessagesConstructor extends DescribedTypeConstruct { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:delete-on-no-links-or-messages:list"),UnsignedLong.valueOf(0x000000000000002eL), + Symbol.valueOf("amqp:delete-on-no-links-or-messages:list"),UnsignedLong.valueOf(0x000000000000002eL), }; private static final DeleteOnNoLinksOrMessagesConstructor INSTANCE = new DeleteOnNoLinksOrMessagesConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoMessagesConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoMessagesConstructor.java index 287007b926..de8ce5b9a5 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoMessagesConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeleteOnNoMessagesConstructor.java @@ -36,7 +36,7 @@ public class DeleteOnNoMessagesConstructor extends DescribedTypeConstructor<Dele { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:delete-on-no-messages:list"),UnsignedLong.valueOf(0x000000000000002dL), + Symbol.valueOf("amqp:delete-on-no-messages:list"),UnsignedLong.valueOf(0x000000000000002dL), }; private static final DeleteOnNoMessagesConstructor INSTANCE = new DeleteOnNoMessagesConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryAnnotationsConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryAnnotationsConstructor.java index 9e200a73f1..3596a1f722 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryAnnotationsConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryAnnotationsConstructor.java @@ -36,7 +36,7 @@ public class DeliveryAnnotationsConstructor extends DescribedTypeConstructor<Del { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:delivery-annotations:map"),UnsignedLong.valueOf(0x0000000000000071L), + Symbol.valueOf("amqp:delivery-annotations:map"),UnsignedLong.valueOf(0x0000000000000071L), }; private static final DeliveryAnnotationsConstructor INSTANCE = new DeliveryAnnotationsConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateConstructor.java deleted file mode 100644 index 1f0527cf04..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateConstructor.java +++ /dev/null @@ -1,208 +0,0 @@ - -/* -* -* 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.*; -import org.apache.qpid.amqp_1_0.type.messaging.*; -import org.apache.qpid.amqp_1_0.type.messaging.DeliveryState; - - -import java.util.List; -import java.util.Map; - -public class DeliveryStateConstructor extends DescribedTypeConstructor<DeliveryState> -{ - private static final Object[] DESCRIPTORS = - { - Symbol.valueOf("apache.qpid.amqp_1_0:delivery-state:list"),UnsignedLong.valueOf(0x0000000000000023L), - }; - - private static final DeliveryStateConstructor INSTANCE = new DeliveryStateConstructor(); - - public static void register(DescribedTypeConstructorRegistry registry) - { - for(Object descriptor : DESCRIPTORS) - { - registry.register(descriptor, INSTANCE); - } - } - - public DeliveryState construct(Object underlying) - { - if(underlying instanceof List) - { - List list = (List) underlying; - DeliveryState obj = new DeliveryState(); - int position = 0; - final int size = list.size(); - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setOptions( (Map) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setSectionNumber( (UnsignedInteger) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setSectionOffset( (UnsignedLong) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setOutcome( (Outcome) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setTxnId( (Binary) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - - return obj; - } - else - { - // TODO - error - return null; - } - } - - -} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateWriter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateWriter.java deleted file mode 100644 index 8177812838..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/DeliveryStateWriter.java +++ /dev/null @@ -1,182 +0,0 @@ - -/* -* -* 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.AbstractListWriter; -import org.apache.qpid.amqp_1_0.codec.ValueWriter; - -import org.apache.qpid.amqp_1_0.type.UnsignedLong; -import org.apache.qpid.amqp_1_0.type.messaging.DeliveryState; - -public class DeliveryStateWriter extends AbstractDescribedTypeWriter<DeliveryState> -{ - private DeliveryState _value; - private int _count = -1; - - public DeliveryStateWriter(final Registry registry) - { - super(registry); - } - - @Override - protected void onSetValue(final DeliveryState value) - { - _value = value; - _count = calculateCount(); - } - - private int calculateCount() - { - - - if( _value.getTxnId() != null) - { - return 5; - } - - if( _value.getOutcome() != null) - { - return 4; - } - - if( _value.getSectionOffset() != null) - { - return 3; - } - - if( _value.getSectionNumber() != null) - { - return 2; - } - - if( _value.getOptions() != null) - { - return 1; - } - - return 0; - } - - @Override - protected void clear() - { - _value = null; - _count = -1; - } - - - protected Object getDescriptor() - { - return UnsignedLong.valueOf(0x0000000000000023L); - } - - @Override - protected ValueWriter createDescribedWriter() - { - final Writer writer = new Writer(getRegistry()); - writer.setValue(_value); - return writer; - } - - private class Writer extends AbstractListWriter<DeliveryState> - { - private int _field; - - public Writer(final Registry registry) - { - super(registry); - } - - @Override - protected void onSetValue(final DeliveryState value) - { - reset(); - } - - @Override - protected int getCount() - { - return _count; - } - - @Override - protected boolean hasNext() - { - return _field < _count; - } - - @Override - protected Object next() - { - switch(_field++) - { - - case 0: - return _value.getOptions(); - - case 1: - return _value.getSectionNumber(); - - case 2: - return _value.getSectionOffset(); - - case 3: - return _value.getOutcome(); - - case 4: - return _value.getTxnId(); - - default: - return null; - } - } - - @Override - protected void clear() - { - } - - @Override - protected void reset() - { - _field = 0; - } - } - - private static Factory<DeliveryState> FACTORY = new Factory<DeliveryState>() - { - - public ValueWriter<DeliveryState> newInstance(Registry registry) - { - return new DeliveryStateWriter(registry); - } - }; - - public static void register(ValueWriter.Registry registry) - { - registry.register(DeliveryState.class, FACTORY); - } - -} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterConstructor.java new file mode 100644 index 0000000000..48bec31797 --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterConstructor.java @@ -0,0 +1,64 @@ + +/* +* +* 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.ExactSubjectFilter; + +public class ExactSubjectFilterConstructor extends DescribedTypeConstructor<ExactSubjectFilter> +{ + private static final Object[] DESCRIPTORS = + { + Symbol.valueOf("amqp:exact-subject-filter:string"), + }; + + private static final ExactSubjectFilterConstructor INSTANCE = new ExactSubjectFilterConstructor(); + + public static void register(DescribedTypeConstructorRegistry registry) + { + for(Object descriptor : DESCRIPTORS) + { + registry.register(descriptor, INSTANCE); + } + } + + + public ExactSubjectFilter construct(Object underlying) + { + + if(underlying instanceof String) + { + return new ExactSubjectFilter((String)underlying); + } + else + { + // TODO - error + return null; + } + } + + +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterWriter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterWriter.java new file mode 100644 index 0000000000..75e2df4b65 --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ExactSubjectFilterWriter.java @@ -0,0 +1,79 @@ + +/* +* +* 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.ValueWriter; +import org.apache.qpid.amqp_1_0.type.Symbol; +import org.apache.qpid.amqp_1_0.type.messaging.ExactSubjectFilter; + +public class ExactSubjectFilterWriter extends AbstractDescribedTypeWriter<ExactSubjectFilter> +{ + private ExactSubjectFilter _value; + + + + public ExactSubjectFilterWriter(final Registry registry) + { + super(registry); + } + + @Override + protected void onSetValue(final ExactSubjectFilter value) + { + _value = value; + } + + @Override + protected void clear() + { + _value = null; + } + + protected Object getDescriptor() + { + return Symbol.valueOf("amqp:exact-subject-filter:string"); + } + + @Override + protected ValueWriter createDescribedWriter() + { + return getRegistry().getValueWriter(_value.getValue()); + } + + private static Factory<ExactSubjectFilter> FACTORY = new Factory<ExactSubjectFilter>() + { + + public ValueWriter<ExactSubjectFilter> newInstance(Registry registry) + { + return new ExactSubjectFilterWriter(registry); + } + }; + + public static void register(Registry registry) + { + registry.register(ExactSubjectFilter.class, FACTORY); + } + +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterConstructor.java deleted file mode 100644 index cc58debb43..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterConstructor.java +++ /dev/null @@ -1,126 +0,0 @@ - -/* -* -* 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.*; -import org.apache.qpid.amqp_1_0.type.messaging.*; -import org.apache.qpid.amqp_1_0.type.messaging.Filter; - - -import java.util.List; - -public class FilterConstructor extends DescribedTypeConstructor<Filter> -{ - private static final Object[] DESCRIPTORS = - { - Symbol.valueOf("apache.qpid.amqp_1_0:filter:list"),UnsignedLong.valueOf(0x000000000000002aL), - }; - - private static final FilterConstructor INSTANCE = new FilterConstructor(); - - public static void register(DescribedTypeConstructorRegistry registry) - { - for(Object descriptor : DESCRIPTORS) - { - registry.register(descriptor, INSTANCE); - } - } - - public Filter construct(Object underlying) - { - if(underlying instanceof List) - { - List list = (List) underlying; - Filter obj = new Filter(); - int position = 0; - final int size = list.size(); - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setType( (Symbol) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - if(position < size) - { - Object val = list.get(position); - position++; - - if(val != null) - { - - try - { - obj.setPredicate( (Predicate) val ); - } - catch(ClassCastException e) - { - - // TODO Error - } - - } - - - } - else - { - return obj; - } - - - return obj; - } - else - { - // TODO - error - return null; - } - } - - -} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterWriter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterWriter.java deleted file mode 100644 index 549e516a9d..0000000000 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FilterWriter.java +++ /dev/null @@ -1,158 +0,0 @@ - -/* -* -* 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.AbstractListWriter; -import org.apache.qpid.amqp_1_0.codec.ValueWriter; - -import org.apache.qpid.amqp_1_0.type.UnsignedLong; -import org.apache.qpid.amqp_1_0.type.messaging.Filter; - -public class FilterWriter extends AbstractDescribedTypeWriter<Filter> -{ - private Filter _value; - private int _count = -1; - - public FilterWriter(final Registry registry) - { - super(registry); - } - - @Override - protected void onSetValue(final Filter value) - { - _value = value; - _count = calculateCount(); - } - - private int calculateCount() - { - - - if( _value.getPredicate() != null) - { - return 2; - } - - if( _value.getType() != null) - { - return 1; - } - - return 0; - } - - @Override - protected void clear() - { - _value = null; - _count = -1; - } - - - protected Object getDescriptor() - { - return UnsignedLong.valueOf(0x000000000000002aL); - } - - @Override - protected ValueWriter createDescribedWriter() - { - final Writer writer = new Writer(getRegistry()); - writer.setValue(_value); - return writer; - } - - private class Writer extends AbstractListWriter<Filter> - { - private int _field; - - public Writer(final Registry registry) - { - super(registry); - } - - @Override - protected void onSetValue(final Filter value) - { - reset(); - } - - @Override - protected int getCount() - { - return _count; - } - - @Override - protected boolean hasNext() - { - return _field < _count; - } - - @Override - protected Object next() - { - switch(_field++) - { - - case 0: - return _value.getType(); - - case 1: - return _value.getPredicate(); - - default: - return null; - } - } - - @Override - protected void clear() - { - } - - @Override - protected void reset() - { - _field = 0; - } - } - - private static Factory<Filter> FACTORY = new Factory<Filter>() - { - - public ValueWriter<Filter> newInstance(Registry registry) - { - return new FilterWriter(registry); - } - }; - - public static void register(ValueWriter.Registry registry) - { - registry.register(Filter.class, FACTORY); - } - -} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FooterConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FooterConstructor.java index c42345be71..ed92c9f8f8 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FooterConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/FooterConstructor.java @@ -36,7 +36,7 @@ public class FooterConstructor extends DescribedTypeConstructor<Footer> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:footer:map"),UnsignedLong.valueOf(0x0000000000000078L), + Symbol.valueOf("amqp:footer:map"),UnsignedLong.valueOf(0x0000000000000078L), }; private static final FooterConstructor INSTANCE = new FooterConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/HeaderConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/HeaderConstructor.java index ae5c50bf18..5a1b4ceb1b 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/HeaderConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/HeaderConstructor.java @@ -36,7 +36,7 @@ public class HeaderConstructor extends DescribedTypeConstructor<Header> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:header:list"),UnsignedLong.valueOf(0x0000000000000070L), + Symbol.valueOf("amqp:header:list"),UnsignedLong.valueOf(0x0000000000000070L), }; private static final HeaderConstructor INSTANCE = new HeaderConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterConstructor.java new file mode 100644 index 0000000000..d9cdc7bbb9 --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterConstructor.java @@ -0,0 +1,64 @@ + +/* +* +* 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.MatchingSubjectFilter; + +public class MatchingSubjectFilterConstructor extends DescribedTypeConstructor<MatchingSubjectFilter> +{ + private static final Object[] DESCRIPTORS = + { + Symbol.valueOf("amqp:matching-subject-filter:string"), + }; + + private static final MatchingSubjectFilterConstructor INSTANCE = new MatchingSubjectFilterConstructor(); + + public static void register(DescribedTypeConstructorRegistry registry) + { + for(Object descriptor : DESCRIPTORS) + { + registry.register(descriptor, INSTANCE); + } + } + + + public MatchingSubjectFilter construct(Object underlying) + { + + if(underlying instanceof String) + { + return new MatchingSubjectFilter((String)underlying); + } + else + { + // TODO - error + return null; + } + } + + +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterWriter.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterWriter.java new file mode 100644 index 0000000000..29fd304831 --- /dev/null +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MatchingSubjectFilterWriter.java @@ -0,0 +1,79 @@ + +/* +* +* 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.ValueWriter; +import org.apache.qpid.amqp_1_0.type.Symbol; +import org.apache.qpid.amqp_1_0.type.messaging.MatchingSubjectFilter; + +public class MatchingSubjectFilterWriter extends AbstractDescribedTypeWriter<MatchingSubjectFilter> +{ + private MatchingSubjectFilter _value; + + + + public MatchingSubjectFilterWriter(final Registry registry) + { + super(registry); + } + + @Override + protected void onSetValue(final MatchingSubjectFilter value) + { + _value = value; + } + + @Override + protected void clear() + { + _value = null; + } + + protected Object getDescriptor() + { + return Symbol.valueOf("amqp:matching-subject-filter:string"); + } + + @Override + protected ValueWriter createDescribedWriter() + { + return getRegistry().getValueWriter(_value.getValue()); + } + + private static Factory<MatchingSubjectFilter> FACTORY = new Factory<MatchingSubjectFilter>() + { + + public ValueWriter<MatchingSubjectFilter> newInstance(Registry registry) + { + return new MatchingSubjectFilterWriter(registry); + } + }; + + public static void register(Registry registry) + { + registry.register(MatchingSubjectFilter.class, FACTORY); + } + +} diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsConstructor.java index 0f0365d395..b2f2ec5739 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/MessageAnnotationsConstructor.java @@ -36,7 +36,7 @@ public class MessageAnnotationsConstructor extends DescribedTypeConstructor<Mess { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:message-annotations:map"),UnsignedLong.valueOf(0x0000000000000072L), + Symbol.valueOf("amqp:message-annotations:map"),UnsignedLong.valueOf(0x0000000000000072L), }; private static final MessageAnnotationsConstructor INSTANCE = new MessageAnnotationsConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ModifiedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ModifiedConstructor.java index b01026195a..fb78708d7d 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ModifiedConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ModifiedConstructor.java @@ -37,7 +37,7 @@ public class ModifiedConstructor extends DescribedTypeConstructor<Modified> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:modified:list"),UnsignedLong.valueOf(0x0000000000000027L), + Symbol.valueOf("amqp:modified:list"),UnsignedLong.valueOf(0x0000000000000027L), }; private static final ModifiedConstructor INSTANCE = new ModifiedConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/PropertiesConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/PropertiesConstructor.java index 3f70d0b2ef..98b911f341 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/PropertiesConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/PropertiesConstructor.java @@ -37,7 +37,7 @@ public class PropertiesConstructor extends DescribedTypeConstructor<Properties> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:properties:list"),UnsignedLong.valueOf(0x0000000000000073L), + Symbol.valueOf("amqp:properties:list"),UnsignedLong.valueOf(0x0000000000000073L), }; private static final PropertiesConstructor INSTANCE = new PropertiesConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReceivedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReceivedConstructor.java index 2728fd939f..a515379d33 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReceivedConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReceivedConstructor.java @@ -36,7 +36,7 @@ public class ReceivedConstructor extends DescribedTypeConstructor<Received> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:received:list"),UnsignedLong.valueOf(0x0000000000000023L), + Symbol.valueOf("amqp:received:list"),UnsignedLong.valueOf(0x0000000000000023L), }; private static final ReceivedConstructor INSTANCE = new ReceivedConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java index 390ad61908..eb923c535d 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/RejectedConstructor.java @@ -36,7 +36,7 @@ public class RejectedConstructor extends DescribedTypeConstructor<Rejected> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:rejected:list"),UnsignedLong.valueOf(0x0000000000000025L), + Symbol.valueOf("amqp:rejected:list"),UnsignedLong.valueOf(0x0000000000000025L), }; private static final RejectedConstructor INSTANCE = new RejectedConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReleasedConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReleasedConstructor.java index a8987021ce..534b81efd7 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReleasedConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/ReleasedConstructor.java @@ -36,7 +36,7 @@ public class ReleasedConstructor extends DescribedTypeConstructor<Released> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:released:list"),UnsignedLong.valueOf(0x0000000000000026L), + Symbol.valueOf("amqp:released:list"),UnsignedLong.valueOf(0x0000000000000026L), }; private static final ReleasedConstructor INSTANCE = new ReleasedConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java index 3019532822..764fa222ee 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/SourceConstructor.java @@ -37,7 +37,7 @@ public class SourceConstructor extends DescribedTypeConstructor<Source> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:source:list"),UnsignedLong.valueOf(0x0000000000000028L), + Symbol.valueOf("amqp:source:list"),UnsignedLong.valueOf(0x0000000000000028L), }; private static final SourceConstructor INSTANCE = new SourceConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/TargetConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/TargetConstructor.java index bd782a0486..1c89574273 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/TargetConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/messaging/codec/TargetConstructor.java @@ -37,7 +37,7 @@ public class TargetConstructor extends DescribedTypeConstructor<Target> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:target:list"),UnsignedLong.valueOf(0x0000000000000029L), + Symbol.valueOf("amqp:target:list"),UnsignedLong.valueOf(0x0000000000000029L), }; private static final TargetConstructor INSTANCE = new TargetConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslChallengeConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslChallengeConstructor.java index 9e840832c6..400e62db5a 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslChallengeConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslChallengeConstructor.java @@ -36,7 +36,7 @@ public class SaslChallengeConstructor extends DescribedTypeConstructor<SaslChall { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:sasl-challenge:list"),UnsignedLong.valueOf(0x0000000000000042L), + Symbol.valueOf("amqp:sasl-challenge:list"),UnsignedLong.valueOf(0x0000000000000042L), }; private static final SaslChallengeConstructor INSTANCE = new SaslChallengeConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslInitConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslInitConstructor.java index 2dacbf2ac2..ff21c8e7d9 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslInitConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslInitConstructor.java @@ -36,7 +36,7 @@ public class SaslInitConstructor extends DescribedTypeConstructor<SaslInit> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:sasl-init:list"),UnsignedLong.valueOf(0x0000000000000041L), + Symbol.valueOf("amqp:sasl-init:list"),UnsignedLong.valueOf(0x0000000000000041L), }; private static final SaslInitConstructor INSTANCE = new SaslInitConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslMechanismsConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslMechanismsConstructor.java index 8d49c758dd..0fcdbd2a1a 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslMechanismsConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslMechanismsConstructor.java @@ -36,7 +36,7 @@ public class SaslMechanismsConstructor extends DescribedTypeConstructor<SaslMech { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:sasl-mechanisms:list"),UnsignedLong.valueOf(0x0000000000000040L), + Symbol.valueOf("amqp:sasl-mechanisms:list"),UnsignedLong.valueOf(0x0000000000000040L), }; private static final SaslMechanismsConstructor INSTANCE = new SaslMechanismsConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslOutcomeConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslOutcomeConstructor.java index f5df0e10c9..b1c4760d3e 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslOutcomeConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslOutcomeConstructor.java @@ -36,7 +36,7 @@ public class SaslOutcomeConstructor extends DescribedTypeConstructor<SaslOutcome { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:sasl-outcome:list"),UnsignedLong.valueOf(0x0000000000000044L), + Symbol.valueOf("amqp:sasl-outcome:list"),UnsignedLong.valueOf(0x0000000000000044L), }; private static final SaslOutcomeConstructor INSTANCE = new SaslOutcomeConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslResponseConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslResponseConstructor.java index c21f95ccf9..364cf59a2f 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslResponseConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/security/codec/SaslResponseConstructor.java @@ -36,7 +36,7 @@ public class SaslResponseConstructor extends DescribedTypeConstructor<SaslRespon { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:sasl-response:list"),UnsignedLong.valueOf(0x0000000000000043L), + Symbol.valueOf("amqp:sasl-response:list"),UnsignedLong.valueOf(0x0000000000000043L), }; private static final SaslResponseConstructor INSTANCE = new SaslResponseConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java index f6aa16ec80..b87a7eea91 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TransactionErrors.java @@ -37,11 +37,11 @@ public class TransactionErrors private final Symbol _val; - public static final TransactionErrors UNKNOWN_ID = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:unknown-id")); + public static final TransactionErrors UNKNOWN_ID = new TransactionErrors(Symbol.valueOf("amqp:transaction:unknown-id")); - public static final TransactionErrors TRANSACTION_ROLLBACK = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:rollback")); + public static final TransactionErrors TRANSACTION_ROLLBACK = new TransactionErrors(Symbol.valueOf("amqp:transaction:rollback")); - public static final TransactionErrors TRANSACTION_TIMEOUT = new TransactionErrors(Symbol.valueOf("apache.qpid.amqp_1_0:transaction:timeout")); + public static final TransactionErrors TRANSACTION_TIMEOUT = new TransactionErrors(Symbol.valueOf("amqp:transaction:timeout")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java index 998528f3c3..840cc57d27 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapabilities.java @@ -38,17 +38,17 @@ public class TxnCapabilities private final Symbol _val; - public static final TxnCapabilities LOCAL_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:local-transactions")); + public static final TxnCapabilities LOCAL_TXN = new TxnCapabilities(Symbol.valueOf("amqp:local-transactions")); - public static final TxnCapabilities DISTRIBUTED_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:distributed-transactions")); + public static final TxnCapabilities DISTRIBUTED_TXN = new TxnCapabilities(Symbol.valueOf("amqp:distributed-transactions")); - public static final TxnCapabilities PROMOTABLE_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:promotable-transactions")); + public static final TxnCapabilities PROMOTABLE_TXN = new TxnCapabilities(Symbol.valueOf("amqp:promotable-transactions")); - public static final TxnCapabilities MULTI_TXNS_PER_SSN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-txns-per-ssn")); + public static final TxnCapabilities MULTI_TXNS_PER_SSN = new TxnCapabilities(Symbol.valueOf("amqp:multi-txns-per-ssn")); - public static final TxnCapabilities MULTI_SSNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-ssns-per-txn")); + public static final TxnCapabilities MULTI_SSNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("amqp:multi-ssns-per-txn")); - public static final TxnCapabilities MULTI_CONNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("apache.qpid.amqp_1_0:multi-conns-per-txn")); + public static final TxnCapabilities MULTI_CONNS_PER_TXN = new TxnCapabilities(Symbol.valueOf("amqp:multi-conns-per-txn")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java index d3593fc8c6..19763f5b6b 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/TxnCapability.java @@ -37,15 +37,15 @@ public class TxnCapability private final Symbol _val; - public static final TxnCapability LOCAL_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:local-transactions")); + public static final TxnCapability LOCAL_TXN = new TxnCapability(Symbol.valueOf("amqp:local-transactions")); - public static final TxnCapability DISTRIBUTED_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:distributed-transactions")); + public static final TxnCapability DISTRIBUTED_TXN = new TxnCapability(Symbol.valueOf("amqp:distributed-transactions")); - public static final TxnCapability PROMOTABLE_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:promotable-transactions")); + public static final TxnCapability PROMOTABLE_TXN = new TxnCapability(Symbol.valueOf("amqp:promotable-transactions")); - public static final TxnCapability MULTI_TXNS_PER_SSN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:multi-txns-per-ssn")); + public static final TxnCapability MULTI_TXNS_PER_SSN = new TxnCapability(Symbol.valueOf("amqp:multi-txns-per-ssn")); - public static final TxnCapability MULTI_SSNS_PER_TXN = new TxnCapability(Symbol.valueOf("apache.qpid.amqp_1_0:multi-ssns-per-txn")); + public static final TxnCapability MULTI_SSNS_PER_TXN = new TxnCapability(Symbol.valueOf("amqp:multi-ssns-per-txn")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java index eae19762e7..de1dbc625e 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/CoordinatorConstructor.java @@ -36,7 +36,7 @@ public class CoordinatorConstructor extends DescribedTypeConstructor<Coordinator { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:coordinator:list"),UnsignedLong.valueOf(0x0000000000000030L), + Symbol.valueOf("amqp:coordinator:list"),UnsignedLong.valueOf(0x0000000000000030L), }; private static final CoordinatorConstructor INSTANCE = new CoordinatorConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java index c47c793da1..7eaf7dd9a8 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclareConstructor.java @@ -36,7 +36,7 @@ public class DeclareConstructor extends DescribedTypeConstructor<Declare> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:declare:list"),UnsignedLong.valueOf(0x0000000000000031L), + Symbol.valueOf("amqp:declare:list"),UnsignedLong.valueOf(0x0000000000000031L), }; private static final DeclareConstructor INSTANCE = new DeclareConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java index d378f6a90e..1e226ff994 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DeclaredConstructor.java @@ -36,7 +36,7 @@ public class DeclaredConstructor extends DescribedTypeConstructor<Declared> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:declared:list"),UnsignedLong.valueOf(0x0000000000000033L), + Symbol.valueOf("amqp:declared:list"),UnsignedLong.valueOf(0x0000000000000033L), }; private static final DeclaredConstructor INSTANCE = new DeclaredConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java index c8eef6125c..ab088cc74d 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/DischargeConstructor.java @@ -36,7 +36,7 @@ public class DischargeConstructor extends DescribedTypeConstructor<Discharge> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:discharge:list"),UnsignedLong.valueOf(0x0000000000000032L), + Symbol.valueOf("amqp:discharge:list"),UnsignedLong.valueOf(0x0000000000000032L), }; private static final DischargeConstructor INSTANCE = new DischargeConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java index aab1cbcf15..88cddba562 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transaction/codec/TransactionalStateConstructor.java @@ -36,7 +36,7 @@ public class TransactionalStateConstructor extends DescribedTypeConstructor<Tran { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:transactional-state:list"),UnsignedLong.valueOf(0x0000000000000034L), + Symbol.valueOf("amqp:transactional-state:list"),UnsignedLong.valueOf(0x0000000000000034L), }; private static final TransactionalStateConstructor INSTANCE = new TransactionalStateConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java index 865788d064..075a80ef90 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/AmqpError.java @@ -37,31 +37,31 @@ public class AmqpError private final Symbol _val; - public static final AmqpError INTERNAL_ERROR = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:internal-error")); + public static final AmqpError INTERNAL_ERROR = new AmqpError(Symbol.valueOf("amqp:internal-error")); - public static final AmqpError NOT_FOUND = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-found")); + public static final AmqpError NOT_FOUND = new AmqpError(Symbol.valueOf("amqp:not-found")); - public static final AmqpError UNAUTHORIZED_ACCESS = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:unauthorized-access")); + public static final AmqpError UNAUTHORIZED_ACCESS = new AmqpError(Symbol.valueOf("amqp:unauthorized-access")); - public static final AmqpError DECODE_ERROR = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:decode-error")); + public static final AmqpError DECODE_ERROR = new AmqpError(Symbol.valueOf("amqp:decode-error")); - public static final AmqpError RESOURCE_LIMIT_EXCEEDED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-limit-exceeded")); + public static final AmqpError RESOURCE_LIMIT_EXCEEDED = new AmqpError(Symbol.valueOf("amqp:resource-limit-exceeded")); - public static final AmqpError NOT_ALLOWED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-allowed")); + public static final AmqpError NOT_ALLOWED = new AmqpError(Symbol.valueOf("amqp:not-allowed")); - public static final AmqpError INVALID_FIELD = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:invalid-field")); + public static final AmqpError INVALID_FIELD = new AmqpError(Symbol.valueOf("amqp:invalid-field")); - public static final AmqpError NOT_IMPLEMENTED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:not-implemented")); + public static final AmqpError NOT_IMPLEMENTED = new AmqpError(Symbol.valueOf("amqp:not-implemented")); - public static final AmqpError RESOURCE_LOCKED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-locked")); + public static final AmqpError RESOURCE_LOCKED = new AmqpError(Symbol.valueOf("amqp:resource-locked")); - public static final AmqpError PRECONDITION_FAILED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:precondition-failed")); + public static final AmqpError PRECONDITION_FAILED = new AmqpError(Symbol.valueOf("amqp:precondition-failed")); - public static final AmqpError RESOURCE_DELETED = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:resource-deleted")); + public static final AmqpError RESOURCE_DELETED = new AmqpError(Symbol.valueOf("amqp:resource-deleted")); - public static final AmqpError ILLEGAL_STATE = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:illegal-state")); + public static final AmqpError ILLEGAL_STATE = new AmqpError(Symbol.valueOf("amqp:illegal-state")); - public static final AmqpError FRAME_SIZE_TOO_SMALL = new AmqpError(Symbol.valueOf("apache.qpid.amqp_1_0:frame-size-too-small")); + public static final AmqpError FRAME_SIZE_TOO_SMALL = new AmqpError(Symbol.valueOf("amqp:frame-size-too-small")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java index 560f098755..07f0496e23 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/ConnectionError.java @@ -37,11 +37,11 @@ public class ConnectionError private final Symbol _val; - public static final ConnectionError CONNECTION_FORCED = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:forced")); + public static final ConnectionError CONNECTION_FORCED = new ConnectionError(Symbol.valueOf("amqp:connection:forced")); - public static final ConnectionError FRAMING_ERROR = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:framing-error")); + public static final ConnectionError FRAMING_ERROR = new ConnectionError(Symbol.valueOf("amqp:connection:framing-error")); - public static final ConnectionError REDIRECT = new ConnectionError(Symbol.valueOf("apache.qpid.amqp_1_0:connection:redirect")); + public static final ConnectionError REDIRECT = new ConnectionError(Symbol.valueOf("amqp:connection:redirect")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/LinkError.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/LinkError.java index 462b7974ac..3c2d025619 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/LinkError.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/LinkError.java @@ -37,15 +37,15 @@ public class LinkError private final Symbol _val; - public static final LinkError DETACH_FORCED = new LinkError(Symbol.valueOf("apache.qpid.amqp_1_0:link:detach-forced")); + public static final LinkError DETACH_FORCED = new LinkError(Symbol.valueOf("amqp:link:detach-forced")); - public static final LinkError TRANSFER_LIMIT_EXCEEDED = new LinkError(Symbol.valueOf("apache.qpid.amqp_1_0:link:transfer-limit-exceeded")); + public static final LinkError TRANSFER_LIMIT_EXCEEDED = new LinkError(Symbol.valueOf("amqp:link:transfer-limit-exceeded")); - public static final LinkError MESSAGE_SIZE_EXCEEDED = new LinkError(Symbol.valueOf("apache.qpid.amqp_1_0:link:message-size-exceeded")); + public static final LinkError MESSAGE_SIZE_EXCEEDED = new LinkError(Symbol.valueOf("amqp:link:message-size-exceeded")); - public static final LinkError REDIRECT = new LinkError(Symbol.valueOf("apache.qpid.amqp_1_0:link:redirect")); + public static final LinkError REDIRECT = new LinkError(Symbol.valueOf("amqp:link:redirect")); - public static final LinkError STOLEN = new LinkError(Symbol.valueOf("apache.qpid.amqp_1_0:link:stolen")); + public static final LinkError STOLEN = new LinkError(Symbol.valueOf("amqp:link:stolen")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/SessionError.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/SessionError.java index a9441dd1a2..b7b233c879 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/SessionError.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/SessionError.java @@ -37,13 +37,13 @@ public class SessionError private final Symbol _val; - public static final SessionError WINDOW_VIOLATION = new SessionError(Symbol.valueOf("apache.qpid.amqp_1_0:session:window-violation")); + public static final SessionError WINDOW_VIOLATION = new SessionError(Symbol.valueOf("amqp:session:window-violation")); - public static final SessionError ERRANT_LINK = new SessionError(Symbol.valueOf("apache.qpid.amqp_1_0:session:errant-link")); + public static final SessionError ERRANT_LINK = new SessionError(Symbol.valueOf("amqp:session:errant-link")); - public static final SessionError HANDLE_IN_USE = new SessionError(Symbol.valueOf("apache.qpid.amqp_1_0:session:handle-in-use")); + public static final SessionError HANDLE_IN_USE = new SessionError(Symbol.valueOf("amqp:session:handle-in-use")); - public static final SessionError UNATTACHED_HANDLE = new SessionError(Symbol.valueOf("apache.qpid.amqp_1_0:session:unattached-handle")); + public static final SessionError UNATTACHED_HANDLE = new SessionError(Symbol.valueOf("amqp:session:unattached-handle")); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/AttachConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/AttachConstructor.java index 0dbeed8c7c..0df84ac820 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/AttachConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/AttachConstructor.java @@ -37,7 +37,7 @@ public class AttachConstructor extends DescribedTypeConstructor<Attach> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:attach:list"),UnsignedLong.valueOf(0x0000000000000012L), + Symbol.valueOf("amqp:attach:list"),UnsignedLong.valueOf(0x0000000000000012L), }; private static final AttachConstructor INSTANCE = new AttachConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/BeginConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/BeginConstructor.java index 6d8f96272b..94470c5139 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/BeginConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/BeginConstructor.java @@ -37,7 +37,7 @@ public class BeginConstructor extends DescribedTypeConstructor<Begin> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:begin:list"),UnsignedLong.valueOf(0x0000000000000011L), + Symbol.valueOf("amqp:begin:list"),UnsignedLong.valueOf(0x0000000000000011L), }; private static final BeginConstructor INSTANCE = new BeginConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/CloseConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/CloseConstructor.java index 9e80aa5a8e..69544dc96f 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/CloseConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/CloseConstructor.java @@ -36,7 +36,7 @@ public class CloseConstructor extends DescribedTypeConstructor<Close> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:close:list"),UnsignedLong.valueOf(0x0000000000000018L), + Symbol.valueOf("amqp:close:list"),UnsignedLong.valueOf(0x0000000000000018L), }; private static final CloseConstructor INSTANCE = new CloseConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java index e46d28dc54..8d90d39769 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DetachConstructor.java @@ -36,7 +36,7 @@ public class DetachConstructor extends DescribedTypeConstructor<Detach> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:detach:list"),UnsignedLong.valueOf(0x0000000000000016L), + Symbol.valueOf("amqp:detach:list"),UnsignedLong.valueOf(0x0000000000000016L), }; private static final DetachConstructor INSTANCE = new DetachConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java index 8188b7eb31..928f54ea97 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/DispositionConstructor.java @@ -36,7 +36,7 @@ public class DispositionConstructor extends DescribedTypeConstructor<Disposition { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:disposition:list"),UnsignedLong.valueOf(0x0000000000000015L), + Symbol.valueOf("amqp:disposition:list"),UnsignedLong.valueOf(0x0000000000000015L), }; private static final DispositionConstructor INSTANCE = new DispositionConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java index 947539f21d..0f8fe63d55 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/EndConstructor.java @@ -36,7 +36,7 @@ public class EndConstructor extends DescribedTypeConstructor<End> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:end:list"),UnsignedLong.valueOf(0x0000000000000017L), + Symbol.valueOf("amqp:end:list"),UnsignedLong.valueOf(0x0000000000000017L), }; private static final EndConstructor INSTANCE = new EndConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java index 34cfdbbbe8..5a5a1c3752 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/ErrorConstructor.java @@ -36,7 +36,7 @@ public class ErrorConstructor extends DescribedTypeConstructor<org.apache.qpid.a { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:error:list"),UnsignedLong.valueOf(0x000000000000001dL), + Symbol.valueOf("amqp:error:list"),UnsignedLong.valueOf(0x000000000000001dL), }; private static final ErrorConstructor INSTANCE = new ErrorConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java index 23577149f9..406b5a327a 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/FlowConstructor.java @@ -37,7 +37,7 @@ public class FlowConstructor extends DescribedTypeConstructor<Flow> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:flow:list"),UnsignedLong.valueOf(0x0000000000000013L), + Symbol.valueOf("amqp:flow:list"),UnsignedLong.valueOf(0x0000000000000013L), }; private static final FlowConstructor INSTANCE = new FlowConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java index a99b4572f8..ba2df038e4 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/OpenConstructor.java @@ -37,7 +37,7 @@ public class OpenConstructor extends DescribedTypeConstructor<Open> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:open:list"),UnsignedLong.valueOf(0x0000000000000010L), + Symbol.valueOf("amqp:open:list"),UnsignedLong.valueOf(0x0000000000000010L), }; private static final OpenConstructor INSTANCE = new OpenConstructor(); diff --git a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java index a601407288..ad3812bbdc 100644 --- a/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java +++ b/qpid/java/amqp-1-0-common/src/main/java/org/apache/qpid/amqp_1_0/type/transport/codec/TransferConstructor.java @@ -36,7 +36,7 @@ public class TransferConstructor extends DescribedTypeConstructor<Transfer> { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("apache.qpid.amqp_1_0:transfer:list"),UnsignedLong.valueOf(0x0000000000000014L), + Symbol.valueOf("amqp:transfer:list"),UnsignedLong.valueOf(0x0000000000000014L), }; private static final TransferConstructor INSTANCE = new TransferConstructor(); diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageMetaData_1_0.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageMetaData_1_0.java index a5841dd94e..a4046c68f2 100755 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageMetaData_1_0.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/message/MessageMetaData_1_0.java @@ -496,6 +496,10 @@ public class MessageMetaData_1_0 implements StorableMessageMetaData return _appProperties != null && _appProperties.containsKey(name); } + public String getSubject() + { + return _properties == null ? null : _properties.getSubject(); + } } } diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeDestination.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeDestination.java index c518ee5cc3..3faf896aae 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeDestination.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeDestination.java @@ -31,7 +31,7 @@ import org.apache.qpid.server.txn.ServerTransaction; import java.util.ArrayList; import java.util.Arrays; -public class ExchangeDestination implements ReceivingDestination +public class ExchangeDestination implements ReceivingDestination, SendingDestination { private static final Accepted ACCEPTED = new Accepted(); private static final Outcome[] OUTCOMES = { ACCEPTED }; @@ -87,4 +87,9 @@ public class ExchangeDestination implements ReceivingDestination // TODO - fix return 20000; } + + public Exchange getExchange() + { + return _exchange; + } } diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java index d1d6effc2f..b7e2915b70 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Message_1_0.java @@ -54,7 +54,7 @@ public class Message_1_0 implements ServerMessage<Message_1_0>, InboundMessage } else { - return null; + return getMessageHeader().getSubject(); } } @@ -63,7 +63,7 @@ public class Message_1_0 implements ServerMessage<Message_1_0>, InboundMessage return _storedMessage.getMetaData(); } - public AMQMessageHeader getMessageHeader() + public MessageMetaData_1_0.MessageHeader_1_0 getMessageHeader() { return getMessageMetaData().getMessageHeader(); } diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java index 152ccc706b..37ab6ef2ce 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLink_1_0.java @@ -20,6 +20,8 @@ */ package org.apache.qpid.server.protocol.v1_0; +import org.apache.qpid.AMQInternalException; +import org.apache.qpid.AMQSecurityException; import org.apache.qpid.amqp_1_0.transport.DeliveryStateHandler; import org.apache.qpid.amqp_1_0.transport.LinkEndpoint; import org.apache.qpid.amqp_1_0.transport.SendingLinkEndpoint; @@ -33,7 +35,12 @@ import org.apache.qpid.amqp_1_0.type.messaging.*; import org.apache.qpid.amqp_1_0.type.transport.Detach; import org.apache.qpid.amqp_1_0.type.transport.Transfer; import org.apache.qpid.AMQException; +import org.apache.qpid.server.exchange.DirectExchange; +import org.apache.qpid.server.exchange.Exchange; +import org.apache.qpid.server.exchange.ExchangeType; +import org.apache.qpid.server.exchange.TopicExchange; import org.apache.qpid.server.queue.AMQQueue; +import org.apache.qpid.server.queue.AMQQueueFactory; import org.apache.qpid.server.queue.QueueEntry; import org.apache.qpid.server.txn.AutoCommitTransaction; import org.apache.qpid.server.txn.ServerTransaction; @@ -67,28 +74,89 @@ public class SendingLink_1_0 implements SendingLinkListener, Link_1_0, DeliveryS _vhost = vhost; _destination = destination; _linkAttachment = linkAttachment; - _durability = ((Source)linkAttachment.getSource()).getDurable(); + final Source source = (Source) linkAttachment.getSource(); + _durability = source.getDurable(); linkAttachment.setDeliveryStateHandler(this); + QueueDestination qd = null; + AMQQueue queue = null; if(destination instanceof QueueDestination) { - AMQQueue queue = ((QueueDestination) _destination).getQueue(); + queue = ((QueueDestination) _destination).getQueue(); if(queue.getArguments().containsKey("topic")) { - ((Source)linkAttachment.getSource()).setDistributionMode(StdDistMode.COPY); + source.setDistributionMode(StdDistMode.COPY); } - _subscription = new Subscription_1_0(this, (QueueDestination)destination); + qd = (QueueDestination) destination; + source.setFilter(null); + + } + else if(destination instanceof ExchangeDestination) + { try { + queue = AMQQueueFactory.createAMQQueueImpl(UUID.randomUUID().toString(), false, null, true, + false, _vhost, Collections.EMPTY_MAP); + Exchange exchange = ((ExchangeDestination) destination).getExchange(); + + String binding = ""; - queue.registerSubscription(_subscription, false); + Map filters = source.getFilter(); + + if(filters != null && !filters.isEmpty()) + { + + source.setFilter(null); + if(exchange.getType() == DirectExchange.TYPE) + { + if(filters.size() == 1 && filters.values().iterator().next() instanceof ExactSubjectFilter) + { + ExactSubjectFilter filter = (ExactSubjectFilter) filters.values().iterator().next(); + source.setFilter(filters); + binding = filter.getValue(); + } + } + else if(exchange.getType() == TopicExchange.TYPE) + { + if(filters.size() == 1 && filters.values().iterator().next() instanceof MatchingSubjectFilter) + { + MatchingSubjectFilter filter = (MatchingSubjectFilter) filters.values().iterator().next(); + source.setFilter(filters); + binding = filter.getValue(); + } + } + } + + vhost.getBindingFactory().addBinding(binding,queue,exchange,null); + source.setDistributionMode(StdDistMode.COPY); + + qd = new QueueDestination(queue); } - catch (AMQException e) + catch (AMQSecurityException e) { - e.printStackTrace(); //TODO + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. + } + catch (AMQInternalException e) + { + e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates. } + + } + _subscription = new Subscription_1_0(this, qd); + + try + { + + queue.registerSubscription(_subscription, false); + } + catch (AMQException e) + { + e.printStackTrace(); //TODO + } + + } public void resume(SendingLinkAttachment linkAttachment) @@ -107,7 +175,9 @@ public class SendingLink_1_0 implements SendingLinkListener, Link_1_0, DeliveryS try { - ((QueueDestination)_destination).getQueue().unregisterSubscription(_subscription); + + _subscription.getQueue().unregisterSubscription(_subscription); + } catch (AMQException e) { diff --git a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java index 67b3d25d5e..8b29718e23 100644 --- a/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java +++ b/qpid/java/broker/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java @@ -102,11 +102,23 @@ public class Session_1_0 implements SessionEventListener { destination = new QueueDestination(queue); + + + } else { - endpoint.setSource(null); - destination = null; + Exchange exchg = _vhost.getExchangeRegistry().getExchange(addr); + if(exchg != null) + { + destination = new ExchangeDestination(exchg); + } + else + { + + endpoint.setSource(null); + destination = null; + } } } |