From ebe0e458b6566e3c66e2cb0e6da583e043b48cbf Mon Sep 17 00:00:00 2001 From: dakirily Date: Tue, 22 Jul 2025 13:43:36 +0200 Subject: [PATCH 1/2] QPID-8706: Move AMQP-1.0 symbols declarations to a utility class --- .../CompositeTypeConstructorGenerator.java | 16 +- .../server/protocol/v1_0/SymbolMapper.java | 92 ++++++++++ .../protocol/v1_0/AMQPConnection_1_0.java | 4 - .../protocol/v1_0/AMQPConnection_1_0Impl.java | 40 +++-- .../v1_0/AnonymousRelayDestination.java | 13 +- .../v1_0/DeserializationFactories.java | 5 +- .../v1_0/ExchangeSendingDestination.java | 20 +-- .../v1_0/JmsMessageTypeAnnotation.java | 3 - .../MessageConverter_Internal_to_v1_0.java | 4 +- .../v1_0/MessageConverter_from_1_0.java | 5 +- .../v1_0/MessageConverter_to_1_0.java | 7 +- .../protocol/v1_0/MessageMetaData_1_0.java | 10 +- .../v1_0/NodeReceivingDestination.java | 9 +- .../protocol/v1_0/ReceivingDestination.java | 3 - .../protocol/v1_0/SendingLinkEndpoint.java | 39 +++-- .../server/protocol/v1_0/Session_1_0.java | 14 +- .../v1_0/StandardReceivingLinkEndpoint.java | 24 +-- .../TxnCoordinatorReceivingLinkEndpoint.java | 3 +- .../protocol/v1_0/constants/SymbolTexts.java | 158 ++++++++++++++++++ .../protocol/v1_0/constants/Symbols.java | 155 +++++++++++++++++ .../SoleConnectionConnectionProperties.java | 30 ---- .../v1_0/type/messaging/Accepted.java | 10 +- .../v1_0/type/messaging/DeleteOnClose.java | 6 +- .../v1_0/type/messaging/DeleteOnNoLinks.java | 6 +- .../messaging/DeleteOnNoLinksOrMessages.java | 6 +- .../type/messaging/DeleteOnNoMessages.java | 6 +- .../protocol/v1_0/type/messaging/Header.java | 6 +- .../v1_0/type/messaging/Modified.java | 11 +- .../v1_0/type/messaging/Properties.java | 3 +- .../v1_0/type/messaging/Received.java | 6 +- .../v1_0/type/messaging/Rejected.java | 11 +- .../v1_0/type/messaging/Released.java | 11 +- .../protocol/v1_0/type/messaging/Source.java | 6 +- .../v1_0/type/messaging/StdDistMode.java | 5 +- .../protocol/v1_0/type/messaging/Target.java | 6 +- .../type/messaging/TerminusExpiryPolicy.java | 10 +- .../codec/AmqpSequenceConstructor.java | 4 +- .../codec/AmqpSequenceSectionConstructor.java | 4 +- .../messaging/codec/AmqpValueConstructor.java | 4 +- .../codec/AmqpValueSectionConstructor.java | 4 +- .../ApplicationPropertiesConstructor.java | 4 +- ...plicationPropertiesSectionConstructor.java | 4 +- .../type/messaging/codec/DataConstructor.java | 4 +- .../codec/DataSectionConstructor.java | 4 +- .../codec/DeliveryAnnotationsConstructor.java | 4 +- ...DeliveryAnnotationsSectionConstructor.java | 4 +- .../codec/ExactSubjectFilterConstructor.java | 4 +- .../messaging/codec/FooterConstructor.java | 4 +- .../codec/FooterSectionConstructor.java | 4 +- .../codec/HeaderSectionConstructor.java | 4 +- .../codec/JMSSelectorFilterConstructor.java | 6 +- .../MatchingSubjectFilterConstructor.java | 4 +- .../codec/MessageAnnotationsConstructor.java | 4 +- .../MessageAnnotationsSectionConstructor.java | 4 +- .../codec/NoLocalFilterConstructor.java | 6 +- .../codec/PropertiesSectionConstructor.java | 4 +- .../v1_0/type/security/SaslChallenge.java | 6 +- .../protocol/v1_0/type/security/SaslInit.java | 6 +- .../v1_0/type/security/SaslMechanisms.java | 6 +- .../v1_0/type/security/SaslOutcome.java | 6 +- .../v1_0/type/security/SaslResponse.java | 6 +- .../v1_0/type/transaction/Coordinator.java | 6 +- .../v1_0/type/transaction/Declare.java | 6 +- .../v1_0/type/transaction/Declared.java | 11 +- .../v1_0/type/transaction/Discharge.java | 6 +- .../type/transaction/TransactionError.java | 12 +- .../type/transaction/TransactionalState.java | 6 +- .../v1_0/type/transaction/TxnCapability.java | 17 +- .../v1_0/type/transport/AmqpError.java | 28 ++-- .../protocol/v1_0/type/transport/Attach.java | 5 +- .../protocol/v1_0/type/transport/Begin.java | 5 +- .../protocol/v1_0/type/transport/Close.java | 5 +- .../v1_0/type/transport/ConnectionError.java | 12 +- .../protocol/v1_0/type/transport/Detach.java | 5 +- .../v1_0/type/transport/Disposition.java | 5 +- .../protocol/v1_0/type/transport/End.java | 5 +- .../protocol/v1_0/type/transport/Error.java | 5 +- .../protocol/v1_0/type/transport/Flow.java | 5 +- .../v1_0/type/transport/LinkError.java | 13 +- .../protocol/v1_0/type/transport/Open.java | 5 +- .../v1_0/type/transport/SessionError.java | 11 +- .../v1_0/type/transport/Transfer.java | 5 +- .../MessageConverter_Internal_to_1_0Test.java | 3 +- ...MessageConverter_v1_0_to_InternalTest.java | 23 +-- .../server/protocol/v1_0/Session_1_0Test.java | 3 +- ...nCoordinatorReceivingLinkEndpointTest.java | 9 +- .../qpid/tests/protocol/v1_0/Interaction.java | 11 +- .../tests/protocol/v1_0/DecodeErrorTest.java | 5 +- .../AnonymousTerminusTest.java | 33 ++-- .../bindmapjms/TemporaryDestinationTest.java | 33 ++-- .../bindmapjms/TopicDestinationTest.java | 15 +- .../extensions/management/ManagementTest.java | 6 +- .../soleconn/CloseExistingPolicyTest.java | 28 ++-- .../extensions/soleconn/MixedPolicyTest.java | 23 ++- .../soleconn/RefuseConnectionPolicyTest.java | 32 ++-- .../soleconn/SoleConnectionAsserts.java | 38 ++--- .../v1_0/messaging/DeleteOnCloseTest.java | 10 +- .../protocol/v1_0/messaging/OutcomeTest.java | 6 +- .../protocol/v1_0/messaging/TransferTest.java | 15 +- .../v1_0/transaction/DischargeTest.java | 5 +- .../TransactionalTransferTest.java | 9 +- .../extensions/acl/MessagingACLTest.java | 5 +- .../deliverydelay/DeliveryDelayTest.java | 5 +- 103 files changed, 827 insertions(+), 545 deletions(-) create mode 100644 broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java delete mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/extensions/soleconn/SoleConnectionConnectionProperties.java diff --git a/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/CompositeTypeConstructorGenerator.java b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/CompositeTypeConstructorGenerator.java index 2d76f5a0e9..6ee0eb9d95 100644 --- a/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/CompositeTypeConstructorGenerator.java +++ b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/CompositeTypeConstructorGenerator.java @@ -77,7 +77,6 @@ public class CompositeTypeConstructorGenerator extends AbstractProcessor "org.apache.qpid.server.protocol.v1_0.type.messaging.TerminusExpiryPolicy", "org.apache.qpid.server.protocol.v1_0.type.transaction.TxnCapability"); - @Override public SourceVersion getSupportedSourceVersion() { @@ -98,6 +97,8 @@ public boolean process(final Set annotations, final Round return true; } + SymbolMapper.initialize(processingEnv); + Filer filer = processingEnv.getFiler(); try { @@ -135,6 +136,8 @@ private void generateCompositeTypeConstructor(final Filer filer, final TypeEleme final String compositeTypeConstructorPackage = packageElement.getQualifiedName() + ".codec"; String compositeTypeConstructorName = compositeTypeConstructorPackage + "." + compositeTypeConstructorNameSimpleName; final CompositeType annotation = typeElement.getAnnotation(CompositeType.class); + final String symbol = SymbolMapper.getConstantName(annotation.symbolicDescriptor()); + final boolean isConstant = symbol.startsWith("Symbols."); processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Generating composite constructor file for " + objectQualifiedClassName); @@ -158,8 +161,15 @@ private void generateCompositeTypeConstructor(final Filer filer, final TypeEleme pw.println(); pw.println("import org.apache.qpid.server.protocol.v1_0.codec.AbstractCompositeTypeConstructor;"); pw.println("import org.apache.qpid.server.protocol.v1_0.codec.DescribedTypeConstructorRegistry;"); + if (isConstant) + { + pw.println("import org.apache.qpid.server.protocol.v1_0.constants.Symbols;"); + } pw.println("import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException;"); - pw.println("import org.apache.qpid.server.protocol.v1_0.type.Symbol;"); + if (!isConstant) + { + pw.println("import org.apache.qpid.server.protocol.v1_0.type.Symbol;"); + } pw.println("import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong;"); pw.println("import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError;"); pw.println("import org.apache.qpid.server.protocol.v1_0.type.transport.Error;"); @@ -173,7 +183,7 @@ private void generateCompositeTypeConstructor(final Filer filer, final TypeEleme pw.println(" public static void register(DescribedTypeConstructorRegistry registry)"); pw.println(" {"); - pw.println(" registry.register(Symbol.valueOf(\"" + annotation.symbolicDescriptor() + "\"), INSTANCE);"); + pw.println(" registry.register(%s, INSTANCE);".formatted(symbol)); pw.println(String.format(" registry.register(UnsignedLong.valueOf(%#016x), INSTANCE);", annotation.numericDescriptor())); pw.println(" }"); pw.println(); diff --git a/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java new file mode 100644 index 0000000000..0cb32387ba --- /dev/null +++ b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java @@ -0,0 +1,92 @@ +/* + * 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.server.protocol.v1_0; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +import javax.annotation.processing.ProcessingEnvironment; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.VariableElement; + +public final class SymbolMapper +{ + private SymbolMapper() + { + + } + + private static final String SYMBOL = "org.apache.qpid.server.protocol.v1_0.type.Symbol"; + private static final String SYMBOLS = "org.apache.qpid.server.protocol.v1_0.constants.Symbols"; + private static final String SYMBOL_TEXTS = "org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts"; + private static final Map NAME_MAPPING = new HashMap<>(); + + static void initialize(final ProcessingEnvironment processingEnv) + { + if (!NAME_MAPPING.isEmpty()) + { + return; + } + + final List symbolTextFields = processingEnv.getElementUtils().getTypeElement(SYMBOL_TEXTS) + .getEnclosedElements() + .stream() + .filter(element -> element.getKind() == ElementKind.FIELD) + .map(VariableElement.class::cast) + .toList(); + + final List symbolFields = processingEnv.getElementUtils().getTypeElement(SYMBOLS) + .getEnclosedElements() + .stream() + .filter(element -> element.getKind() == ElementKind.FIELD) + .map(VariableElement.class::cast) + .toList(); + + for (final VariableElement field : symbolFields) + { + if (field.getModifiers().contains(Modifier.STATIC) && SYMBOL.equals(field.asType().toString())) + { + final String name = field.getSimpleName().toString(); + final Optional optSymbolTextField = symbolTextFields.stream() + .filter(element -> element.getSimpleName().toString().equals(name)) + .findFirst(); + if (optSymbolTextField.isPresent() && optSymbolTextField.get().getConstantValue() != null) + { + NAME_MAPPING.put(String.valueOf(optSymbolTextField.get().getConstantValue()), "Symbols.%s".formatted(name)); + } + else + { + throw new RuntimeException("Field name " + name + " exists in Symbols but not in SymbolTexts. " + + "All Symbols field names must have a matching field name in SymbolTexts"); + } + + } + } + } + + static String getConstantName(String symbolText) + { + return NAME_MAPPING.getOrDefault(symbolText, "Symbol.valueOf(\"%s\")".formatted(symbolText)); + } +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0.java index ef5057ea37..d2edbb0a47 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0.java @@ -27,7 +27,6 @@ import org.apache.qpid.server.model.ManagedObject; import org.apache.qpid.server.protocol.v1_0.codec.SectionDecoderRegistry; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.codec.AMQPDescribedTypeRegistry; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy; import org.apache.qpid.server.protocol.v1_0.type.transport.End; @@ -51,9 +50,6 @@ public interface AMQPConnection_1_0> extends AMQ @ManagedContextDefault(name = SEND_SASL_FINAL_CHALLENGE_AS_CHALLENGE) boolean DEFAULT_SEND_SASL_FINAL_CHALLENGE_AS_CHALLENGE = false; - Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY"); - Symbol SHARED_SUBSCRIPTIONS = Symbol.valueOf("SHARED-SUBS"); - @DerivedAttribute(description = "The idle timeout (in milliseconds) for incoming traffic.") long getIncomingIdleTimeout(); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0Impl.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0Impl.java index 3e2c0249fc..d76d4ab1aa 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0Impl.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AMQPConnection_1_0Impl.java @@ -20,8 +20,6 @@ */ package org.apache.qpid.server.protocol.v1_0; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_ENFORCEMENT_POLICY; - import java.net.SocketAddress; import java.security.AccessControlContext; import java.security.AccessControlException; @@ -53,6 +51,7 @@ import org.apache.qpid.server.logging.EventLogger; import org.apache.qpid.server.logging.messages.ResourceLimitMessages; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.security.limit.ConnectionLimitException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -87,7 +86,6 @@ import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedShort; import org.apache.qpid.server.protocol.v1_0.type.codec.AMQPDescribedTypeRegistry; -import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionDetectionPolicy; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicyException; @@ -250,9 +248,9 @@ public class AMQPConnection_1_0Impl extends AbstractAMQPConnection offeredCapabilities = new ArrayList<>(); - offeredCapabilities.add(ANONYMOUS_RELAY); - offeredCapabilities.add(SHARED_SUBSCRIPTIONS); - offeredCapabilities.add(SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER); + offeredCapabilities.add(Symbols.ANONYMOUS_RELAY); + offeredCapabilities.add(Symbols.SHARED_SUBSCRIPTIONS); + offeredCapabilities.add(Symbols.SOLE_CONNECTION_FOR_CONTAINER); setOfferedCapabilities(offeredCapabilities); @@ -857,23 +855,23 @@ public void receiveOpen(final int channel, final Open open) : Collections.unmodifiableMap(new LinkedHashMap<>(open.getProperties())); _remoteDesiredCapabilities = open.getDesiredCapabilities() == null ? Set.of() : Stream.of(open.getDesiredCapabilities()) .collect(Collectors.toSet()); - if (remoteProperties.containsKey(Symbol.valueOf("product"))) + if (remoteProperties.containsKey(Symbols.PRODUCT)) { - setClientProduct(remoteProperties.get(Symbol.valueOf("product")).toString()); + setClientProduct(remoteProperties.get(Symbols.PRODUCT).toString()); } - if (remoteProperties.containsKey(Symbol.valueOf("version"))) + if (remoteProperties.containsKey(Symbols.VERSION)) { - setClientVersion(remoteProperties.get(Symbol.valueOf("version")).toString()); + setClientVersion(remoteProperties.get(Symbols.VERSION).toString()); } setClientId(_remoteContainerId); - if (_remoteDesiredCapabilities.contains(SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER)) + if (_remoteDesiredCapabilities.contains(Symbols.SOLE_CONNECTION_FOR_CONTAINER)) { - if (remoteProperties != null && remoteProperties.containsKey(SOLE_CONNECTION_ENFORCEMENT_POLICY)) + if (remoteProperties != null && remoteProperties.containsKey(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY)) { try { _soleConnectionEnforcementPolicy = SoleConnectionEnforcementPolicy.valueOf(remoteProperties.get( - SOLE_CONNECTION_ENFORCEMENT_POLICY)); + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY)); } catch (IllegalArgumentException e) { @@ -979,10 +977,10 @@ private void handleSoleConnectionEnforcement(final NamedAddressSpace addressSpac if (e.getPolicy() == SoleConnectionEnforcementPolicy.REFUSE_CONNECTION) { LOGGER.debug("Closing newly open connection: {}", e.getMessage()); - _properties.put(Symbol.valueOf("amqp:connection-establishment-failed"), true); + _properties.put(Symbols.AMQP_CONN_ESTABLISHMENT_FAILED, true); final Error error = new Error(AmqpError.INVALID_FIELD, String.format("Connection closed due to sole-connection-enforcement-policy '%s'", e.getPolicy())); - error.setInfo(Map.of(Symbol.valueOf("invalid-field"), Symbol.valueOf("container-id"))); + error.setInfo(Map.of(Symbols.INVALID_FIELD, Symbols.CONTAINER_ID)); closeConnection(error); getEventLogger().message(ResourceLimitMessages.REJECTED( "Opening", "connection", String.format("container '%s'", e.getContainerID()), e.getMessage())); @@ -991,7 +989,7 @@ else if (e.getPolicy() == SoleConnectionEnforcementPolicy.CLOSE_EXISTING) { final Error error = new Error(AmqpError.RESOURCE_LOCKED, String.format("Connection closed due to sole-connection-enforcement-policy '%s'", e.getPolicy())); - error.setInfo(Map.of(Symbol.valueOf("sole-connection-enforcement"), true)); + error.setInfo(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT, true)); final EventLogger logger = getEventLogger(); final List> rescheduleFutures = new ArrayList<>(); @@ -1060,10 +1058,10 @@ private void populateConnectionRedirect(final NamedAddressSpace addressSpace, fi } } final Map infoMap = new HashMap<>(); - infoMap.put(Symbol.valueOf("network-host"), networkHost); + infoMap.put(Symbols.NETWORK_HOST, networkHost); if(port > 0) { - infoMap.put(Symbol.valueOf("port"), UnsignedInteger.valueOf(port)); + infoMap.put(Symbols.PORT, UnsignedInteger.valueOf(port)); } err.setInfo(infoMap); } @@ -1724,15 +1722,15 @@ private void sendOpen(final int channelMax, final int maxFrameSize) } if (_remoteDesiredCapabilities != null - && _remoteDesiredCapabilities.contains(SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER)) + && _remoteDesiredCapabilities.contains(Symbols.SOLE_CONNECTION_FOR_CONTAINER)) { - _properties.put(SoleConnectionConnectionProperties.SOLE_CONNECTION_DETECTION_POLICY, + _properties.put(Symbols.SOLE_CONNECTION_DETECTION_POLICY, SoleConnectionDetectionPolicy.STRONG); } if (_soleConnectionEnforcementPolicy == SoleConnectionEnforcementPolicy.CLOSE_EXISTING) { - _properties.put(SOLE_CONNECTION_ENFORCEMENT_POLICY, SoleConnectionEnforcementPolicy.CLOSE_EXISTING.getValue()); + _properties.put(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, SoleConnectionEnforcementPolicy.CLOSE_EXISTING.getValue()); } open.setProperties(_properties); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AnonymousRelayDestination.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AnonymousRelayDestination.java index fb50ef0e0e..c8e351da10 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AnonymousRelayDestination.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/AnonymousRelayDestination.java @@ -1,4 +1,4 @@ -package org.apache.qpid.server.protocol.v1_0;/* +/* * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -19,7 +19,7 @@ * */ -import static org.apache.qpid.server.protocol.v1_0.Session_1_0.DELAYED_DELIVERY; +package org.apache.qpid.server.protocol.v1_0; import java.util.Arrays; @@ -29,6 +29,7 @@ import org.apache.qpid.server.message.ServerMessage; import org.apache.qpid.server.model.DestinationAddress; import org.apache.qpid.server.model.NamedAddressSpace; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.messaging.Target; import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; @@ -43,20 +44,20 @@ public class AnonymousRelayDestination implements ReceivingDestination private final boolean _discardUnroutable; AnonymousRelayDestination(final NamedAddressSpace addressSpace, - final Target target, - final EventLogger eventLogger) + final Target target, + final EventLogger eventLogger) { _addressSpace = addressSpace; _target = target; _eventLogger = eventLogger; _discardUnroutable = target.getCapabilities() != null && Arrays.asList(target.getCapabilities()) - .contains(DISCARD_UNROUTABLE); + .contains(Symbols.DISCARD_UNROUTABLE); } @Override public Symbol[] getCapabilities() { - return new Symbol[]{DELAYED_DELIVERY}; + return new Symbol[]{Symbols.DELAYED_DELIVERY}; } @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/DeserializationFactories.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/DeserializationFactories.java index d3dcd59d7f..b68a9aa651 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/DeserializationFactories.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/DeserializationFactories.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.DistributionMode; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; @@ -60,7 +61,7 @@ public static Map convertToNodeProperties(final Object value) th "'node-properties' must have only keys of type 'symbol' but got '%s'", key.getClass().getSimpleName())); } - if (Session_1_0.LIFETIME_POLICY.equals(key)) + if (Symbols.LIFETIME_POLICY.equals(key)) { final Object lifetimePolicy = entry.getValue(); if (!(lifetimePolicy instanceof LifetimePolicy)) @@ -72,7 +73,7 @@ public static Map convertToNodeProperties(final Object value) th } nodeProperties.put((Symbol) key, lifetimePolicy); } - else if (Symbol.valueOf("supported-dist-modes").equals(key)) + else if (Symbols.SUPPORTED_DIST_MODES.equals(key)) { final Object distributionMode = entry.getValue(); final DistributionMode[] converted; diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeSendingDestination.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeSendingDestination.java index 8f84530c6f..962ff09b6f 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeSendingDestination.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ExchangeSendingDestination.java @@ -20,9 +20,6 @@ */ package org.apache.qpid.server.protocol.v1_0; -import static org.apache.qpid.server.protocol.v1_0.Session_1_0.GLOBAL_CAPABILITY; -import static org.apache.qpid.server.protocol.v1_0.Session_1_0.SHARED_CAPABILITY; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -41,6 +38,7 @@ import org.apache.qpid.server.model.LifetimePolicy; import org.apache.qpid.server.model.NotFoundException; import org.apache.qpid.server.model.Queue; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -103,13 +101,13 @@ private ExchangeSendingDestination(final Exchange exchange, _filters = bindingInfo.getActualFilters().isEmpty() ? null : bindingInfo.getActualFilters(); List sourceCapabilities = new ArrayList<>(); - if (hasCapability(capabilities, GLOBAL_CAPABILITY)) + if (hasCapability(capabilities, Symbols.GLOBAL_CAPABILITY)) { - sourceCapabilities.add(GLOBAL_CAPABILITY); + sourceCapabilities.add(Symbols.GLOBAL_CAPABILITY); } - if (hasCapability(capabilities, SHARED_CAPABILITY)) + if (hasCapability(capabilities, Symbols.SHARED_CAPABILITY)) { - sourceCapabilities.add(SHARED_CAPABILITY); + sourceCapabilities.add(Symbols.SHARED_CAPABILITY); } sourceCapabilities.add(TOPIC_CAPABILITY); @@ -131,8 +129,8 @@ private static String getMangledSubscriptionName(final String linkName, final Source source) { boolean isDurable = source.getExpiryPolicy() == TerminusExpiryPolicy.NEVER; - boolean isShared = hasCapability(source.getCapabilities(), SHARED_CAPABILITY); - boolean isGlobal = hasCapability(source.getCapabilities(), GLOBAL_CAPABILITY); + boolean isShared = hasCapability(source.getCapabilities(), Symbols.SHARED_CAPABILITY); + boolean isGlobal = hasCapability(source.getCapabilities(), Symbols.GLOBAL_CAPABILITY); return getMangledSubscriptionName(linkName, isDurable, isShared, isGlobal, remoteContainerId); @@ -143,7 +141,7 @@ private static Queue getQueue(Exchange exchange, Source source, String sub throws AmqpErrorException { boolean isDurable = source.getExpiryPolicy() == TerminusExpiryPolicy.NEVER; - boolean isShared = hasCapability(source.getCapabilities(), SHARED_CAPABILITY); + boolean isShared = hasCapability(source.getCapabilities(), Symbols.SHARED_CAPABILITY); QueueManagingVirtualHost virtualHost; if (exchange.getAddressSpace() instanceof QueueManagingVirtualHost) @@ -364,7 +362,7 @@ else if (!hasMessageFilter Error error = new Error(); error.setCondition(AmqpError.INVALID_FIELD); error.setDescription("Invalid JMS Selector: " + selectorFilter.getValue()); - error.setInfo(Collections.singletonMap(Symbol.valueOf("field"), Symbol.valueOf("filter"))); + error.setInfo(Collections.singletonMap(Symbols.FIELD, Symbols.FILTER)); throw new AmqpErrorException(error); } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/JmsMessageTypeAnnotation.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/JmsMessageTypeAnnotation.java index 46cfbe5b50..14ae61a3fa 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/JmsMessageTypeAnnotation.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/JmsMessageTypeAnnotation.java @@ -20,8 +20,6 @@ */ package org.apache.qpid.server.protocol.v1_0; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; - public enum JmsMessageTypeAnnotation { MESSAGE((byte) 0), @@ -31,7 +29,6 @@ public enum JmsMessageTypeAnnotation STREAM_MESSAGE((byte) 4), TEXT_MESSAGE((byte) 5); - public static final Symbol ANNOTATION_KEY = Symbol.valueOf("x-opt-jms-msg-type"); private final byte _type; JmsMessageTypeAnnotation(byte value) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_v1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_v1_0.java index 4fd015c2e8..b907f975b8 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_v1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_v1_0.java @@ -42,6 +42,7 @@ import org.apache.qpid.server.message.internal.InternalMessage; import org.apache.qpid.server.plugin.PluggableService; import org.apache.qpid.server.protocol.converter.MessageConversionException; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.messaging.SectionEncoder; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -183,8 +184,7 @@ else if (originalMessageBody == null && mimeType == null) if (contentTypeAnnotationValue != null) { - return new MessageAnnotations(Collections.singletonMap(Symbol.valueOf("x-opt-jms-msg-type"), - contentTypeAnnotationValue)); + return new MessageAnnotations(Collections.singletonMap(Symbols.ANNOTATION_KEY, contentTypeAnnotationValue)); } else { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_from_1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_from_1_0.java index 93ab0c32d4..abb2c80795 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_from_1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_from_1_0.java @@ -40,6 +40,7 @@ import org.apache.qpid.server.message.mimecontentconverter.ConversionUtils; import org.apache.qpid.server.message.mimecontentconverter.ObjectToMimeContentConverter; import org.apache.qpid.server.protocol.converter.MessageConversionException; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoderImpl; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.Binary; @@ -322,9 +323,9 @@ static JmsMessageTypeAnnotation getJmsMessageTypeAnnotation(final Message_1_0 se { Map annotations = section.getValue(); section.dispose(); - if (annotations != null && annotations.containsKey(JmsMessageTypeAnnotation.ANNOTATION_KEY)) + if (annotations != null && annotations.containsKey(Symbols.ANNOTATION_KEY)) { - Object object = annotations.get(JmsMessageTypeAnnotation.ANNOTATION_KEY); + Object object = annotations.get(Symbols.ANNOTATION_KEY); if (object instanceof Byte) { try diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java index a9914c4a31..39eb7e711a 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_to_1_0.java @@ -50,6 +50,7 @@ import org.apache.qpid.server.message.mimecontentconverter.MimeContentToObjectConverter; import org.apache.qpid.server.model.NamedAddressSpace; import org.apache.qpid.server.plugin.MessageConverter; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.messaging.SectionEncoder; import org.apache.qpid.server.protocol.v1_0.messaging.SectionEncoderImpl; import org.apache.qpid.server.protocol.v1_0.type.Binary; @@ -86,7 +87,7 @@ public static Symbol getContentType(final String contentMimeType) } else if (BYTES_MESSAGE_CONTENT_TYPES.matcher(contentMimeType).matches()) { - contentType = Symbol.valueOf("application/octet-stream"); + contentType = Symbols.APP_OCTET_STREAM; } else if (MAP_MESSAGE_CONTENT_TYPES.matcher(contentMimeType).matches()) { @@ -98,7 +99,7 @@ else if (LIST_MESSAGE_CONTENT_TYPES.matcher(contentMimeType).matches()) } else if (OBJECT_MESSAGE_CONTENT_TYPES.matcher(contentMimeType).matches()) { - contentType = Symbol.valueOf("application/x-java-serialized-object"); + contentType = Symbols.APP_X_JAVA_SERIALIZED_OBJ; } else { @@ -112,7 +113,7 @@ public static MessageAnnotations createMessageAnnotation(final EncodingRetaining final String contentMimeType) { MessageAnnotations messageAnnotations = null; - final Symbol key = Symbol.valueOf("x-opt-jms-msg-type"); + final Symbol key = Symbols.ANNOTATION_KEY; if (contentMimeType != null) { if (TEXT_CONTENT_TYPES.matcher(contentMimeType).matches()) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java index d1ea39ae2f..909666cfe1 100755 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/MessageMetaData_1_0.java @@ -36,11 +36,11 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.message.AMQMessageHeader; import org.apache.qpid.server.plugin.MessageMetaDataType; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoder; import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoderImpl; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.Binary; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.codec.AMQPDescribedTypeRegistry; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpSequenceSection; @@ -66,10 +66,6 @@ public class MessageMetaData_1_0 implements StorableMessageMetaData private final long _contentSize; - // TODO move to somewhere more useful - private static final Symbol DELIVERY_TIME = Symbol.valueOf("x-opt-delivery-time"); - private static final Symbol NOT_VALID_BEFORE = Symbol.valueOf("x-qpid-not-valid-before"); - private HeaderSection _headerSection; private PropertiesSection _propertiesSection; private DeliveryAnnotationsSection _deliveryAnnotationsSection; @@ -577,12 +573,12 @@ public long getNotValidBefore() Object annotation; if (_messageAnnotationsSection != null && (annotation = - _messageAnnotationsSection.getValue().get(DELIVERY_TIME)) instanceof Number) + _messageAnnotationsSection.getValue().get(Symbols.DELIVERY_TIME)) instanceof Number) { notValidBefore = ((Number) annotation).longValue(); } else if (_messageAnnotationsSection != null && (annotation = - _messageAnnotationsSection.getValue().get(NOT_VALID_BEFORE)) instanceof Number) + _messageAnnotationsSection.getValue().get(Symbols.NOT_VALID_BEFORE)) instanceof Number) { notValidBefore = ((Number) annotation).longValue(); } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/NodeReceivingDestination.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/NodeReceivingDestination.java index 3727094b8d..03e1d54e04 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/NodeReceivingDestination.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/NodeReceivingDestination.java @@ -20,8 +20,6 @@ */ package org.apache.qpid.server.protocol.v1_0; -import static org.apache.qpid.server.protocol.v1_0.Session_1_0.DELAYED_DELIVERY; - import java.util.Arrays; import java.util.Map; @@ -34,6 +32,7 @@ import org.apache.qpid.server.message.ServerMessage; import org.apache.qpid.server.model.DestinationAddress; import org.apache.qpid.server.model.Exchange; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.messaging.TerminusDurability; import org.apache.qpid.server.protocol.v1_0.type.messaging.TerminusExpiryPolicy; @@ -68,7 +67,7 @@ public NodeReceivingDestination(final DestinationAddress destinationAddress, if (_destination instanceof Exchange) { - _discardUnroutable = ((capabilities != null && Arrays.asList(capabilities).contains(DISCARD_UNROUTABLE)) + _discardUnroutable = ((capabilities != null && Arrays.asList(capabilities).contains(Symbols.DISCARD_UNROUTABLE)) || ((Exchange)_destination).getUnroutableMessageBehaviour() == Exchange.UnroutableMessageBehaviour.DISCARD); _routingAddress = destinationAddress.getRoutingKey(); _address = _destination.getName(); @@ -205,8 +204,8 @@ public MessageDestination getDestination() public Symbol[] getCapabilities() { Symbol[] capabilities = new Symbol[2]; - capabilities[0] = _discardUnroutable ? DISCARD_UNROUTABLE : REJECT_UNROUTABLE; - capabilities[1] = DELAYED_DELIVERY; + capabilities[0] = _discardUnroutable ? Symbols.DISCARD_UNROUTABLE : Symbols.REJECT_UNROUTABLE; + capabilities[1] = Symbols.DELAYED_DELIVERY; return capabilities; } } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ReceivingDestination.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ReceivingDestination.java index 5c746bec0f..eba993b6ba 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ReceivingDestination.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/ReceivingDestination.java @@ -28,9 +28,6 @@ public interface ReceivingDestination { - Symbol REJECT_UNROUTABLE = Symbol.valueOf("REJECT_UNROUTABLE"); - Symbol DISCARD_UNROUTABLE = Symbol.valueOf("DISCARD_UNROUTABLE"); - Symbol[] getCapabilities(); void send(final ServerMessage message, diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java index f5080a3bc6..4a26972eae 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/SendingLinkEndpoint.java @@ -49,6 +49,7 @@ import org.apache.qpid.server.model.NamedAddressSpace; import org.apache.qpid.server.model.NotFoundException; import org.apache.qpid.server.model.Queue; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; @@ -59,7 +60,6 @@ import org.apache.qpid.server.protocol.v1_0.type.messaging.Filter; import org.apache.qpid.server.protocol.v1_0.type.messaging.Modified; import org.apache.qpid.server.protocol.v1_0.type.messaging.NoLocalFilter; -import org.apache.qpid.server.protocol.v1_0.type.messaging.Rejected; import org.apache.qpid.server.protocol.v1_0.type.messaging.Released; import org.apache.qpid.server.protocol.v1_0.type.messaging.Source; import org.apache.qpid.server.protocol.v1_0.type.messaging.StdDistMode; @@ -87,7 +87,6 @@ public class SendingLinkEndpoint extends AbstractLinkEndpoint implements AsyncAutoCommitTransaction.FutureRecorder { private static final Logger LOGGER = LoggerFactory.getLogger(SendingLinkEndpoint.class); - private static final Symbol PRIORITY = Symbol.valueOf("priority"); private static final Pattern ANY_CONTAINER_ID = Pattern.compile(".*"); private final List _resumeAcceptedTransfers = new ArrayList<>(); @@ -113,7 +112,7 @@ public SendingLinkEndpoint(final Session_1_0 session, final LinkImpl initProperties(final Attach attach) if(peerProperties != null) { Map actualProperties = new HashMap<>(); - if(peerProperties.containsKey(PRIORITY)) + if(peerProperties.containsKey(Symbols.PRIORITY)) { - Object value = peerProperties.get(PRIORITY); + Object value = peerProperties.get(Symbols.PRIORITY); if(value instanceof Number) { _priority = ((Number)value).intValue(); @@ -292,7 +291,7 @@ else if(value instanceof String) } if(_priority != null) { - actualProperties.put(PRIORITY, _priority); + actualProperties.put(Symbols.PRIORITY, _priority); } } return actualProperties; @@ -384,8 +383,8 @@ protected void recoverLink(final Attach attach) throws AmqpErrorException if (source == null && attach.getDesiredCapabilities() != null) { List capabilities = Arrays.asList(attach.getDesiredCapabilities()); - if (capabilities.contains(Session_1_0.GLOBAL_CAPABILITY) - && capabilities.contains(Session_1_0.SHARED_CAPABILITY) + if (capabilities.contains(Symbols.GLOBAL_CAPABILITY) + && capabilities.contains(Symbols.SHARED_CAPABILITY) && getLinkName().endsWith("|global")) { final NamedAddressSpace namedAddressSpace = getSession().getConnection().getAddressSpace(); @@ -467,7 +466,7 @@ public void receiveFlow(final Flow flow) Map properties = flow.getProperties(); if (properties != null) { - final Binary transactionId = (Binary) properties.get(Symbol.valueOf("txn-id")); + final Binary transactionId = (Binary) properties.get(Symbols.TXN_ID); if (transactionId != null) { try @@ -668,16 +667,16 @@ public void attachReceived(final Attach attach) throws AmqpErrorException final Modified defaultOutcome = new Modified(); defaultOutcome.setDeliveryFailed(true); source.setDefaultOutcome(defaultOutcome); - source.setOutcomes(Accepted.ACCEPTED_SYMBOL, Released.RELEASED_SYMBOL, Rejected.REJECTED_SYMBOL); + source.setOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_RELEASED, Symbols.AMQP_REJECTED); source.setAddress(attachSource.getAddress()); source.setDynamic(attachSource.getDynamic()); if (Boolean.TRUE.equals(attachSource.getDynamic()) && attachSource.getDynamicNodeProperties() != null) { Map dynamicNodeProperties = new HashMap<>(); - if (attachSource.getDynamicNodeProperties().containsKey(Session_1_0.LIFETIME_POLICY)) + if (attachSource.getDynamicNodeProperties().containsKey(Symbols.LIFETIME_POLICY)) { - dynamicNodeProperties.put(Session_1_0.LIFETIME_POLICY, - attachSource.getDynamicNodeProperties().get(Session_1_0.LIFETIME_POLICY)); + dynamicNodeProperties.put(Symbols.LIFETIME_POLICY, + attachSource.getDynamicNodeProperties().get(Symbols.LIFETIME_POLICY)); } source.setDynamicNodeProperties(dynamicNodeProperties); } @@ -853,10 +852,10 @@ protected void detach(Error error, final boolean close) TerminusDurability sourceDurability = source.getDurable(); if (sourceDurability != null && !TerminusDurability.NONE.equals(sourceDurability) - && sourceCapabilities.contains(Session_1_0.SHARED_CAPABILITY) + && sourceCapabilities.contains(Symbols.SHARED_CAPABILITY) && sourceCapabilities.contains(ExchangeSendingDestination.TOPIC_CAPABILITY)) { - final Pattern containerIdPattern = sourceCapabilities.contains(Session_1_0.GLOBAL_CAPABILITY) + final Pattern containerIdPattern = sourceCapabilities.contains(Symbols.GLOBAL_CAPABILITY) ? ANY_CONTAINER_ID : Pattern.compile("^" + Pattern.quote(getSession().getConnection().getRemoteContainerId()) + "$"); final Pattern linkNamePattern = Pattern.compile("^" + Pattern.quote(getLinkName()) + "\\|?\\d*$"); @@ -879,7 +878,7 @@ protected void detach(Error error, final boolean close) catch (IllegalStateException e) { String message; - if(sourceCapabilities.contains(Session_1_0.SHARED_CAPABILITY) + if(sourceCapabilities.contains(Symbols.SHARED_CAPABILITY) && sourceCapabilities.contains(ExchangeSendingDestination.TOPIC_CAPABILITY)) { String subscriptionName = getLinkName(); @@ -912,8 +911,8 @@ protected void detach(Error error, final boolean close) } else if (addressSpace instanceof QueueManagingVirtualHost && ((QueueManagingVirtualHost) addressSpace).isDiscardGlobalSharedSubscriptionLinksOnDetach() - && sourceCapabilities.contains(Session_1_0.SHARED_CAPABILITY) - && sourceCapabilities.contains(Session_1_0.GLOBAL_CAPABILITY) + && sourceCapabilities.contains(Symbols.SHARED_CAPABILITY) + && sourceCapabilities.contains(Symbols.GLOBAL_CAPABILITY) && sourceCapabilities.contains(ExchangeSendingDestination.TOPIC_CAPABILITY) && !getLinkName().endsWith("|global")) { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java index 1602b6d65b..d582c0d2af 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/Session_1_0.java @@ -62,6 +62,7 @@ import org.apache.qpid.server.model.ExclusivityPolicy; import org.apache.qpid.server.model.NamedAddressSpace; import org.apache.qpid.server.model.Queue; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.delivery.DeliveryRegistry; import org.apache.qpid.server.protocol.v1_0.delivery.DeliveryRegistryImpl; import org.apache.qpid.server.protocol.v1_0.delivery.UnsettledDelivery; @@ -108,11 +109,7 @@ public class Session_1_0 extends AbstractAMQPSession implements LogSubject, org.apache.qpid.server.util.Deletable { - static final Symbol DELAYED_DELIVERY = Symbol.valueOf("DELAYED_DELIVERY"); - static final Symbol SHARED_CAPABILITY = Symbol.getSymbol("shared"); - static final Symbol GLOBAL_CAPABILITY = Symbol.getSymbol("global"); private static final Logger LOGGER = LoggerFactory.getLogger(Session_1_0.class); - public static final Symbol LIFETIME_POLICY = Symbol.valueOf("lifetime-policy"); private static final EnumSet END_STATES = EnumSet.of(SessionState.END_RECVD, SessionState.END_PIPE, SessionState.END_SENT, SessionState.ENDED); @@ -868,8 +865,7 @@ private MessageSource createDynamicSource(final Link_1_0 link, if (terminus.getCapabilities() != null) { final Set capabilities = Stream.of(terminus.getCapabilities()).collect(Collectors.toSet()); - if (capabilities.contains(Symbol.valueOf("temporary-queue")) - || capabilities.contains(Symbol.valueOf("temporary-topic"))) + if (capabilities.contains(Symbols.TEMPORARY_QUEUE) || capabilities.contains(Symbols.TEMPORARY_TOPIC)) { attributes.put(Queue.EXCLUSIVE, ExclusivityPolicy.CONNECTION); } @@ -894,7 +890,7 @@ private MessageDestination createDynamicDestination(final Link_1_0 link, { final Symbol[] capabilities = terminus.getCapabilities(); final Set capabilitySet = capabilities == null ? Set.of() : Stream.of(capabilities).collect(Collectors.toSet()); - boolean isTopic = capabilitySet.contains(Symbol.valueOf("temporary-topic")) || capabilitySet.contains(Symbol.valueOf("topic")); + boolean isTopic = capabilitySet.contains(Symbols.TEMPORARY_TOPIC) || capabilitySet.contains(Symbols.TOPIC); final String destName = (isTopic ? "TempTopic" : "TempQueue") + UUID.randomUUID(); try { @@ -906,7 +902,7 @@ private MessageDestination createDynamicDestination(final Link_1_0 link, { attributes.put(Exchange.TYPE, ExchangeDefaults.FANOUT_EXCHANGE_CLASS); } - else if (capabilitySet.contains(Symbol.valueOf("temporary-queue"))) + else if (capabilitySet.contains(Symbols.TEMPORARY_QUEUE)) { attributes.put(Queue.EXCLUSIVE, ExclusivityPolicy.CONNECTION); } @@ -935,7 +931,7 @@ private Map createDynamicNodeAttributes(final Link_1_0 lin final TerminusExpiryPolicy expiryPolicy = terminus.getExpiryPolicy(); LifetimePolicy lifetimePolicy = properties == null ? null - : (LifetimePolicy) properties.get(LIFETIME_POLICY); + : (LifetimePolicy) properties.get(Symbols.LIFETIME_POLICY); Map attributes = new HashMap<>(); attributes.put(ConfiguredObject.ID, UUID.randomUUID()); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/StandardReceivingLinkEndpoint.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/StandardReceivingLinkEndpoint.java index 1ceb1dd7e1..4a019c203e 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/StandardReceivingLinkEndpoint.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/StandardReceivingLinkEndpoint.java @@ -49,6 +49,7 @@ import org.apache.qpid.server.model.PublishingLink; import org.apache.qpid.server.plugin.MessageFormat; import org.apache.qpid.server.protocol.MessageFormatRegistry; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorRuntimeException; import org.apache.qpid.server.protocol.v1_0.type.Binary; @@ -80,7 +81,6 @@ public class StandardReceivingLinkEndpoint extends AbstractReceivingLinkEndpoint implements AsyncAutoCommitTransaction.FutureRecorder { private static final Logger LOGGER = LoggerFactory.getLogger(StandardReceivingLinkEndpoint.class); - private static final Symbol DELIVERY_TAG = Symbol.valueOf("delivery-tag"); private static final Accepted ACCEPTED = new Accepted(); private static final String LINK = "link"; @@ -309,7 +309,7 @@ public void onRollback() String targetAddress = getTarget().getAddress(); if (targetAddress == null || "".equals(targetAddress.trim())) { - error.setInfo(Collections.singletonMap(DELIVERY_TAG, delivery.getDeliveryTag())); + error.setInfo(Collections.singletonMap(Symbols.DELIVERY_TAG, delivery.getDeliveryTag())); } if (!_rejectedOutcomeSupportedBySource || (delivery.isSettled() && !(transaction instanceof LocalTransaction))) @@ -449,10 +449,10 @@ public void attachReceived(final Attach attach) throws AmqpErrorException if (Boolean.TRUE.equals(attachTarget.getDynamic()) && attachTarget.getDynamicNodeProperties() != null) { Map dynamicNodeProperties = new HashMap<>(); - if (attachTarget.getDynamicNodeProperties().containsKey(Session_1_0.LIFETIME_POLICY)) + if (attachTarget.getDynamicNodeProperties().containsKey(Symbols.LIFETIME_POLICY)) { - dynamicNodeProperties.put(Session_1_0.LIFETIME_POLICY, - attachTarget.getDynamicNodeProperties().get(Session_1_0.LIFETIME_POLICY)); + dynamicNodeProperties.put(Symbols.LIFETIME_POLICY, + attachTarget.getDynamicNodeProperties().get(Symbols.LIFETIME_POLICY)); } target.setDynamicNodeProperties(dynamicNodeProperties); } @@ -462,17 +462,17 @@ public void attachReceived(final Attach attach) throws AmqpErrorException if (attachTarget.getCapabilities() != null) { final List desiredCapabilities = Arrays.asList(attachTarget.getCapabilities()); - if (desiredCapabilities.contains(Symbol.valueOf("temporary-topic"))) + if (desiredCapabilities.contains(Symbols.TEMPORARY_TOPIC)) { - targetCapabilities.add(Symbol.valueOf("temporary-topic")); + targetCapabilities.add(Symbols.TEMPORARY_TOPIC); } - if (desiredCapabilities.contains(Symbol.valueOf("temporary-queue"))) + if (desiredCapabilities.contains(Symbols.TEMPORARY_QUEUE)) { - targetCapabilities.add(Symbol.valueOf("temporary-queue")); + targetCapabilities.add(Symbols.TEMPORARY_QUEUE); } - if (desiredCapabilities.contains(Symbol.valueOf("topic"))) + if (desiredCapabilities.contains(Symbols.TOPIC)) { - targetCapabilities.add(Symbol.valueOf("topic")); + targetCapabilities.add(Symbols.TOPIC); } target.setCapabilities(targetCapabilities.toArray(new Symbol[targetCapabilities.size()])); } @@ -501,7 +501,7 @@ public void attachReceived(final Attach attach) throws AmqpErrorException } getLink().setTermini(source, target); _rejectedOutcomeSupportedBySource = - source.getOutcomes() != null && Arrays.asList(source.getOutcomes()).contains(Rejected.REJECTED_SYMBOL); + source.getOutcomes() != null && Arrays.asList(source.getOutcomes()).contains(Symbols.AMQP_REJECTED); } public ReceivingDestination getReceivingDestination() diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpoint.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpoint.java index c87b00a389..19d88ee167 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpoint.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpoint.java @@ -29,6 +29,7 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.model.Session; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; @@ -121,7 +122,7 @@ else if (command instanceof Discharge) { outcome = new Accepted(); } - else if (CollectionUtils.nullSafeList(getSource().getOutcomes()).contains(Rejected.REJECTED_SYMBOL)) + else if (CollectionUtils.nullSafeList(getSource().getOutcomes()).contains(Symbols.AMQP_REJECTED)) { final Rejected rejected = new Rejected(); rejected.setError(error); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java new file mode 100644 index 0000000000..63750c77ea --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java @@ -0,0 +1,158 @@ +/* + * 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.server.protocol.v1_0.constants; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +/** + * Utility class to store constant {@link Symbol} texts. + * + * Please note that this class contain the string definitions for {@link Symbols} class and field names in + * {@link Symbols} must match the field names in {@link SymbolTexts}, otherwise the annotation processot in broker-codegen + * module will throw an exception during the compilation + */ +public final class SymbolTexts +{ + private SymbolTexts() + { + + } + + public static final String AMQP_ACCEPTED = "amqp:accepted:list"; + public static final String AMQP_APPLICATION_PROPERTIES = "amqp:application-properties:map"; + public static final String AMQP_ATTACH = "amqp:attach:list"; + public static final String AMQP_BEGIN = "amqp:begin:list"; + public static final String AMQP_CLOSE = "amqp:close:list"; + public static final String AMQP_CONN_ESTABLISHMENT_FAILED = "amqp:connection-establishment-failed"; + public static final String AMQP_CONN_FORCED = "amqp:connection:forced"; + public static final String AMQP_CONN_FRAMING_ERROR = "amqp:connection:framing-error"; + public static final String AMQP_CONN_REDIRECT = "amqp:connection:redirect"; + public static final String AMQP_CONN_SOCKET_ERROR = "amqp:connection:socket-error"; + public static final String AMQP_DATA = "amqp:data:binary"; + public static final String AMQP_DELETE_ON_CLOSE = "amqp:delete-on-close:list"; + public static final String AMQP_DELETE_ON_NO_LINKS = "amqp:delete-on-no-links:list"; + public static final String AMQP_DELETE_ON_NO_LINKS_OR_MSGS = "amqp:delete-on-no-links-or-messages:list"; + public static final String AMQP_DELETE_ON_NO_MSGS = "amqp:delete-on-no-messages:list"; + public static final String AMQP_DETACH = "amqp:detach:list"; + public static final String AMQP_DELIVERY_ANNOTATIONS = "amqp:delivery-annotations:map"; + public static final String AMQP_DISPOSITION = "amqp:disposition:list"; + public static final String AMQP_DISTRIBUTED_TXN = "amqp:distributed-transactions"; + public static final String AMQP_END = "amqp:end:list"; + public static final String AMQP_ERROR = "amqp:error:list"; + public static final String AMQP_ERR_DECODE = "amqp:decode-error"; + public static final String AMQP_ERR_FRAME_SIZE_TOO_SMALL = "amqp:frame-size-too-small"; + public static final String AMQP_ERR_ILLEGAL_STATE = "amqp:illegal-state"; + public static final String AMQP_ERR_INTERNAL = "amqp:internal-error"; + public static final String AMQP_ERR_INVALID_FIELD = "amqp:invalid-field"; + public static final String AMQP_ERR_NOT_ALLOWED = "amqp:not-allowed"; + public static final String AMQP_ERR_NOT_AUTHORIZED = "amqp:unauthorized-access"; + public static final String AMQP_ERR_NOT_FOUND = "amqp:not-found"; + public static final String AMQP_ERR_NOT_IMPLEMENTED = "amqp:not-implemented"; + public static final String AMQP_ERR_PRECONDITION_FAILED = "amqp:precondition-failed"; + public static final String AMQP_ERR_RESOURCE_DELETED = "amqp:resource-deleted"; + public static final String AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = "amqp:resource-limit-exceeded"; + public static final String AMQP_ERR_RESOURCE_LOCKED = "amqp:resource-locked"; + public static final String AMQP_FLOW = "amqp:flow:list"; + public static final String AMQP_FOOTER = "amqp:footer:map"; + public static final String AMQP_HEADER = "amqp:header:list"; + public static final String AMQP_LINK_DETACH_FORCED = "amqp:link:detach-forced"; + public static final String AMQP_LINK_MSG_SIZE_EXCEEDED = "amqp:link:message-size-exceeded"; + public static final String AMQP_LINK_REDIRECT = "amqp:link:redirect"; + public static final String AMQP_LINK_STOLEN = "amqp:link:stolen"; + public static final String AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = "amqp:link:transfer-limit-exceeded"; + public static final String AMQP_LOCAL_TXN = "amqp:local-transactions"; + public static final String AMQP_MESSAGE_ANNOTATIONS = "amqp:message-annotations:map"; + public static final String AMQP_MODIFIED = "amqp:modified:list"; + public static final String AMQP_MULTI_SESSIONS_PER_TXN = "amqp:multi-ssns-per-txn"; + public static final String AMQP_MULTI_TXN_PER_SESSION = "amqp:multi-txns-per-ssn"; + public static final String AMQP_OPEN = "amqp:open:list"; + public static final String AMQP_PROMOTABLE_TXN = "amqp:promotable-transactions"; + public static final String AMQP_PROPERTIES = "amqp:properties:list"; + public static final String AMQP_RECEIVED = "amqp:received:list"; + public static final String AMQP_REJECTED = "amqp:rejected:list"; + public static final String AMQP_RELEASED = "amqp:released:list"; + public static final String AMQP_SASL_CHALLENGE = "amqp:sasl-challenge:list"; + public static final String AMQP_SASL_INIT = "amqp:sasl-init:list"; + public static final String AMQP_SASL_MECHANISMS = "amqp:sasl-mechanisms:list"; + public static final String AMQP_SASL_OUTCOME = "amqp:sasl-outcome:list"; + public static final String AMQP_SASL_RESPONSE = "amqp:sasl-response:list"; + public static final String AMQP_SEQUENCE = "amqp:amqp-sequence:list"; + public static final String AMQP_SESSION_ERRANT_LINK = "amqp:session:errant-link"; + public static final String AMQP_SESSION_HANDLE_IN_USE = "amqp:session:handle-in-use"; + public static final String AMQP_SESSION_UNATTACHED_HANDLE = "amqp:session:unattached-handle"; + public static final String AMQP_SESSION_WINDOW_VIOLATION = "amqp:session:window-violation"; + public static final String AMQP_SOURCE = "amqp:source:list"; + public static final String AMQP_TARGET = "amqp:target:list"; + public static final String AMQP_TRANSFER = "amqp:transfer:list"; + public static final String AMQP_TXN_COORDINATOR = "amqp:coordinator:list"; + public static final String AMQP_TXN_DECLARE = "amqp:declare:list"; + public static final String AMQP_TXN_DECLARED = "amqp:declared:list"; + public static final String AMQP_TXN_DISCHARGE = "amqp:discharge:list"; + public static final String AMQP_TXN_ROLLBACK = "amqp:transaction:rollback"; + public static final String AMQP_TXN_STATE = "amqp:transactional-state:list"; + public static final String AMQP_TXN_TIMEOUT = "amqp:transaction:timeout"; + public static final String AMQP_TXN_UNKNOWN_ID = "amqp:transaction:unknown-id"; + public static final String AMQP_VALUE = "amqp:amqp-value:*"; + public static final String ANONYMOUS_RELAY = "ANONYMOUS-RELAY"; + public static final String ANNOTATION_KEY = "x-opt-jms-msg-type"; + public static final String APACHE_LEGACY_DIRECT_BINDING = "apache.org:legacy-amqp-direct-binding:string"; + public static final String APACHE_LEGACY_NO_LOCAL_FILTER = "apache.org:jms-no-local-filter:list"; + public static final String APACHE_LEGACY_SELECTOR_FILTER = "apache.org:jms-selector-filter:string"; + public static final String APACHE_LEGACY_TOPIC_BINDING = "apache.org:legacy-amqp-topic-binding:string"; + public static final String APACHE_NO_LOCAL_FILTER = "apache.org:no-local-filter:list"; + public static final String APACHE_SELECTOR_FILTER = "apache.org:selector-filter:string"; + public static final String APP_OCTET_STREAM = "application/octet-stream"; + public static final String APP_X_JAVA_SERIALIZED_OBJ = "application/x-java-serialized-object"; + public static final String CONNECTION_CLOSE = "connection-close"; + public static final String CONTAINER_ID = "container-id"; + public static final String COPY = "copy"; + public static final String DELAYED_DELIVERY = "DELAYED_DELIVERY"; + public static final String DELIVERY_TAG = "delivery-tag"; + public static final String DELIVERY_TIME = "x-opt-delivery-time"; + public static final String DISCARD_UNROUTABLE = "DISCARD_UNROUTABLE"; + public static final String FIELD = "field"; + public static final String FILTER = "filter"; + public static final String GLOBAL_CAPABILITY = "global"; + public static final String INVALID_FIELD = "invalid-field"; + public static final String LIFETIME_POLICY = "lifetime-policy"; + public static final String LINK_DETACH = "link-detach"; + public static final String MOVE = "move"; + public static final String NETWORK_HOST = "network-host"; + public static final String NEVER = "never"; + public static final String NOT_VALID_BEFORE = "x-qpid-not-valid-before"; + public static final String PRIORITY = "priority"; + public static final String PORT = "port"; + public static final String PRODUCT = "product"; + public static final String REJECT_UNROUTABLE = "REJECT_UNROUTABLE"; + public static final String SHARED_CAPABILITY = "shared"; + public static final String SESSION_END = "session-end"; + public static final String SHARED_SUBSCRIPTIONS = "SHARED-SUBS"; + public static final String SOLE_CONNECTION_ENFORCEMENT = "sole-connection-enforcement"; + public static final String SOLE_CONNECTION_ENFORCEMENT_POLICY = "sole-connection-enforcement-policy"; + public static final String SOLE_CONNECTION_DETECTION_POLICY = "sole-connection-detection-policy"; + public static final String SOLE_CONNECTION_FOR_CONTAINER = "sole-connection-for-container"; + public static final String SUPPORTED_DIST_MODES = "supported-dist-modes"; + public static final String TEMPORARY_QUEUE = "temporary-queue"; + public static final String TEMPORARY_TOPIC = "temporary-topic"; + public static final String TOPIC = "topic"; + public static final String TXN_ID = "txn-id"; + public static final String VERSION = "version"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java new file mode 100644 index 0000000000..f9f96a60d7 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java @@ -0,0 +1,155 @@ +/* + * 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.server.protocol.v1_0.constants; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +/** + * Utility class to store constant Symbols. + * + * Please note that {@link SymbolTexts} contain the string definitions for this class and field names in {@link Symbols} + * must match the field names in {@link SymbolTexts}, otherwise the annotation processot in broker-codegen module will throw + * an exception during the compilation + */ +public final class Symbols +{ + private Symbols() + { + + } + + public static final Symbol AMQP_ACCEPTED = Symbol.valueOf(SymbolTexts.AMQP_ACCEPTED); + public static final Symbol AMQP_APPLICATION_PROPERTIES = Symbol.valueOf(SymbolTexts.AMQP_APPLICATION_PROPERTIES); + public static final Symbol AMQP_CONN_ESTABLISHMENT_FAILED = Symbol.valueOf(SymbolTexts.AMQP_CONN_ESTABLISHMENT_FAILED); + public static final Symbol AMQP_CONN_FORCED = Symbol.valueOf(SymbolTexts.AMQP_CONN_FORCED); + public static final Symbol AMQP_CONN_FRAMING_ERROR = Symbol.valueOf(SymbolTexts.AMQP_CONN_FRAMING_ERROR); + public static final Symbol AMQP_CONN_REDIRECT = Symbol.valueOf(SymbolTexts.AMQP_CONN_REDIRECT); + public static final Symbol AMQP_CONN_SOCKET_ERROR = Symbol.valueOf(SymbolTexts.AMQP_CONN_SOCKET_ERROR); + public static final Symbol AMQP_DATA = Symbol.valueOf(SymbolTexts.AMQP_DATA); + public static final Symbol AMQP_DELETE_ON_CLOSE = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_CLOSE); + public static final Symbol AMQP_DELETE_ON_NO_LINKS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_LINKS); + public static final Symbol AMQP_DELETE_ON_NO_LINKS_OR_MSGS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_LINKS_OR_MSGS); + public static final Symbol AMQP_DELETE_ON_NO_MSGS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_MSGS); + public static final Symbol AMQP_DETACH = Symbol.valueOf(SymbolTexts.AMQP_DETACH); + public static final Symbol AMQP_DELIVERY_ANNOTATIONS = Symbol.valueOf(SymbolTexts.AMQP_DELIVERY_ANNOTATIONS); + public static final Symbol AMQP_DISPOSITION = Symbol.valueOf(SymbolTexts.AMQP_DISPOSITION); + public static final Symbol AMQP_DISTRIBUTED_TXN = Symbol.valueOf(SymbolTexts.AMQP_DISTRIBUTED_TXN); + public static final Symbol AMQP_END = Symbol.valueOf(SymbolTexts.AMQP_END); + public static final Symbol AMQP_ERROR = Symbol.valueOf(SymbolTexts.AMQP_ERROR); + public static final Symbol AMQP_ERR_DECODE = Symbol.valueOf(SymbolTexts.AMQP_ERR_DECODE); + public static final Symbol AMQP_ERR_FRAME_SIZE_TOO_SMALL = Symbol.valueOf(SymbolTexts.AMQP_ERR_FRAME_SIZE_TOO_SMALL); + public static final Symbol AMQP_ERR_ILLEGAL_STATE = Symbol.valueOf(SymbolTexts.AMQP_ERR_ILLEGAL_STATE); + public static final Symbol AMQP_ERR_INTERNAL = Symbol.valueOf(SymbolTexts.AMQP_ERR_INTERNAL); + public static final Symbol AMQP_ERR_INVALID_FIELD = Symbol.valueOf(SymbolTexts.AMQP_ERR_INVALID_FIELD); + public static final Symbol AMQP_ERR_NOT_ALLOWED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_ALLOWED); + public static final Symbol AMQP_ERR_NOT_AUTHORIZED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_AUTHORIZED); + public static final Symbol AMQP_ERR_NOT_FOUND = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_FOUND); + public static final Symbol AMQP_ERR_NOT_IMPLEMENTED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_IMPLEMENTED); + public static final Symbol AMQP_ERR_PRECONDITION_FAILED = Symbol.valueOf(SymbolTexts.AMQP_ERR_PRECONDITION_FAILED); + public static final Symbol AMQP_ERR_RESOURCE_DELETED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_DELETED); + public static final Symbol AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_LIMIT_EXCEEDED); + public static final Symbol AMQP_ERR_RESOURCE_LOCKED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_LOCKED); + public static final Symbol AMQP_FLOW = Symbol.valueOf(SymbolTexts.AMQP_FLOW); + public static final Symbol AMQP_FOOTER = Symbol.valueOf(SymbolTexts.AMQP_FOOTER); + public static final Symbol AMQP_HEADER = Symbol.valueOf(SymbolTexts.AMQP_HEADER); + public static final Symbol AMQP_LINK_DETACH_FORCED = Symbol.valueOf(SymbolTexts.AMQP_LINK_DETACH_FORCED); + public static final Symbol AMQP_LINK_MSG_SIZE_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_LINK_MSG_SIZE_EXCEEDED); + public static final Symbol AMQP_LINK_REDIRECT = Symbol.valueOf(SymbolTexts.AMQP_LINK_REDIRECT); + public static final Symbol AMQP_LINK_STOLEN = Symbol.valueOf(SymbolTexts.AMQP_LINK_STOLEN); + public static final Symbol AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_LINK_TRANSFER_LIMIT_EXCEEDED); + public static final Symbol AMQP_LOCAL_TXN = Symbol.valueOf(SymbolTexts.AMQP_LOCAL_TXN); + public static final Symbol AMQP_MESSAGE_ANNOTATIONS = Symbol.valueOf(SymbolTexts.AMQP_MESSAGE_ANNOTATIONS); + public static final Symbol AMQP_MODIFIED = Symbol.valueOf(SymbolTexts.AMQP_MODIFIED); + public static final Symbol AMQP_MULTI_SESSIONS_PER_TXN = Symbol.valueOf(SymbolTexts.AMQP_MULTI_SESSIONS_PER_TXN); + public static final Symbol AMQP_MULTI_TXN_PER_SESSION = Symbol.valueOf(SymbolTexts.AMQP_MULTI_TXN_PER_SESSION); + public static final Symbol AMQP_OPEN = Symbol.valueOf(SymbolTexts.AMQP_OPEN); + public static final Symbol AMQP_PROMOTABLE_TXN = Symbol.valueOf(SymbolTexts.AMQP_PROMOTABLE_TXN); + public static final Symbol AMQP_PROPERTIES = Symbol.valueOf(SymbolTexts.AMQP_PROPERTIES); + public static final Symbol AMQP_RECEIVED = Symbol.valueOf(SymbolTexts.AMQP_RECEIVED); + public static final Symbol AMQP_REJECTED = Symbol.valueOf(SymbolTexts.AMQP_REJECTED); + public static final Symbol AMQP_RELEASED = Symbol.valueOf(SymbolTexts.AMQP_RELEASED); + public static final Symbol AMQP_SASL_CHALLENGE = Symbol.valueOf(SymbolTexts.AMQP_SASL_CHALLENGE); + public static final Symbol AMQP_SASL_INIT = Symbol.valueOf(SymbolTexts.AMQP_SASL_INIT); + public static final Symbol AMQP_SASL_MECHANISMS = Symbol.valueOf(SymbolTexts.AMQP_SASL_MECHANISMS); + public static final Symbol AMQP_SASL_OUTCOME = Symbol.valueOf(SymbolTexts.AMQP_SASL_OUTCOME); + public static final Symbol AMQP_SASL_RESPONSE = Symbol.valueOf(SymbolTexts.AMQP_SASL_RESPONSE); + public static final Symbol AMQP_SEQUENCE = Symbol.valueOf(SymbolTexts.AMQP_SEQUENCE); + public static final Symbol AMQP_SESSION_ERRANT_LINK = Symbol.valueOf(SymbolTexts.AMQP_SESSION_ERRANT_LINK); + public static final Symbol AMQP_SESSION_HANDLE_IN_USE = Symbol.valueOf(SymbolTexts.AMQP_SESSION_HANDLE_IN_USE); + public static final Symbol AMQP_SESSION_UNATTACHED_HANDLE = Symbol.valueOf(SymbolTexts.AMQP_SESSION_UNATTACHED_HANDLE); + public static final Symbol AMQP_SESSION_WINDOW_VIOLATION = Symbol.valueOf(SymbolTexts.AMQP_SESSION_WINDOW_VIOLATION); + public static final Symbol AMQP_SOURCE = Symbol.valueOf(SymbolTexts.AMQP_SOURCE); + public static final Symbol AMQP_TARGET = Symbol.valueOf(SymbolTexts.AMQP_TARGET); + public static final Symbol AMQP_TRANSFER = Symbol.valueOf(SymbolTexts.AMQP_TRANSFER); + public static final Symbol AMQP_TXN_COORDINATOR = Symbol.valueOf(SymbolTexts.AMQP_TXN_COORDINATOR); + public static final Symbol AMQP_TXN_DECLARE = Symbol.valueOf(SymbolTexts.AMQP_TXN_DECLARE); + public static final Symbol AMQP_TXN_DECLARED = Symbol.valueOf(SymbolTexts.AMQP_TXN_DECLARED); + public static final Symbol AMQP_TXN_DISCHARGE = Symbol.valueOf(SymbolTexts.AMQP_TXN_DISCHARGE); + public static final Symbol AMQP_TXN_ROLLBACK = Symbol.valueOf(SymbolTexts.AMQP_TXN_ROLLBACK); + public static final Symbol AMQP_TXN_STATE = Symbol.valueOf(SymbolTexts.AMQP_TXN_STATE); + public static final Symbol AMQP_TXN_TIMEOUT = Symbol.valueOf(SymbolTexts.AMQP_TXN_TIMEOUT); + public static final Symbol AMQP_TXN_UNKNOWN_ID = Symbol.valueOf(SymbolTexts.AMQP_TXN_UNKNOWN_ID); + public static final Symbol AMQP_VALUE = Symbol.valueOf(SymbolTexts.AMQP_VALUE); + public static final Symbol ANONYMOUS_RELAY = Symbol.valueOf(SymbolTexts.ANONYMOUS_RELAY); + public static final Symbol ANNOTATION_KEY = Symbol.valueOf(SymbolTexts.ANNOTATION_KEY); + public static final Symbol APACHE_LEGACY_DIRECT_BINDING = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_DIRECT_BINDING); + public static final Symbol APACHE_LEGACY_NO_LOCAL_FILTER = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_NO_LOCAL_FILTER); + public static final Symbol APACHE_LEGACY_SELECTOR_FILTER = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_SELECTOR_FILTER); + public static final Symbol APACHE_LEGACY_TOPIC_BINDING = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_TOPIC_BINDING); + public static final Symbol APACHE_NO_LOCAL_FILTER = Symbol.valueOf(SymbolTexts.APACHE_NO_LOCAL_FILTER); + public static final Symbol APACHE_SELECTOR_FILTER = Symbol.valueOf(SymbolTexts.APACHE_SELECTOR_FILTER); + public static final Symbol APP_OCTET_STREAM = Symbol.valueOf(SymbolTexts.APP_OCTET_STREAM); + public static final Symbol APP_X_JAVA_SERIALIZED_OBJ = Symbol.valueOf(SymbolTexts.APP_X_JAVA_SERIALIZED_OBJ); + public static final Symbol CONNECTION_CLOSE = Symbol.valueOf(SymbolTexts.CONNECTION_CLOSE); + public static final Symbol CONTAINER_ID = Symbol.valueOf(SymbolTexts.CONTAINER_ID); + public static final Symbol COPY = Symbol.valueOf(SymbolTexts.COPY); + public static final Symbol DELAYED_DELIVERY = Symbol.valueOf(SymbolTexts.DELAYED_DELIVERY); + public static final Symbol DELIVERY_TAG = Symbol.valueOf(SymbolTexts.DELIVERY_TAG); + public static final Symbol DELIVERY_TIME = Symbol.valueOf(SymbolTexts.DELIVERY_TIME); + public static final Symbol DISCARD_UNROUTABLE = Symbol.valueOf(SymbolTexts.DISCARD_UNROUTABLE); + public static final Symbol FIELD = Symbol.valueOf(SymbolTexts.FIELD); + public static final Symbol FILTER = Symbol.valueOf(SymbolTexts.FILTER); + public static final Symbol GLOBAL_CAPABILITY = Symbol.getSymbol(SymbolTexts.GLOBAL_CAPABILITY); + public static final Symbol INVALID_FIELD = Symbol.valueOf(SymbolTexts.INVALID_FIELD); + public static final Symbol LIFETIME_POLICY = Symbol.valueOf(SymbolTexts.LIFETIME_POLICY); + public static final Symbol LINK_DETACH = Symbol.valueOf(SymbolTexts.LINK_DETACH); + public static final Symbol MOVE = Symbol.valueOf(SymbolTexts.MOVE); + public static final Symbol NETWORK_HOST = Symbol.valueOf(SymbolTexts.NETWORK_HOST); + public static final Symbol NEVER = Symbol.valueOf(SymbolTexts.NEVER); + public static final Symbol NOT_VALID_BEFORE = Symbol.valueOf(SymbolTexts.NOT_VALID_BEFORE); + public static final Symbol PRIORITY = Symbol.valueOf(SymbolTexts.PRIORITY); + public static final Symbol PORT = Symbol.valueOf(SymbolTexts.PORT); + public static final Symbol PRODUCT = Symbol.valueOf(SymbolTexts.PRODUCT); + public static final Symbol REJECT_UNROUTABLE = Symbol.valueOf(SymbolTexts.REJECT_UNROUTABLE); + public static final Symbol SHARED_CAPABILITY = Symbol.getSymbol(SymbolTexts.SHARED_CAPABILITY); + public static final Symbol SESSION_END = Symbol.valueOf(SymbolTexts.SESSION_END); + public static final Symbol SHARED_SUBSCRIPTIONS = Symbol.valueOf(SymbolTexts.SHARED_SUBSCRIPTIONS); + public static final Symbol SOLE_CONNECTION_ENFORCEMENT = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_ENFORCEMENT); + public static final Symbol SOLE_CONNECTION_ENFORCEMENT_POLICY = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_ENFORCEMENT_POLICY); + public static final Symbol SOLE_CONNECTION_DETECTION_POLICY = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_DETECTION_POLICY); + public static final Symbol SOLE_CONNECTION_FOR_CONTAINER = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_FOR_CONTAINER); + public static final Symbol SUPPORTED_DIST_MODES = Symbol.valueOf(SymbolTexts.SUPPORTED_DIST_MODES); + public static final Symbol TEMPORARY_QUEUE = Symbol.valueOf(SymbolTexts.TEMPORARY_QUEUE); + public static final Symbol TEMPORARY_TOPIC = Symbol.valueOf(SymbolTexts.TEMPORARY_TOPIC); + public static final Symbol TOPIC = Symbol.valueOf(SymbolTexts.TOPIC); + public static final Symbol TXN_ID = Symbol.valueOf(SymbolTexts.TXN_ID); + public static final Symbol VERSION = Symbol.valueOf(SymbolTexts.VERSION); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/extensions/soleconn/SoleConnectionConnectionProperties.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/extensions/soleconn/SoleConnectionConnectionProperties.java deleted file mode 100644 index 3d603eedfb..0000000000 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/extensions/soleconn/SoleConnectionConnectionProperties.java +++ /dev/null @@ -1,30 +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.server.protocol.v1_0.type.extensions.soleconn; - -import org.apache.qpid.server.protocol.v1_0.type.Symbol; - -public class SoleConnectionConnectionProperties -{ - public static final Symbol SOLE_CONNECTION_ENFORCEMENT_POLICY = Symbol.valueOf("sole-connection-enforcement-policy"); - public static final Symbol SOLE_CONNECTION_DETECTION_POLICY = Symbol.valueOf("sole-connection-detection-policy"); - public static final Symbol SOLE_CONNECTION_FOR_CONTAINER = Symbol.valueOf("sole-connection-for-container"); -} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Accepted.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Accepted.java index 5f98113e79..448b931096 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Accepted.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Accepted.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,22 +19,21 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; -@CompositeType( symbolicDescriptor = "amqp:accepted:list", numericDescriptor = 0x0000000000000024L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_ACCEPTED, numericDescriptor = 0x0000000000000024L) public class Accepted implements Outcome { - public static final Symbol ACCEPTED_SYMBOL = Symbol.valueOf("amqp:accepted:list"); - @Override public Symbol getSymbol() { - return ACCEPTED_SYMBOL; + return Symbols.AMQP_ACCEPTED; } @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnClose.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnClose.java index 849d4da8f7..b0d47fdaf2 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnClose.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnClose.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,14 +19,13 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.LifetimePolicy; -@CompositeType( symbolicDescriptor = "amqp:delete-on-close:list", numericDescriptor = 0x000000000000002bL) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_DELETE_ON_CLOSE, numericDescriptor = 0x000000000000002bL) public class DeleteOnClose implements LifetimePolicy { @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinks.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinks.java index 0d39f0bf88..dcd434ea53 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinks.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinks.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,14 +19,13 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.LifetimePolicy; -@CompositeType( symbolicDescriptor = "amqp:delete-on-no-links:list", numericDescriptor = 0x000000000000002cL) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_DELETE_ON_NO_LINKS, numericDescriptor = 0x000000000000002cL) public class DeleteOnNoLinks implements LifetimePolicy { @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinksOrMessages.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinksOrMessages.java index fc6ad3a848..9f12b4412e 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinksOrMessages.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoLinksOrMessages.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,14 +19,13 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.LifetimePolicy; -@CompositeType( symbolicDescriptor = "amqp:delete-on-no-links-or-messages:list", numericDescriptor = 0x000000000000002eL) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_DELETE_ON_NO_LINKS_OR_MSGS, numericDescriptor = 0x000000000000002eL) public class DeleteOnNoLinksOrMessages implements LifetimePolicy { @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoMessages.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoMessages.java index 63ab0a9e9f..b359a50409 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoMessages.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/DeleteOnNoMessages.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,14 +19,13 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.LifetimePolicy; -@CompositeType( symbolicDescriptor = "amqp:delete-on-no-messages:list", numericDescriptor = 0x000000000000002dL) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_DELETE_ON_NO_MSGS, numericDescriptor = 0x000000000000002dL) public class DeleteOnNoMessages implements LifetimePolicy { @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Header.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Header.java index efa913474c..a14cb08bcf 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Header.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Header.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,16 +19,15 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.UnsignedByte; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:header:list", numericDescriptor = 0x0000000000000070L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_HEADER, numericDescriptor = 0x0000000000000070L) public class Header implements NonEncodingRetainingSection
{ diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Modified.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Modified.java index dadaf92820..c0933f3d7d 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Modified.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Modified.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,22 +19,20 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import java.util.Map; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; -@CompositeType( symbolicDescriptor = "amqp:modified:list", numericDescriptor = 0x0000000000000027L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_MODIFIED, numericDescriptor = 0x0000000000000027L) public class Modified implements Outcome { - public static final Symbol MODIFIED_SYMBOL = Symbol.valueOf("amqp:modified:list"); - @CompositeTypeField(index = 0) private Boolean _deliveryFailed; @@ -78,7 +75,7 @@ public void setMessageAnnotations(Map messageAnnotations) @Override public Symbol getSymbol() { - return MODIFIED_SYMBOL; + return Symbols.AMQP_MODIFIED; } @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Properties.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Properties.java index 9c10cee3a0..3aa2976257 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Properties.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Properties.java @@ -23,13 +23,14 @@ import java.util.Date; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:properties:list", numericDescriptor = 0x0000000000000073L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_PROPERTIES, numericDescriptor = 0x0000000000000073L) public class Properties implements NonEncodingRetainingSection { @CompositeTypeField(index = 0) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Received.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Received.java index 43de13caa9..ef1ce86def 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Received.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Received.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,17 +19,16 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong; -@CompositeType( symbolicDescriptor = "amqp:received:list", numericDescriptor = 0x0000000000000023L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_RECEIVED, numericDescriptor = 0x0000000000000023L) public class Received implements DeliveryState { @CompositeTypeField(index = 0, mandatory = true) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Rejected.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Rejected.java index a715cc419d..ffb49618a9 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Rejected.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Rejected.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,21 +19,19 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.transport.Error; -@CompositeType( symbolicDescriptor = "amqp:rejected:list", numericDescriptor = 0x0000000000000025L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_REJECTED, numericDescriptor = 0x0000000000000025L) public class Rejected implements Outcome { - public static final Symbol REJECTED_SYMBOL = Symbol.valueOf("amqp:rejected:list"); - @CompositeTypeField(index = 0) private Error _error; @@ -51,7 +48,7 @@ public void setError(Error error) @Override public Symbol getSymbol() { - return REJECTED_SYMBOL; + return Symbols.AMQP_REJECTED; } @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Released.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Released.java index 8e67ca8326..ab8c9ad8d0 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Released.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Released.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,23 +19,21 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import org.apache.qpid.server.protocol.v1_0.CompositeType; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; -@CompositeType( symbolicDescriptor = "amqp:released:list", numericDescriptor = 0x0000000000000026L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_RELEASED, numericDescriptor = 0x0000000000000026L) public class Released implements Outcome { - public static final Symbol RELEASED_SYMBOL = Symbol.valueOf("amqp:released:list"); - @Override public Symbol getSymbol() { - return RELEASED_SYMBOL; + return Symbols.AMQP_RELEASED; } @Override diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Source.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Source.java index 547958cb99..467ae53268 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Source.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Source.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,23 +19,22 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import java.util.Arrays; import java.util.LinkedHashMap; import java.util.Map; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.BaseSource; import org.apache.qpid.server.protocol.v1_0.type.DistributionMode; import org.apache.qpid.server.protocol.v1_0.type.Outcome; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:source:list", numericDescriptor = 0x0000000000000028L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_SOURCE, numericDescriptor = 0x0000000000000028L) public class Source implements BaseSource, Terminus { @CompositeTypeField(index = 0) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/StdDistMode.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/StdDistMode.java index e770f958b0..7c5e64f66e 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/StdDistMode.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/StdDistMode.java @@ -24,6 +24,7 @@ package org.apache.qpid.server.protocol.v1_0.type.messaging; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.DistributionMode; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -32,9 +33,9 @@ public class StdDistMode implements DistributionMode, RestrictedType { private final Symbol _val; - public static final StdDistMode MOVE = new StdDistMode(Symbol.valueOf("move")); + public static final StdDistMode MOVE = new StdDistMode(Symbols.MOVE); - public static final StdDistMode COPY = new StdDistMode(Symbol.valueOf("copy")); + public static final StdDistMode COPY = new StdDistMode(Symbols.COPY); private StdDistMode(Symbol val) { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Target.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Target.java index e44670dc36..930b67d1c0 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Target.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/Target.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,20 +19,19 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.messaging; - import java.util.Arrays; import java.util.Map; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.BaseTarget; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:target:list", numericDescriptor = 0x0000000000000029L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_TARGET, numericDescriptor = 0x0000000000000029L) public class Target implements BaseTarget, Terminus { @CompositeTypeField(index = 0) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/TerminusExpiryPolicy.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/TerminusExpiryPolicy.java index 4db2f324d0..8d2076af13 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/TerminusExpiryPolicy.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/TerminusExpiryPolicy.java @@ -24,6 +24,7 @@ package org.apache.qpid.server.protocol.v1_0.type.messaging; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -31,14 +32,13 @@ public class TerminusExpiryPolicy implements RestrictedType { private final Symbol _val; - public static final TerminusExpiryPolicy LINK_DETACH = new TerminusExpiryPolicy(Symbol.valueOf("link-detach")); + public static final TerminusExpiryPolicy LINK_DETACH = new TerminusExpiryPolicy(Symbols.LINK_DETACH); - public static final TerminusExpiryPolicy SESSION_END = new TerminusExpiryPolicy(Symbol.valueOf("session-end")); + public static final TerminusExpiryPolicy SESSION_END = new TerminusExpiryPolicy(Symbols.SESSION_END); - public static final TerminusExpiryPolicy CONNECTION_CLOSE = - new TerminusExpiryPolicy(Symbol.valueOf("connection-close")); + public static final TerminusExpiryPolicy CONNECTION_CLOSE = new TerminusExpiryPolicy(Symbols.CONNECTION_CLOSE); - public static final TerminusExpiryPolicy NEVER = new TerminusExpiryPolicy(Symbol.valueOf("never")); + public static final TerminusExpiryPolicy NEVER = new TerminusExpiryPolicy(Symbols.NEVER); private TerminusExpiryPolicy(Symbol val) { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/AmqpSequenceConstructor.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/AmqpSequenceConstructor.java index bbc999e3f6..a419cd0938 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/AmqpSequenceConstructor.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/AmqpSequenceConstructor.java @@ -27,8 +27,8 @@ import org.apache.qpid.server.protocol.v1_0.codec.AbstractDescribedTypeConstructor; import org.apache.qpid.server.protocol.v1_0.codec.DescribedTypeConstructorRegistry; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpSequence; import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; @@ -37,7 +37,7 @@ public class AmqpSequenceConstructor extends AbstractDescribedTypeConstructor { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("amqp:data:binary"),UnsignedLong.valueOf(0x0000000000000075L), + Symbols.AMQP_DATA, UnsignedLong.valueOf(0x0000000000000075L), }; private static final DataConstructor INSTANCE = new DataConstructor(); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/DataSectionConstructor.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/DataSectionConstructor.java index fe598e2e45..8c5bc7a8ee 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/DataSectionConstructor.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/DataSectionConstructor.java @@ -28,8 +28,8 @@ import org.apache.qpid.server.protocol.v1_0.codec.DescribedTypeConstructorRegistry; import org.apache.qpid.server.protocol.v1_0.codec.TypeConstructor; import org.apache.qpid.server.protocol.v1_0.codec.ValueHandler; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong; import org.apache.qpid.server.protocol.v1_0.type.messaging.DataSection; import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; @@ -40,7 +40,7 @@ public class DataSectionConstructor implements DescribedTypeConstructor { private static final Object[] DESCRIPTORS = { - Symbol.valueOf("amqp:footer:map"),UnsignedLong.valueOf(0x0000000000000078L), + Symbols.AMQP_FOOTER, UnsignedLong.valueOf(0x0000000000000078L), }; private static final FooterConstructor INSTANCE = new FooterConstructor(); diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/FooterSectionConstructor.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/FooterSectionConstructor.java index 43d87d3e01..787bbe99a4 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/FooterSectionConstructor.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/messaging/codec/FooterSectionConstructor.java @@ -25,7 +25,7 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.protocol.v1_0.codec.DescribedTypeConstructorRegistry; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong; import org.apache.qpid.server.protocol.v1_0.type.messaging.FooterSection; @@ -33,7 +33,7 @@ public class FooterSectionConstructor extends DescribedMapSectionConstructor { private final Symbol _val; - public static final TransactionError UNKNOWN_ID = - new TransactionError(Symbol.valueOf("amqp:transaction:unknown-id")); - - public static final TransactionError TRANSACTION_ROLLBACK = - new TransactionError(Symbol.valueOf("amqp:transaction:rollback")); - - public static final TransactionError TRANSACTION_TIMEOUT = - new TransactionError(Symbol.valueOf("amqp:transaction:timeout")); + public static final TransactionError UNKNOWN_ID = new TransactionError(Symbols.AMQP_TXN_UNKNOWN_ID); + public static final TransactionError TRANSACTION_ROLLBACK = new TransactionError(Symbols.AMQP_TXN_ROLLBACK); + public static final TransactionError TRANSACTION_TIMEOUT = new TransactionError(Symbols.AMQP_TXN_TIMEOUT); private TransactionError(Symbol val) { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TransactionalState.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TransactionalState.java index 226d2658e6..3c193c374a 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TransactionalState.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TransactionalState.java @@ -1,4 +1,3 @@ - /* * * Licensed to the Apache Software Foundation (ASF) under one @@ -20,17 +19,16 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transaction; - +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; import org.apache.qpid.server.protocol.v1_0.type.Outcome; -@CompositeType( symbolicDescriptor = "amqp:transactional-state:list", numericDescriptor = 0x0000000000000034L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_TXN_STATE, numericDescriptor = 0x0000000000000034L) public class TransactionalState implements DeliveryState { @CompositeTypeField(index = 0, mandatory = true) diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TxnCapability.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TxnCapability.java index 6de3933bc1..fbe3a66b4a 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TxnCapability.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transaction/TxnCapability.java @@ -24,6 +24,7 @@ package org.apache.qpid.server.protocol.v1_0.type.transaction; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -31,17 +32,11 @@ public class TxnCapability implements org.apache.qpid.server.protocol.v1_0.type. { private final Symbol _val; - public static final TxnCapability LOCAL_TXN = new TxnCapability(Symbol.valueOf("amqp:local-transactions")); - - public static final TxnCapability DISTRIBUTED_TXN = - new TxnCapability(Symbol.valueOf("amqp:distributed-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("amqp:multi-txns-per-ssn")); - - public static final TxnCapability MULTI_SSNS_PER_TXN = new TxnCapability(Symbol.valueOf("amqp:multi-ssns-per-txn")); + public static final TxnCapability LOCAL_TXN = new TxnCapability(Symbols.AMQP_LOCAL_TXN); + public static final TxnCapability DISTRIBUTED_TXN = new TxnCapability(Symbols.AMQP_DISTRIBUTED_TXN); + public static final TxnCapability PROMOTABLE_TXN = new TxnCapability(Symbols.AMQP_PROMOTABLE_TXN); + public static final TxnCapability MULTI_TXNS_PER_SSN = new TxnCapability(Symbols.AMQP_MULTI_TXN_PER_SESSION); + public static final TxnCapability MULTI_SSNS_PER_TXN = new TxnCapability(Symbols.AMQP_MULTI_SESSIONS_PER_TXN); private TxnCapability(Symbol val) { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/AmqpError.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/AmqpError.java index df6eceac1d..a6632b6866 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/AmqpError.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/AmqpError.java @@ -23,26 +23,26 @@ package org.apache.qpid.server.protocol.v1_0.type.transport; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; public class AmqpError implements ErrorCondition, RestrictedType { - public static final AmqpError INTERNAL_ERROR = new AmqpError(Symbol.valueOf("amqp:internal-error")); - public static final AmqpError NOT_FOUND = new AmqpError(Symbol.valueOf("amqp:not-found")); - public static final AmqpError UNAUTHORIZED_ACCESS = new AmqpError(Symbol.valueOf("amqp:unauthorized-access")); - public static final AmqpError DECODE_ERROR = new AmqpError(Symbol.valueOf("amqp:decode-error")); - 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("amqp:not-allowed")); - public static final AmqpError INVALID_FIELD = new AmqpError(Symbol.valueOf("amqp:invalid-field")); - public static final AmqpError NOT_IMPLEMENTED = new AmqpError(Symbol.valueOf("amqp:not-implemented")); - public static final AmqpError RESOURCE_LOCKED = new AmqpError(Symbol.valueOf("amqp:resource-locked")); - public static final AmqpError PRECONDITION_FAILED = new AmqpError(Symbol.valueOf("amqp:precondition-failed")); - public static final AmqpError RESOURCE_DELETED = new AmqpError(Symbol.valueOf("amqp:resource-deleted")); - 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("amqp:frame-size-too-small")); + public static final AmqpError INTERNAL_ERROR = new AmqpError(Symbols.AMQP_ERR_INTERNAL); + public static final AmqpError NOT_FOUND = new AmqpError(Symbols.AMQP_ERR_NOT_FOUND); + public static final AmqpError UNAUTHORIZED_ACCESS = new AmqpError(Symbols.AMQP_ERR_NOT_AUTHORIZED); + public static final AmqpError DECODE_ERROR = new AmqpError(Symbols.AMQP_ERR_DECODE); + public static final AmqpError RESOURCE_LIMIT_EXCEEDED = new AmqpError(Symbols.AMQP_ERR_RESOURCE_LIMIT_EXCEEDED); + public static final AmqpError NOT_ALLOWED = new AmqpError(Symbols.AMQP_ERR_NOT_ALLOWED); + public static final AmqpError INVALID_FIELD = new AmqpError(Symbols.AMQP_ERR_INVALID_FIELD); + public static final AmqpError NOT_IMPLEMENTED = new AmqpError(Symbols.AMQP_ERR_NOT_IMPLEMENTED); + public static final AmqpError RESOURCE_LOCKED = new AmqpError(Symbols.AMQP_ERR_RESOURCE_LOCKED); + public static final AmqpError PRECONDITION_FAILED = new AmqpError(Symbols.AMQP_ERR_PRECONDITION_FAILED); + public static final AmqpError RESOURCE_DELETED = new AmqpError(Symbols.AMQP_ERR_RESOURCE_DELETED); + public static final AmqpError ILLEGAL_STATE = new AmqpError(Symbols.AMQP_ERR_ILLEGAL_STATE); + public static final AmqpError FRAME_SIZE_TOO_SMALL = new AmqpError(Symbols.AMQP_ERR_FRAME_SIZE_TOO_SMALL); private final Symbol _val; diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Attach.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Attach.java index 51b9c98867..46bcd4ad9d 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Attach.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Attach.java @@ -19,14 +19,13 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import java.util.Arrays; import java.util.Map; import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.BaseSource; import org.apache.qpid.server.protocol.v1_0.type.BaseTarget; import org.apache.qpid.server.protocol.v1_0.type.Binary; @@ -38,7 +37,7 @@ import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedLong; -@CompositeType( symbolicDescriptor = "amqp:attach:list", numericDescriptor = 0x0000000000000012L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_ATTACH, numericDescriptor = 0x0000000000000012L) public class Attach implements FrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Begin.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Begin.java index c3de446845..826bd8d09a 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Begin.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Begin.java @@ -19,22 +19,21 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import java.util.Arrays; import java.util.Map; import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedShort; -@CompositeType( symbolicDescriptor = "amqp:begin:list", numericDescriptor = 0x0000000000000011L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_BEGIN, numericDescriptor = 0x0000000000000011L) public class Begin implements FrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Close.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Close.java index 77a6ff676a..90e3af9865 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Close.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Close.java @@ -19,16 +19,15 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.ErrorCarryingFrameBody; -@CompositeType( symbolicDescriptor = "amqp:close:list", numericDescriptor = 0x0000000000000018L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_CLOSE, numericDescriptor = 0x0000000000000018L) public class Close implements ErrorCarryingFrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/ConnectionError.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/ConnectionError.java index deb7d05801..142e4917f4 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/ConnectionError.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/ConnectionError.java @@ -23,19 +23,17 @@ package org.apache.qpid.server.protocol.v1_0.type.transport; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; public class ConnectionError implements ErrorCondition, RestrictedType { - public static final ConnectionError CONNECTION_FORCED = - new ConnectionError(Symbol.valueOf("amqp:connection:forced")); - public static final ConnectionError FRAMING_ERROR = - new ConnectionError(Symbol.valueOf("amqp:connection:framing-error")); - public static final ConnectionError REDIRECT = new ConnectionError(Symbol.valueOf("amqp:connection:redirect")); - public static final ConnectionError SOCKET_ERROR = - new ConnectionError(Symbol.valueOf("amqp:connection:socket-error")); + public static final ConnectionError CONNECTION_FORCED = new ConnectionError(Symbols.AMQP_CONN_FORCED); + public static final ConnectionError FRAMING_ERROR = new ConnectionError(Symbols.AMQP_CONN_FRAMING_ERROR); + public static final ConnectionError REDIRECT = new ConnectionError(Symbols.AMQP_CONN_REDIRECT); + public static final ConnectionError SOCKET_ERROR = new ConnectionError(Symbols.AMQP_CONN_SOCKET_ERROR); private final Symbol _val; diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Detach.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Detach.java index 96b596b685..18ea047b90 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Detach.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Detach.java @@ -19,17 +19,16 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.ErrorCarryingFrameBody; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:detach:list", numericDescriptor = 0x0000000000000016L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_DETACH, numericDescriptor = 0x0000000000000016L) public class Detach implements ErrorCarryingFrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Disposition.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Disposition.java index 965063330c..21f484ebc8 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Disposition.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Disposition.java @@ -19,18 +19,17 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:disposition:list", numericDescriptor = 0x0000000000000015L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_DISPOSITION, numericDescriptor = 0x0000000000000015L) public class Disposition implements FrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/End.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/End.java index a486bf6d06..941929cf0b 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/End.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/End.java @@ -19,16 +19,15 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.ErrorCarryingFrameBody; -@CompositeType( symbolicDescriptor = "amqp:end:list", numericDescriptor = 0x0000000000000017L) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_END, numericDescriptor = 0x0000000000000017L) public class End implements ErrorCarryingFrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Error.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Error.java index 40217d46b8..7a1f37f8a3 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Error.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Error.java @@ -19,18 +19,17 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import java.util.Map; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.Symbol; -@CompositeType( symbolicDescriptor = "amqp:error:list", numericDescriptor = 0x000000000000001DL) +@CompositeType(symbolicDescriptor = SymbolTexts.AMQP_ERROR, numericDescriptor = 0x000000000000001DL) public class Error { @CompositeTypeField(index = 0, mandatory = true, diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Flow.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Flow.java index 6eee901ce0..becad44ee3 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Flow.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Flow.java @@ -19,20 +19,19 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import java.util.Map; import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:flow:list", numericDescriptor = 0x0000000000000013L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_FLOW, numericDescriptor = 0x0000000000000013L) public class Flow implements FrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/LinkError.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/LinkError.java index e90effeb89..3aaddd4dd1 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/LinkError.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/LinkError.java @@ -23,19 +23,18 @@ package org.apache.qpid.server.protocol.v1_0.type.transport; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; public class LinkError implements ErrorCondition, RestrictedType { - 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("amqp:link:transfer-limit-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("amqp:link:redirect")); - public static final LinkError STOLEN = new LinkError(Symbol.valueOf("amqp:link:stolen")); + public static final LinkError DETACH_FORCED = new LinkError(Symbols.AMQP_LINK_DETACH_FORCED); + public static final LinkError TRANSFER_LIMIT_EXCEEDED = new LinkError(Symbols.AMQP_LINK_TRANSFER_LIMIT_EXCEEDED); + public static final LinkError MESSAGE_SIZE_EXCEEDED = new LinkError(Symbols.AMQP_LINK_MSG_SIZE_EXCEEDED); + public static final LinkError REDIRECT = new LinkError(Symbols.AMQP_LINK_REDIRECT); + public static final LinkError STOLEN = new LinkError(Symbols.AMQP_LINK_STOLEN); private final Symbol _val; diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Open.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Open.java index eeae127146..f5553c6a13 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Open.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Open.java @@ -19,22 +19,21 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import java.util.Arrays; import java.util.Map; import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedShort; -@CompositeType( symbolicDescriptor = "amqp:open:list", numericDescriptor = 0x0000000000000010L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_OPEN, numericDescriptor = 0x0000000000000010L) public class Open implements FrameBody { diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/SessionError.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/SessionError.java index f332f46c3b..86243cde34 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/SessionError.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/SessionError.java @@ -23,18 +23,17 @@ package org.apache.qpid.server.protocol.v1_0.type.transport; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.RestrictedType; import org.apache.qpid.server.protocol.v1_0.type.Symbol; public class SessionError implements ErrorCondition, RestrictedType { - public static final SessionError WINDOW_VIOLATION = - new SessionError(Symbol.valueOf("amqp:session:window-violation")); - 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("amqp:session:handle-in-use")); - public static final SessionError UNATTACHED_HANDLE = - new SessionError(Symbol.valueOf("amqp:session:unattached-handle")); + public static final SessionError WINDOW_VIOLATION = new SessionError(Symbols.AMQP_SESSION_WINDOW_VIOLATION); + public static final SessionError ERRANT_LINK = new SessionError(Symbols.AMQP_SESSION_ERRANT_LINK); + public static final SessionError HANDLE_IN_USE = new SessionError(Symbols.AMQP_SESSION_HANDLE_IN_USE); + public static final SessionError UNATTACHED_HANDLE = new SessionError(Symbols.AMQP_SESSION_UNATTACHED_HANDLE); private final Symbol _val; diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Transfer.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Transfer.java index e4d3231d23..265d5df353 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Transfer.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/type/transport/Transfer.java @@ -19,20 +19,19 @@ * */ - package org.apache.qpid.server.protocol.v1_0.type.transport; - import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.protocol.v1_0.CompositeType; import org.apache.qpid.server.protocol.v1_0.CompositeTypeField; import org.apache.qpid.server.protocol.v1_0.ConnectionHandler; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -@CompositeType( symbolicDescriptor = "amqp:transfer:list", numericDescriptor = 0x0000000000000014L) +@CompositeType( symbolicDescriptor = SymbolTexts.AMQP_TRANSFER, numericDescriptor = 0x0000000000000014L) public class Transfer implements FrameBody { private volatile QpidByteBuffer _payload; diff --git a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_1_0Test.java b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_1_0Test.java index 22953de146..817bdac74c 100644 --- a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_1_0Test.java +++ b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_Internal_to_1_0Test.java @@ -47,6 +47,7 @@ import org.apache.qpid.server.message.internal.InternalMessageMetaData; import org.apache.qpid.server.message.internal.InternalMessageMetaDataType; import org.apache.qpid.server.model.NamedAddressSpace; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoder; import org.apache.qpid.server.protocol.v1_0.messaging.SectionDecoderImpl; import org.apache.qpid.server.protocol.v1_0.type.Binary; @@ -340,7 +341,7 @@ private Byte getJmsMessageTypeAnnotation(final Message_1_0 convertedMessage) final Map messageAnnotations = messageAnnotationsSection.getValue(); if (messageAnnotations != null) { - final Object annotation = messageAnnotations.get(Symbol.valueOf("x-opt-jms-msg-type")); + final Object annotation = messageAnnotations.get(Symbols.ANNOTATION_KEY); if (annotation instanceof Byte) { return ((Byte) annotation); diff --git a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_v1_0_to_InternalTest.java b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_v1_0_to_InternalTest.java index 27b6b12838..19e6030d28 100644 --- a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_v1_0_to_InternalTest.java +++ b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/MessageConverter_v1_0_to_InternalTest.java @@ -46,6 +46,7 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.message.internal.InternalMessage; import org.apache.qpid.server.model.NamedAddressSpace; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpSequence; @@ -64,17 +65,17 @@ class MessageConverter_v1_0_to_InternalTest extends UnitTestBase { private static final MessageAnnotations MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 0)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 0)); private static final MessageAnnotations OBJECT_MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 1)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 1)); private static final MessageAnnotations MAP_MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 2)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 2)); private static final MessageAnnotations BYTE_MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 3)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 3)); private static final MessageAnnotations STREAM_MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 4)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 4)); private static final MessageAnnotations TEXT_MESSAGE_MESSAGE_ANNOTATION = - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 5)); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 5)); private MessageConverter_v1_0_to_Internal _converter; @BeforeAll @@ -175,7 +176,7 @@ void amqpValueWithNullWithUnknownMessageAnnotation() final Object expected = null; final AmqpValue amqpValue = new AmqpValue(expected); final Message_1_0 sourceMessage = - createTestMessage(new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), + createTestMessage(new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 11)), amqpValue.createEncodingRetainingSection()); final InternalMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class)); @@ -440,7 +441,7 @@ void dataWithTextMessageAnnotationWithContentType() void dataWithUnsupportedMessageAnnotation() { doTestDataWithAnnotation("helloworld".getBytes(UTF_8), - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null, "application/octet-stream"); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 11)), null, "application/octet-stream"); } @Test @@ -448,7 +449,7 @@ void dataWithUnsupportedMessageAnnotationWithContentType() { final String mimeType = "foo/bar"; doTestDataWithAnnotation("helloworld".getBytes(UTF_8), - new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), mimeType, mimeType); + new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 11)), mimeType, mimeType); } @Test @@ -564,7 +565,7 @@ void noBodyWithTextMessageAnnotationWithUnknownTextualContentType() void noBodyWithUnknownMessageAnnotation() { final Message_1_0 sourceMessage = - createTestMessage(new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), (byte) 11)), null); + createTestMessage(new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 11)), null); final InternalMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class)); @@ -579,7 +580,7 @@ void noBodyWithUnknownMessageAnnotationWithContentType() final Properties properties = new Properties(); properties.setContentType(Symbol.valueOf(mimeType)); final Message_1_0 sourceMessage = - createTestMessage(properties, new MessageAnnotations(Map.of(Symbol.valueOf("x-opt-jms-msg-type"), + createTestMessage(properties, new MessageAnnotations(Map.of(Symbols.ANNOTATION_KEY, (byte) 11)), null); final InternalMessage convertedMessage = _converter.convert(sourceMessage, mock(NamedAddressSpace.class)); diff --git a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/Session_1_0Test.java b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/Session_1_0Test.java index de7fa0e8c2..4263891fcd 100644 --- a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/Session_1_0Test.java +++ b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/Session_1_0Test.java @@ -64,6 +64,7 @@ import org.apache.qpid.server.model.Queue; import org.apache.qpid.server.model.Session; import org.apache.qpid.server.model.VirtualHost; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.ErrorCondition; import org.apache.qpid.server.protocol.v1_0.type.FrameBody; import org.apache.qpid.server.protocol.v1_0.type.Symbol; @@ -561,7 +562,7 @@ private Source createDynamicSource(final DeleteOnClose lifetimePolicy) { final Source source = new Source(); source.setDynamic(true); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, lifetimePolicy)); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, lifetimePolicy)); return source; } diff --git a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpointTest.java b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpointTest.java index b305824a39..9e0d612483 100644 --- a/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpointTest.java +++ b/broker-plugins/amqp-1-0-protocol/src/test/java/org/apache/qpid/server/protocol/v1_0/TxnCoordinatorReceivingLinkEndpointTest.java @@ -41,6 +41,7 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.model.Session; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; @@ -159,7 +160,7 @@ void receiveDeliveryDischargeOutcomeRejected() when(delivery.getDeliveryTag()).thenReturn(new Binary("1".getBytes(StandardCharsets.UTF_8))); final Source source = mock(Source.class); - when(source.getOutcomes()).thenReturn(new Symbol[] { Rejected.REJECTED_SYMBOL }); + when(source.getOutcomes()).thenReturn(new Symbol[] { Symbols.AMQP_REJECTED }); final Link_1_0 link = mock(Link_1_0.class); when(link.getSource()).thenReturn(source); @@ -186,7 +187,7 @@ void amqpValueSectionNotFound() when(delivery.getPayload()).thenReturn(qpidByteBuffer); final Source source = mock(Source.class); - when(source.getOutcomes()).thenReturn(new Symbol[] { Rejected.REJECTED_SYMBOL }); + when(source.getOutcomes()).thenReturn(new Symbol[] { Symbols.AMQP_REJECTED }); final Link_1_0 link = mock(Link_1_0.class); when(link.getSource()).thenReturn(source); @@ -209,7 +210,7 @@ void invalidMessage() when(delivery.getPayload()).thenReturn(qpidByteBuffer); final Source source = mock(Source.class); - when(source.getOutcomes()).thenReturn(new Symbol[] { Rejected.REJECTED_SYMBOL }); + when(source.getOutcomes()).thenReturn(new Symbol[] { Symbols.AMQP_REJECTED }); final Link_1_0 link = mock(Link_1_0.class); when(link.getSource()).thenReturn(source); @@ -231,7 +232,7 @@ void unknownCommand() when(delivery.getPayload()).thenReturn(qpidByteBuffer); final Source source = mock(Source.class); - when(source.getOutcomes()).thenReturn(new Symbol[] { Rejected.REJECTED_SYMBOL }); + when(source.getOutcomes()).thenReturn(new Symbol[] { Symbols.AMQP_REJECTED }); final Link_1_0 link = mock(Link_1_0.class); when(link.getSource()).thenReturn(source); diff --git a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/Interaction.java b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/Interaction.java index aa42218b79..546c349cf6 100644 --- a/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/Interaction.java +++ b/systests/protocol-tests-amqp-1-0/src/main/java/org/apache/qpid/tests/protocol/v1_0/Interaction.java @@ -38,6 +38,7 @@ import java.util.stream.Collectors; import org.apache.qpid.server.bytebuffer.QpidByteBuffer; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.framing.SASLFrame; import org.apache.qpid.server.protocol.v1_0.framing.TransportFrame; import org.apache.qpid.server.protocol.v1_0.type.AmqpErrorException; @@ -51,11 +52,9 @@ import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.UnsignedShort; -import org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpValue; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpValueSection; import org.apache.qpid.server.protocol.v1_0.type.messaging.Filter; -import org.apache.qpid.server.protocol.v1_0.type.messaging.Rejected; import org.apache.qpid.server.protocol.v1_0.type.messaging.Source; import org.apache.qpid.server.protocol.v1_0.type.messaging.Target; import org.apache.qpid.server.protocol.v1_0.type.security.SaslCode; @@ -991,8 +990,8 @@ public Interaction txnAttachCoordinatorLink(final UnsignedInteger handle) throws { return txnAttachCoordinatorLink(handle, this::txDefaultUnexpectedResponseHandler, - Accepted.ACCEPTED_SYMBOL, - Rejected.REJECTED_SYMBOL); + Symbols.AMQP_ACCEPTED, + Symbols.AMQP_REJECTED); } public Interaction txnAttachCoordinatorLink(final UnsignedInteger handle, @@ -1000,8 +999,8 @@ public Interaction txnAttachCoordinatorLink(final UnsignedInteger handle, { return txnAttachCoordinatorLink(handle, unexpectedResponseHandler, - Accepted.ACCEPTED_SYMBOL, - Rejected.REJECTED_SYMBOL); + Symbols.AMQP_ACCEPTED, + Symbols.AMQP_REJECTED); } public Interaction txnAttachCoordinatorLink(final UnsignedInteger handle, diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/DecodeErrorTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/DecodeErrorTest.java index 01e6d14ce1..92783142ce 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/DecodeErrorTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/DecodeErrorTest.java @@ -37,6 +37,7 @@ import org.apache.qpid.server.bytebuffer.QpidByteBuffer; import org.apache.qpid.server.protocol.v1_0.codec.StringWriter; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.AmqpValue; @@ -107,7 +108,7 @@ public void nodePropertiesLifetimePolicy() throws Exception { final Source source = new Source(); source.setDynamic(Boolean.TRUE); - source.setDynamicNodeProperties(Map.of(Symbol.valueOf("lifetime-policy"), UnsignedInteger.MAX_VALUE)); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, UnsignedInteger.MAX_VALUE)); final Interaction interaction = transport.newInteraction() .negotiateOpen() .begin().consumeResponse(Begin.class) @@ -130,7 +131,7 @@ public void nodePropertiesSupportedDistributionModes() throws Exception { final Target target = new Target(); target.setDynamic(Boolean.TRUE); - target.setDynamicNodeProperties(Map.of(Symbol.valueOf("supported-dist-modes"), UnsignedInteger.ZERO)); + target.setDynamicNodeProperties(Map.of(Symbols.SUPPORTED_DIST_MODES, UnsignedInteger.ZERO)); final Interaction interaction = transport.newInteraction() .negotiateOpen() .begin().consumeResponse(Begin.class) diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/anonymousterminus/AnonymousTerminusTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/anonymousterminus/AnonymousTerminusTest.java index bac6570cda..7a5da75c01 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/anonymousterminus/AnonymousTerminusTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/anonymousterminus/AnonymousTerminusTest.java @@ -37,9 +37,9 @@ import org.junit.jupiter.api.Test; import org.apache.qpid.server.bytebuffer.QpidByteBuffer; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.DeliveryState; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted; import org.apache.qpid.server.protocol.v1_0.type.messaging.Properties; @@ -68,9 +68,6 @@ public class AnonymousTerminusTest extends BrokerAdminUsingTestBase { - private static final Symbol ANONYMOUS_RELAY = Symbol.valueOf("ANONYMOUS-RELAY"); - private static final Symbol DELIVERY_TAG = Symbol.valueOf("delivery-tag"); - private Binary _deliveryTag; @BeforeEach @@ -145,7 +142,7 @@ public void transferPreSettledToUnknownDestination() throws Exception assertThat(error, is(notNullValue())); assertThat(error.getCondition(), is(equalTo(AmqpError.NOT_FOUND))); assertThat(error.getInfo(), is(notNullValue())); - assertThat(error.getInfo().get(DELIVERY_TAG), is(equalTo(_deliveryTag))); + assertThat(error.getInfo().get(Symbols.DELIVERY_TAG), is(equalTo(_deliveryTag))); } } @@ -171,7 +168,7 @@ public void transferUnsettledToUnknownDestinationWhenRejectedOutcomeSupportedByS .consumeResponse(Begin.class) .attachRole(Role.SENDER) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_REJECTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -192,7 +189,7 @@ public void transferUnsettledToUnknownDestinationWhenRejectedOutcomeSupportedByS assertThat(error, is(notNullValue())); assertThat(error.getCondition(), is(oneOf(AmqpError.NOT_FOUND, AmqpError.NOT_ALLOWED))); assertThat(error.getInfo(), is(notNullValue())); - assertThat(error.getInfo().get(DELIVERY_TAG), is(equalTo(_deliveryTag))); + assertThat(error.getInfo().get(Symbols.DELIVERY_TAG), is(equalTo(_deliveryTag))); } } @@ -218,7 +215,7 @@ public void transferUnsettledToUnknownDestinationWhenRejectedOutcomeNotSupported .consumeResponse(Begin.class) .attachRole(Role.SENDER) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -232,7 +229,7 @@ public void transferUnsettledToUnknownDestinationWhenRejectedOutcomeNotSupported assertThat(error, is(notNullValue())); assertThat(error.getCondition(), is(equalTo(AmqpError.NOT_FOUND))); assertThat(error.getInfo(), is(notNullValue())); - assertThat(error.getInfo().get(DELIVERY_TAG), is(equalTo(_deliveryTag))); + assertThat(error.getInfo().get(Symbols.DELIVERY_TAG), is(equalTo(_deliveryTag))); } } @@ -333,7 +330,7 @@ public void transferUnsettledInTransactionToUnknownDestinationWhenRejectedOutcom .txnDeclare() .attachRole(Role.SENDER) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_REJECTED) .attachHandle(linkHandle) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) @@ -359,7 +356,7 @@ public void transferUnsettledInTransactionToUnknownDestinationWhenRejectedOutcom final Error rejectedError = ((Rejected) receivedTxnState.getOutcome()).getError(); assertThat(rejectedError.getCondition(), is(equalTo(AmqpError.NOT_FOUND))); assertThat(rejectedError.getInfo(), is(notNullValue())); - assertThat(rejectedError.getInfo().get(DELIVERY_TAG), is(equalTo(_deliveryTag))); + assertThat(rejectedError.getInfo().get(Symbols.DELIVERY_TAG), is(equalTo(_deliveryTag))); interaction.txnDischarge(false); @@ -381,7 +378,7 @@ public void transferUnsettledInTransactionToUnknownDestinationWhenRejectedOutcom .txnDeclare() .attachRole(Role.SENDER) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED) .attachHandle(linkHandle) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) @@ -400,7 +397,7 @@ public void transferUnsettledInTransactionToUnknownDestinationWhenRejectedOutcom assertThat(senderLinkDetachError, is(notNullValue())); assertThat(senderLinkDetachError.getCondition(), is(equalTo(AmqpError.NOT_FOUND))); assertThat(senderLinkDetachError.getInfo(), is(notNullValue())); - assertThat(senderLinkDetachError.getInfo().get(DELIVERY_TAG), is(equalTo(_deliveryTag))); + assertThat(senderLinkDetachError.getInfo().get(Symbols.DELIVERY_TAG), is(equalTo(_deliveryTag))); interaction.txnDischarge(false); @@ -453,7 +450,7 @@ public void transferPreSettledInTransactionToUnknownDestinationWhenRejectOutcome .attachRole(Role.SENDER) .attachHandle(linkHandle) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_REJECTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -513,14 +510,14 @@ public void transferPreSettledInTransactionToUnknownDestinationWhenRejectOutcome interaction.begin() .consumeResponse(Begin.class) - .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Accepted.ACCEPTED_SYMBOL) + .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Symbols.AMQP_ACCEPTED) .txnDeclare() .attachRole(Role.SENDER) .attachHandle(linkHandle) .attachTarget(new Target()) .attachName("link-" + linkHandle) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_REJECTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -547,10 +544,10 @@ private String getNonExistingDestinationName() private Interaction openInteractionWithAnonymousRelayCapability(final FrameTransport transport) throws Exception { final Interaction interaction = transport.newInteraction(); - interaction.openDesiredCapabilities(ANONYMOUS_RELAY).negotiateOpen(); + interaction.openDesiredCapabilities(Symbols.ANONYMOUS_RELAY).negotiateOpen(); Open open = interaction.getLatestResponse(Open.class); - assumeTrue(hasItemInArray((ANONYMOUS_RELAY)).matches(open.getOfferedCapabilities())); + assumeTrue(hasItemInArray((Symbols.ANONYMOUS_RELAY)).matches(open.getOfferedCapabilities())); return interaction; } diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java index a218388cf0..24a278936c 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TemporaryDestinationTest.java @@ -32,7 +32,7 @@ import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; -import org.apache.qpid.server.protocol.v1_0.Session_1_0; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.DeleteOnClose; @@ -54,9 +54,6 @@ public class TemporaryDestinationTest extends BrokerAdminUsingTestBase { - private static final Symbol TEMPORARY_QUEUE = Symbol.valueOf("temporary-queue"); - private static final Symbol TEMPORARY_TOPIC = Symbol.valueOf("temporary-topic"); - @Test @SpecificationTest(section = "5.3", description = "To create a node with the required lifecycle properties, establish a uniquely named sending link with " @@ -64,7 +61,7 @@ public class TemporaryDestinationTest extends BrokerAdminUsingTestBase + "dynamic-node-properties field of target containing the “lifetime-policy” symbol key mapped to delete-on-close.") public void deleteOnCloseWithConnectionCloseForQueue() throws Exception { - deleteOnCloseWithConnectionClose(new Symbol[]{TEMPORARY_QUEUE}); + deleteOnCloseWithConnectionClose(new Symbol[]{Symbols.TEMPORARY_QUEUE}); } @Test @@ -74,7 +71,7 @@ public void deleteOnCloseWithConnectionCloseForQueue() throws Exception + "dynamic-node-properties field of target containing the “lifetime-policy” symbol key mapped to delete-on-close.") public void deleteOnCloseWithConnectionCloseForTopic() throws Exception { - deleteOnCloseWithConnectionClose(new Symbol[]{TEMPORARY_TOPIC}); + deleteOnCloseWithConnectionClose(new Symbol[]{Symbols.TEMPORARY_TOPIC}); } private void deleteOnCloseWithConnectionClose(final Symbol[] targetCapabilities) throws Exception @@ -129,7 +126,7 @@ private void deleteOnCloseWithConnectionClose(final Symbol[] targetCapabilities) + "TemporaryQueue Terminus capability : 'temporary-queue'") public void createTemporaryQueueReceivingLink() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_QUEUE}; + final Symbol[] capabilities = new Symbol[]{Symbols.TEMPORARY_QUEUE}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Target target = createTarget(capabilities); @@ -189,7 +186,7 @@ public void createTemporaryQueueReceivingLink() throws Exception + "TemporaryQueue Terminus capability : 'temporary-queue'") public void createTemporaryQueueReceivingLinkFromOtherConnectionDisallowed() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_QUEUE}; + final Symbol[] capabilities = new Symbol[]{Symbols.TEMPORARY_QUEUE}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Target target = createTarget(capabilities); @@ -228,7 +225,7 @@ public void createTemporaryQueueReceivingLinkFromOtherConnectionDisallowed() thr + " is allowed to create consumer objects for them.") public void createTemporaryQueueSendingLinkFromOtherConnectionAllowed() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_QUEUE}; + final Symbol[] capabilities = new Symbol[]{Symbols.TEMPORARY_QUEUE}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Target target = createTarget(capabilities); @@ -279,11 +276,11 @@ public void createTemporaryQueueSendingLinkFromOtherConnectionAllowed() throws E + "TemporaryTopic Terminus capability : 'temporary-topic'") public void createTemporaryTopicSubscriptionReceivingLink() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_TOPIC}; + final Symbol[] capabilities = {Symbols.TEMPORARY_TOPIC}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { final Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); source.setCapabilities(capabilities); source.setDynamic(true); @@ -305,7 +302,7 @@ public void createTemporaryTopicSubscriptionReceivingLink() throws Exception assertThat(newTemporaryNodeAddress, is(notNullValue())); Target target = new Target(); - target.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + target.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); target.setCapabilities(capabilities); target.setAddress(newTemporaryNodeAddress); @@ -343,11 +340,11 @@ public void createTemporaryTopicSubscriptionReceivingLink() throws Exception + "TemporaryTopic Terminus capability : 'temporary-topic'") public void createTemporaryTopicSubscriptionReceivingLinkFromOtherConnectionDisallowed() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_TOPIC}; + final Symbol[] capabilities = {Symbols.TEMPORARY_TOPIC}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { final Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); source.setCapabilities(capabilities); source.setDynamic(true); @@ -384,11 +381,11 @@ public void createTemporaryTopicSubscriptionReceivingLinkFromOtherConnectionDisa + " is allowed to create consumer objects for them.") public void createTemporaryTopicSendingLinkFromOtherConnectionAllowed() throws Exception { - final Symbol[] capabilities = new Symbol[]{TEMPORARY_TOPIC}; + final Symbol[] capabilities = {Symbols.TEMPORARY_TOPIC}; try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { final Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); source.setCapabilities(capabilities); source.setDynamic(true); @@ -459,7 +456,7 @@ private void assertSendingLinkSucceeds(final String address) throws Exception private Target createTarget(final Symbol[] capabilities) { Target target = new Target(); - target.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + target.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); target.setDynamic(true); target.setCapabilities(capabilities); @@ -469,7 +466,7 @@ private Target createTarget(final Symbol[] capabilities) private Source createSource(final String name, final Symbol[] capabilities) { final Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); source.setCapabilities(capabilities); source.setAddress(name); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TopicDestinationTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TopicDestinationTest.java index 04d127bc6b..43937dacb3 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TopicDestinationTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/bindmapjms/TopicDestinationTest.java @@ -34,6 +34,7 @@ import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.Source; @@ -53,10 +54,6 @@ @BrokerSpecific(kind = KIND_BROKER_J) public class TopicDestinationTest extends BrokerAdminUsingTestBase { - private static final Symbol TOPIC = Symbol.valueOf("topic"); - private static final Symbol GLOBAL = Symbol.valueOf("global"); - private static final Symbol SHARED = Symbol.valueOf("shared"); - @Test @SpecificationTest(section = "5.2", description = "In order to facilitate these actions for the various Destination types that JMS supports," @@ -70,7 +67,7 @@ public void nonSharedVolatileSubscriptionLinkAttachDetach() throws Exception { final Source source = new Source(); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); - source.setCapabilities(new Symbol[]{TOPIC}); + source.setCapabilities(new Symbol[]{Symbols.TOPIC}); source.setAddress("amq.topic"); source.setDurable(TerminusDurability.NONE); @@ -104,7 +101,7 @@ public void nonSharedDurableSubscriptionLinkAttachDetach() throws Exception { final Source source = new Source(); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); - source.setCapabilities(new Symbol[]{TOPIC}); + source.setCapabilities(new Symbol[]{Symbols.TOPIC}); source.setAddress("amq.topic"); source.setDurable(TerminusDurability.UNSETTLED_STATE); @@ -139,7 +136,7 @@ public void sharedGlobalVolatileSubscriptionLinkAttachDetach() throws Exception { final Source source = new Source(); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); - source.setCapabilities(new Symbol[]{TOPIC, GLOBAL, SHARED}); + source.setCapabilities(new Symbol[]{Symbols.TOPIC, Symbols.GLOBAL_CAPABILITY, Symbols.SHARED_CAPABILITY}); source.setAddress("amq.topic"); source.setDurable(TerminusDurability.NONE); @@ -197,7 +194,7 @@ public void sharedGlobalDurableSubscriptionLinkAttachDetach() throws Exception { final Source source = new Source(); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); - source.setCapabilities(new Symbol[]{TOPIC, GLOBAL, SHARED}); + source.setCapabilities(new Symbol[]{Symbols.TOPIC, Symbols.GLOBAL_CAPABILITY, Symbols.SHARED_CAPABILITY}); source.setAddress("amq.topic"); source.setDurable(TerminusDurability.CONFIGURATION); @@ -279,7 +276,7 @@ public void sharedGlobalDurableSubscriptionCloseWithActiveLink() throws Exceptio { final Source source = new Source(); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); - source.setCapabilities(new Symbol[]{TOPIC, GLOBAL, SHARED}); + source.setCapabilities(new Symbol[]{Symbols.TOPIC, Symbols.GLOBAL_CAPABILITY, Symbols.SHARED_CAPABILITY}); source.setAddress("amq.topic"); source.setDurable(TerminusDurability.CONFIGURATION); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/management/ManagementTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/management/ManagementTest.java index ea7e434ea8..d3ad1946ba 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/management/ManagementTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/management/ManagementTest.java @@ -31,7 +31,7 @@ import org.junit.jupiter.api.Test; -import org.apache.qpid.server.protocol.v1_0.Session_1_0; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.DeleteOnClose; @@ -64,10 +64,10 @@ public void drainTemporaryMessageSource() throws Exception try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Target target = new Target(); - target.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + target.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); target.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); target.setDynamic(true); - target.setCapabilities(new Symbol[]{Symbol.valueOf("temporary-queue")}); + target.setCapabilities(new Symbol[]{Symbols.TEMPORARY_QUEUE}); final Interaction interaction = transport.newInteraction(); final Attach attachResponse = interaction.openHostname("$management") diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicyTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicyTest.java index fe232add0a..d081e50a36 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicyTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/CloseExistingPolicyTest.java @@ -20,9 +20,6 @@ package org.apache.qpid.tests.protocol.v1_0.extensions.soleconn; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_DETECTION_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_ENFORCEMENT_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.CLOSE_EXISTING; import static org.apache.qpid.tests.protocol.v1_0.extensions.soleconn.SoleConnectionAsserts.assertEnforcementPolicyCloseExisting; import static org.apache.qpid.tests.protocol.v1_0.extensions.soleconn.SoleConnectionAsserts.assertResourceLocked; @@ -37,6 +34,7 @@ import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionDetectionPolicy; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; @@ -55,9 +53,9 @@ public void basicNegotiation() throws Exception { Open responseOpen = transport.newInteraction() .openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen() .getLatestResponse(Open.class); @@ -65,9 +63,9 @@ public void basicNegotiation() throws Exception assumeSoleConnectionCapability(responseOpen); assumeEnforcementPolicyCloseExisting(responseOpen); - if (responseOpen.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY)) + if (responseOpen.getProperties().containsKey(Symbols.SOLE_CONNECTION_DETECTION_POLICY)) { - assertThat(responseOpen.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY), + assertThat(responseOpen.getProperties().get(Symbols.SOLE_CONNECTION_DETECTION_POLICY), in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(), SoleConnectionDetectionPolicy.WEAK.getValue()})); } @@ -81,8 +79,8 @@ public void existingConnectionClosed() throws Exception { final Interaction interaction1 = transport1.newInteraction(); interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen(); final Open responseOpen = interaction1.getLatestResponse(Open.class); @@ -93,8 +91,8 @@ public void existingConnectionClosed() throws Exception { final Interaction interaction2 = transport2.newInteraction(); interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .sendOpen() .sync(); @@ -126,8 +124,8 @@ public void strongDetectionWhenConnectionWithoutSoleConnectionCapabilityOpened() { final Interaction interaction2 = transport2.newInteraction(); interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen(); final Open responseOpen2 = interaction2.getLatestResponse(Open.class); @@ -146,9 +144,9 @@ public void strongDetection() throws Exception { final Interaction interaction1 = transport1.newInteraction(); Open responseOpen = interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen() .getLatestResponse(Open.class); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicyTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicyTest.java index 35ed86a862..ebdb8d7eb7 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicyTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/MixedPolicyTest.java @@ -20,8 +20,6 @@ package org.apache.qpid.tests.protocol.v1_0.extensions.soleconn; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_ENFORCEMENT_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.CLOSE_EXISTING; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.REFUSE_CONNECTION; import static org.apache.qpid.tests.protocol.v1_0.extensions.soleconn.SoleConnectionAsserts.assumeEnforcementPolicyCloseExisting; @@ -32,6 +30,7 @@ import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; import org.apache.qpid.server.protocol.v1_0.type.transport.Open; import org.apache.qpid.tests.protocol.v1_0.FrameTransport; @@ -48,8 +47,8 @@ public void firstCloseThenRefuse() throws Exception { final Interaction interaction1 = transport1.newInteraction(); interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen(); Open responseOpen = interaction1.getLatestResponse(Open.class); @@ -60,8 +59,8 @@ public void firstCloseThenRefuse() throws Exception { final Interaction interaction2 = transport2.newInteraction(); interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .sendOpen().sync(); interaction1.consumeResponse(Close.class); @@ -72,8 +71,8 @@ public void firstCloseThenRefuse() throws Exception { final Interaction interaction3 = transport3.newInteraction(); interaction3.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen() .consumeResponse(Close.class); } @@ -88,8 +87,8 @@ public void firstRefuseThenClose() throws Exception { final Interaction interaction1 = transport1.newInteraction(); interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .negotiateOpen(); final Open responseOpen = interaction1.getLatestResponse(Open.class); @@ -100,8 +99,8 @@ public void firstRefuseThenClose() throws Exception { final Interaction interaction2 = transport2.newInteraction(); interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING)) .negotiateOpen() .consumeResponse(Close.class); } diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicyTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicyTest.java index e8ab9fc61e..f491c634a2 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicyTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/RefuseConnectionPolicyTest.java @@ -20,9 +20,6 @@ package org.apache.qpid.tests.protocol.v1_0.extensions.soleconn; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_DETECTION_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_ENFORCEMENT_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.REFUSE_CONNECTION; import static org.apache.qpid.tests.protocol.v1_0.extensions.soleconn.SoleConnectionAsserts.assertConnectionEstablishmentFailed; import static org.apache.qpid.tests.protocol.v1_0.extensions.soleconn.SoleConnectionAsserts.assertInvalidContainerId; @@ -37,6 +34,7 @@ import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionDetectionPolicy; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; @@ -55,9 +53,9 @@ public void basicNegotiation() throws Exception { final Interaction interaction = transport.newInteraction(); final Open responseOpen = interaction.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .negotiateOpen() .getLatestResponse(Open.class); @@ -65,9 +63,9 @@ public void basicNegotiation() throws Exception assumeSoleConnectionCapability(responseOpen); assumeEnforcementPolicyRefuse(responseOpen); - if (responseOpen.getProperties().containsKey(SOLE_CONNECTION_DETECTION_POLICY)) + if (responseOpen.getProperties().containsKey(Symbols.SOLE_CONNECTION_DETECTION_POLICY)) { - assertThat(responseOpen.getProperties().get(SOLE_CONNECTION_DETECTION_POLICY), + assertThat(responseOpen.getProperties().get(Symbols.SOLE_CONNECTION_DETECTION_POLICY), in(new UnsignedInteger[]{SoleConnectionDetectionPolicy.STRONG.getValue(), SoleConnectionDetectionPolicy.WEAK.getValue()})); } @@ -81,8 +79,8 @@ public void newConnectionRefused() throws Exception { final Interaction interaction1 = transport1.newInteraction(); interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) - .openProperties(Map.of(SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) + .openProperties(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .negotiateOpen(); final Open responseOpen = interaction1.getLatestResponse(Open.class); @@ -93,9 +91,9 @@ public void newConnectionRefused() throws Exception { final Interaction interaction2 = transport2.newInteraction(); final Open responseOpen2 = interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .negotiateOpen() .getLatestResponse(Open.class); @@ -125,9 +123,9 @@ public void strongDetectionWhenConnectionWithoutSoleConnectionCapabilityOpened() { final Interaction interaction2 = transport2.newInteraction(); final Open responseOpen2 = interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION)) .negotiateOpen() .getLatestResponse(Open.class); @@ -145,9 +143,9 @@ public void strongDetection() throws Exception { final Interaction interaction1 = transport1.newInteraction(); final Open responseOpen = interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .openProperties(Map.of( - SOLE_CONNECTION_ENFORCEMENT_POLICY, + Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION.getValue())) .negotiateOpen() .getLatestResponse(Open.class); @@ -178,7 +176,7 @@ public void refuseIsDefault() throws Exception final Interaction interaction1 = transport1.newInteraction(); // Omit setting the enforcement policy explicitly. The default is refuse. interaction1.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .negotiateOpen(); final Open responseOpen = interaction1.getLatestResponse(Open.class); @@ -190,7 +188,7 @@ public void refuseIsDefault() throws Exception final Interaction interaction2 = transport2.newInteraction(); // Omit setting the enforcement policy explicitly. The default is refuse. final Open responseOpen2 = interaction2.openContainerId("testContainerId") - .openDesiredCapabilities(SOLE_CONNECTION_FOR_CONTAINER) + .openDesiredCapabilities(Symbols.SOLE_CONNECTION_FOR_CONTAINER) .negotiateOpen() .getLatestResponse(Open.class); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/SoleConnectionAsserts.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/SoleConnectionAsserts.java index 161da65a99..c1ce1668e8 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/SoleConnectionAsserts.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/extensions/soleconn/SoleConnectionAsserts.java @@ -20,9 +20,6 @@ package org.apache.qpid.tests.protocol.v1_0.extensions.soleconn; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_DETECTION_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_ENFORCEMENT_POLICY; -import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionConnectionProperties.SOLE_CONNECTION_FOR_CONTAINER; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.CLOSE_EXISTING; import static org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionEnforcementPolicy.REFUSE_CONNECTION; import static org.hamcrest.CoreMatchers.anyOf; @@ -38,7 +35,7 @@ import java.util.Map; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.extensions.soleconn.SoleConnectionDetectionPolicy; import org.apache.qpid.server.protocol.v1_0.type.transport.AmqpError; import org.apache.qpid.server.protocol.v1_0.type.transport.Close; @@ -46,11 +43,6 @@ class SoleConnectionAsserts { - private static final Symbol CONNECTION_ESTABLISHMENT_FAILED = Symbol.valueOf("amqp:connection-establishment-failed"); - private static final Symbol SOLE_CONNECTION_ENFORCEMENT = Symbol.valueOf("sole-connection-enforcement"); - private static final Symbol INVALID_FIELD = Symbol.valueOf("invalid-field"); - private static final Symbol CONTAINER_ID = Symbol.valueOf("container-id"); - private SoleConnectionAsserts() { } @@ -58,66 +50,66 @@ private SoleConnectionAsserts() static void assumeSoleConnectionCapability(Open open) { assumeTrue(is(notNullValue()).matches(open.getOfferedCapabilities())); - assumeTrue(hasItemInArray(SOLE_CONNECTION_FOR_CONTAINER).matches(open.getOfferedCapabilities())); + assumeTrue(hasItemInArray(Symbols.SOLE_CONNECTION_FOR_CONTAINER).matches(open.getOfferedCapabilities())); } static void assertSoleConnectionCapability(Open open) { assertThat(open.getOfferedCapabilities(), is(notNullValue())); - assertThat(open.getOfferedCapabilities(), hasItemInArray(SOLE_CONNECTION_FOR_CONTAINER)); + assertThat(open.getOfferedCapabilities(), hasItemInArray(Symbols.SOLE_CONNECTION_FOR_CONTAINER)); } static void assumeEnforcementPolicyCloseExisting(Open open) { assumeTrue(is(notNullValue()).matches(open.getProperties())); - assumeTrue(hasEntry(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING.getValue()).matches(open.getProperties())); + assumeTrue(hasEntry(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING.getValue()).matches(open.getProperties())); } static void assertEnforcementPolicyCloseExisting(Open open) { assertThat(open.getProperties(), is(notNullValue())); - assertThat(open.getProperties(), hasEntry(SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING.getValue())); + assertThat(open.getProperties(), hasEntry(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, CLOSE_EXISTING.getValue())); } static void assumeEnforcementPolicyRefuse(Open open) { assumeTrue(is(notNullValue()).matches(open.getProperties())); - assumeTrue(anyOf(hasEntry(SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION.getValue()), - is(not(hasKey(SOLE_CONNECTION_ENFORCEMENT_POLICY)))).matches(open.getProperties())); + assumeTrue(anyOf(hasEntry(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY, REFUSE_CONNECTION.getValue()), + is(not(hasKey(Symbols.SOLE_CONNECTION_ENFORCEMENT_POLICY)))).matches(open.getProperties())); } static void assumeDetectionPolicyStrong(Open open) { assumeTrue(is(notNullValue()).matches(open.getProperties())); - assumeTrue(anyOf(hasEntry(SOLE_CONNECTION_DETECTION_POLICY, SoleConnectionDetectionPolicy.STRONG.getValue()), - is(not(hasKey(SOLE_CONNECTION_DETECTION_POLICY)))).matches(open.getProperties())); + assumeTrue(anyOf(hasEntry(Symbols.SOLE_CONNECTION_DETECTION_POLICY, SoleConnectionDetectionPolicy.STRONG.getValue()), + is(not(hasKey(Symbols.SOLE_CONNECTION_DETECTION_POLICY)))).matches(open.getProperties())); } static void assertConnectionEstablishmentFailed(final Open open) { assertThat(open.getProperties(), is(notNullValue())); - assertThat(open.getProperties(), hasKey(CONNECTION_ESTABLISHMENT_FAILED)); - assertThat(open.getProperties(), hasEntry(CONNECTION_ESTABLISHMENT_FAILED, true)); + assertThat(open.getProperties(), hasKey(Symbols.AMQP_CONN_ESTABLISHMENT_FAILED)); + assertThat(open.getProperties(), hasEntry(Symbols.AMQP_CONN_ESTABLISHMENT_FAILED, true)); } static void assumeConnectionEstablishmentFailed(final Open open) { assumeTrue(is(notNullValue()).matches(open.getProperties())); - assumeTrue(hasKey(CONNECTION_ESTABLISHMENT_FAILED).matches(open.getProperties())); - assertThat(open.getProperties(), hasEntry(CONNECTION_ESTABLISHMENT_FAILED, true)); + assumeTrue(hasKey(Symbols.AMQP_CONN_ESTABLISHMENT_FAILED).matches(open.getProperties())); + assertThat(open.getProperties(), hasEntry(Symbols.AMQP_CONN_ESTABLISHMENT_FAILED, true)); } static void assertResourceLocked(final Close close) { assertThat(close.getError(), is(notNullValue())); assertThat(close.getError().getCondition(), is(equalTo(AmqpError.RESOURCE_LOCKED))); - assertThat(close.getError().getInfo(), is(equalTo(Map.of(SOLE_CONNECTION_ENFORCEMENT, true)))); + assertThat(close.getError().getInfo(), is(equalTo(Map.of(Symbols.SOLE_CONNECTION_ENFORCEMENT, true)))); } static void assertInvalidContainerId(final Close close) { assertThat(close.getError(), is(notNullValue())); assertThat(close.getError().getCondition(), is(equalTo(AmqpError.INVALID_FIELD))); - assertThat(close.getError().getInfo(), is(equalTo(Map.of(INVALID_FIELD, CONTAINER_ID)))); + assertThat(close.getError().getInfo(), is(equalTo(Map.of(Symbols.INVALID_FIELD, Symbols.CONTAINER_ID)))); } } diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java index 987ff93400..477688c7d3 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/DeleteOnCloseTest.java @@ -32,7 +32,7 @@ import org.junit.jupiter.api.Test; -import org.apache.qpid.server.protocol.v1_0.Session_1_0; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.messaging.DeleteOnClose; import org.apache.qpid.server.protocol.v1_0.type.messaging.Source; import org.apache.qpid.server.protocol.v1_0.type.messaging.Target; @@ -62,7 +62,7 @@ public void deleteOnCloseOnSource() throws Exception try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setDynamic(true); final Interaction interaction = transport.newInteraction(); final Attach attachResponse = interaction.negotiateOpen() @@ -97,7 +97,7 @@ public void deleteOnCloseOnTarget() throws Exception try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Target target = new Target(); - target.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + target.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); target.setDynamic(true); final Interaction interaction = transport.newInteraction(); final Attach attachResponse = interaction.negotiateOpen() @@ -135,7 +135,7 @@ public void doesNotDeleteOnDetach() throws Exception try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setDynamic(true); final Interaction interaction = transport.newInteraction(); final Attach attachResponse = interaction.negotiateOpen() @@ -178,7 +178,7 @@ public void dynamicNodeIsPersisted() throws Exception try (FrameTransport transport = new FrameTransport(getBrokerAdmin()).connect()) { Source source = new Source(); - source.setDynamicNodeProperties(Map.of(Session_1_0.LIFETIME_POLICY, new DeleteOnClose())); + source.setDynamicNodeProperties(Map.of(Symbols.LIFETIME_POLICY, new DeleteOnClose())); source.setExpiryPolicy(TerminusExpiryPolicy.NEVER); source.setDynamic(true); final Interaction interaction = transport.newInteraction(); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/OutcomeTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/OutcomeTest.java index b623a2b9b8..40a93a811b 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/OutcomeTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/OutcomeTest.java @@ -31,8 +31,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; -import org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted; import org.apache.qpid.server.protocol.v1_0.type.messaging.Modified; import org.apache.qpid.server.protocol.v1_0.type.messaging.Source; import org.apache.qpid.server.protocol.v1_0.type.transport.Attach; @@ -129,7 +129,7 @@ public void transferMessageWithAttachSourceHavingExplicitlySetOutcomesToAccepted .begin().consumeResponse(Begin.class) .attachRole(Role.SENDER) .attachTargetAddress(BrokerAdmin.TEST_QUEUE_NAME) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .transferPayloadData(getTestName()) @@ -153,7 +153,7 @@ private void assumeModifiedSupportedBySource(final Attach attach) if (!(source.getDefaultOutcome() instanceof Modified)) { - assumeTrue(hasItemInArray(Modified.MODIFIED_SYMBOL).matches(source.getOutcomes())); + assumeTrue(hasItemInArray(Symbols.AMQP_MODIFIED).matches(source.getOutcomes())); } } } diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java index 27c1c57cc3..679baa6e61 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/messaging/TransferTest.java @@ -51,6 +51,7 @@ import org.junit.jupiter.api.Test; import org.apache.qpid.server.bytebuffer.QpidByteBuffer; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.ErrorCarryingFrameBody; import org.apache.qpid.server.protocol.v1_0.type.Outcome; @@ -438,8 +439,8 @@ public void durableTransferWithRejectedOutcome() throws Exception .begin().consumeResponse(Begin.class) .attachRole(Role.SENDER) .attachTargetAddress(BrokerAdmin.TEST_QUEUE_NAME) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, - Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, + Symbols.AMQP_REJECTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -454,11 +455,11 @@ public void durableTransferWithRejectedOutcome() throws Exception assertThat(receivedDisposition.getState(), is(instanceOf(Outcome.class))); if (getBrokerAdmin().supportsRestart()) { - assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Accepted.ACCEPTED_SYMBOL)); + assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Symbols.AMQP_ACCEPTED)); } else { - assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Rejected.REJECTED_SYMBOL)); + assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Symbols.AMQP_REJECTED)); } } } @@ -485,7 +486,7 @@ public void durableTransferWithoutRejectedOutcome() throws Exception .begin().consumeResponse(Begin.class) .attachRole(Role.SENDER) .attachTargetAddress(BrokerAdmin.TEST_QUEUE_NAME) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED) .attach().consumeResponse(Attach.class) .consumeResponse(Flow.class) .assertLatestResponse(Flow.class, this::assumeSufficientCredits) @@ -503,7 +504,7 @@ public void durableTransferWithoutRejectedOutcome() throws Exception final Disposition receivedDisposition = (Disposition) response.getBody(); assertThat(receivedDisposition.getSettled(), is(true)); assertThat(receivedDisposition.getState(), is(instanceOf(Outcome.class))); - assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Accepted.ACCEPTED_SYMBOL)); + assertThat(((Outcome) receivedDisposition.getState()).getSymbol(), is(Symbols.AMQP_ACCEPTED)); } else { @@ -648,7 +649,7 @@ public void receiveTransferReceiverSettleSecondWithRejectedOutcome() throws Exce .begin().consumeResponse() .attachRole(Role.RECEIVER) .attachSourceAddress(BrokerAdmin.TEST_QUEUE_NAME) - .attachSourceOutcomes(Accepted.ACCEPTED_SYMBOL, Rejected.REJECTED_SYMBOL) + .attachSourceOutcomes(Symbols.AMQP_ACCEPTED, Symbols.AMQP_REJECTED) .attachRcvSettleMode(ReceiverSettleMode.SECOND) .attach().consumeResponse() .assertLatestResponse(this::assumeAttach) diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java index 49f14134bf..2c923b71cc 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/DischargeTest.java @@ -36,6 +36,7 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted; @@ -82,7 +83,7 @@ public void dischargeUnknownTransactionIdWhenSourceSupportsRejectedOutcome() thr interaction.negotiateOpen() .begin().consumeResponse(Begin.class) - .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Rejected.REJECTED_SYMBOL) + .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Symbols.AMQP_REJECTED) .txnDeclare(); assertThat(interaction.getCoordinatorLatestDeliveryState(), is(instanceOf(Declared.class))); @@ -113,7 +114,7 @@ public void dischargeUnknownTransactionIdWhenSourceDoesNotSupportRejectedOutcome final Interaction interaction = transport.newInteraction(); interaction.negotiateOpen() .begin().consumeResponse(Begin.class) - .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Accepted.ACCEPTED_SYMBOL) + .txnAttachCoordinatorLink(UnsignedInteger.ZERO, this::coordinatorAttachExpected, Symbols.AMQP_ACCEPTED) .txnDeclare(); assertThat(interaction.getCoordinatorLatestDeliveryState(), is(instanceOf(Declared.class))); diff --git a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/TransactionalTransferTest.java b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/TransactionalTransferTest.java index d25accacbe..827009a159 100644 --- a/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/TransactionalTransferTest.java +++ b/systests/protocol-tests-amqp-1-0/src/test/java/org/apache/qpid/tests/protocol/v1_0/transaction/TransactionalTransferTest.java @@ -35,9 +35,9 @@ import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.Symbols; import org.apache.qpid.server.protocol.v1_0.type.Binary; import org.apache.qpid.server.protocol.v1_0.type.ErrorCarryingFrameBody; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; import org.apache.qpid.server.protocol.v1_0.type.UnsignedInteger; import org.apache.qpid.server.protocol.v1_0.type.messaging.Accepted; import org.apache.qpid.server.protocol.v1_0.type.transaction.TransactionError; @@ -495,7 +495,7 @@ public void receiveTransactionalAcquisitionReceiverSettleFirst() throws Exceptio .flowNextOutgoingId(UnsignedInteger.ZERO) .flowLinkCredit(UnsignedInteger.ONE) .flowHandleFromLinkHandle() - .flowProperties(Map.of(Symbol.valueOf("txn-id"), interaction.getCurrentTransactionId())) + .flowProperties(Map.of(Symbols.TXN_ID, interaction.getCurrentTransactionId())) .flow() .receiveDelivery(); @@ -557,7 +557,7 @@ public void receiveTransactionalAcquisitionDischargeFail() throws Exception .flowNextOutgoingId(UnsignedInteger.ZERO) .flowLinkCredit(UnsignedInteger.ONE) .flowHandleFromLinkHandle() - .flowProperties(Map.of(Symbol.valueOf("txn-id"), interaction.getCurrentTransactionId())) + .flowProperties(Map.of(Symbols.TXN_ID, interaction.getCurrentTransactionId())) .flow() .receiveDelivery(); @@ -615,8 +615,7 @@ public void receiveTransactionalAcquisitionFlowFailsDueToUnknownTransactionId() .flowIncomingWindow(UnsignedInteger.ONE) .flowLinkCredit(UnsignedInteger.ONE) .flowHandleFromLinkHandle() - .flowProperties(Map.of(Symbol.valueOf("txn-id"), - integerToBinary(Integer.MAX_VALUE))) + .flowProperties(Map.of(Symbols.TXN_ID, integerToBinary(Integer.MAX_VALUE))) .flow() .consume(ErrorCarryingFrameBody.class, Flow.class); diff --git a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/acl/MessagingACLTest.java b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/acl/MessagingACLTest.java index 9ca015dc78..81d5329792 100644 --- a/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/acl/MessagingACLTest.java +++ b/systests/qpid-systests-jms_1.1/src/test/java/org/apache/qpid/systests/jms_1_1/extensions/acl/MessagingACLTest.java @@ -65,6 +65,7 @@ import org.apache.qpid.server.model.Group; import org.apache.qpid.server.model.GroupMember; import org.apache.qpid.server.model.Protocol; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.server.security.access.config.AclFileParser; import org.apache.qpid.server.security.access.config.Rule; import org.apache.qpid.server.security.access.config.RuleSet; @@ -898,13 +899,13 @@ private void assertConnection(final Connection connection) throws JMSException "create session should be successful"); } - private void assertAccessDeniedException(JMSException e) throws Exception + private void assertAccessDeniedException(final JMSException e) { assertTrue(e.getMessage().contains("Permission PERFORM_ACTION(connect) is denied"), "Unexpected exception message:" + e.getMessage()); if (getProtocol() == Protocol.AMQP_1_0) { - assertTrue(e.getMessage().contains("amqp:not-allowed"), + assertTrue(e.getMessage().contains(SymbolTexts.AMQP_ERR_NOT_ALLOWED), "Unexpected error condition reported:" + e.getMessage()); } } diff --git a/systests/qpid-systests-jms_2.0/src/test/java/org/apache/qpid/systests/jms_2_0/deliverydelay/DeliveryDelayTest.java b/systests/qpid-systests-jms_2.0/src/test/java/org/apache/qpid/systests/jms_2_0/deliverydelay/DeliveryDelayTest.java index 9b7b12fb68..69abe5b54e 100644 --- a/systests/qpid-systests-jms_2.0/src/test/java/org/apache/qpid/systests/jms_2_0/deliverydelay/DeliveryDelayTest.java +++ b/systests/qpid-systests-jms_2.0/src/test/java/org/apache/qpid/systests/jms_2_0/deliverydelay/DeliveryDelayTest.java @@ -41,6 +41,7 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.apache.qpid.server.protocol.v1_0.constants.SymbolTexts; import org.apache.qpid.systests.JmsTestBase; import org.apache.qpid.tests.utils.BrokerAdmin; @@ -107,7 +108,7 @@ public void testDeliveryDelayNotSupportedByQueue_MessageRejected() throws Except } catch (JMSRuntimeException e) { - assertTrue(e.getMessage().contains("amqp:precondition-failed"), + assertTrue(e.getMessage().contains(SymbolTexts.AMQP_ERR_PRECONDITION_FAILED), "Unexpected exception message: " + e.getMessage()); } } @@ -147,7 +148,7 @@ public void testDeliveryDelayNotSupportedByQueueViaExchange_MessageRejected() th } catch (JMSRuntimeException e) { - assertTrue(e.getMessage().contains("amqp:precondition-failed"), + assertTrue(e.getMessage().contains(SymbolTexts.AMQP_ERR_PRECONDITION_FAILED), "Unexpected exception message: " + e.getMessage()); } } From 389d19b56c33772a9fc0feca097b46cd029ff219 Mon Sep 17 00:00:00 2001 From: dakirily Date: Thu, 8 Jan 2026 15:19:00 +0100 Subject: [PATCH 2/2] QPID-8706: Move AMQP-1.0 symbols declarations to a utility classes --- .../server/protocol/v1_0/SymbolMapper.java | 86 ++++++++--- .../protocol/v1_0/constants/SymbolTexts.java | 142 ++---------------- .../protocol/v1_0/constants/Symbols.java | 137 ++--------------- .../capabilities/CapabilitiesSymbolTexts.java | 31 ++++ .../capabilities/CapabilitiesSymbols.java | 33 ++++ .../amqp/messaging/MessagingSymbolTexts.java | 60 ++++++++ .../amqp/messaging/MessagingSymbols.java | 62 ++++++++ .../amqp/security/SaslSymbolTexts.java | 30 ++++ .../constants/amqp/security/SaslSymbols.java | 32 ++++ .../transaction/TransactionSymbolTexts.java | 39 +++++ .../amqp/transaction/TransactionSymbols.java | 41 +++++ .../amqp/transport/TransportSymbolTexts.java | 75 +++++++++ .../amqp/transport/TransportSymbols.java | 77 ++++++++++ .../v1_0/constants/qpid/QpidSymbolTexts.java | 37 +++++ .../v1_0/constants/qpid/QpidSymbols.java | 39 +++++ 15 files changed, 642 insertions(+), 279 deletions(-) create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbols.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbols.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbols.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbols.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbols.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbolTexts.java create mode 100644 broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbols.java diff --git a/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java index 0cb32387ba..73d9d9aedf 100644 --- a/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java +++ b/broker-codegen/src/main/java/org/apache/qpid/server/protocol/v1_0/SymbolMapper.java @@ -4,7 +4,7 @@ * 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 + * "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 @@ -20,15 +20,21 @@ package org.apache.qpid.server.protocol.v1_0; +import java.util.ArrayList; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Optional; +import java.util.Set; import javax.annotation.processing.ProcessingEnvironment; +import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; +import javax.lang.model.element.TypeElement; import javax.lang.model.element.VariableElement; +import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeMirror; public final class SymbolMapper { @@ -49,31 +55,29 @@ static void initialize(final ProcessingEnvironment processingEnv) return; } - final List symbolTextFields = processingEnv.getElementUtils().getTypeElement(SYMBOL_TEXTS) - .getEnclosedElements() - .stream() - .filter(element -> element.getKind() == ElementKind.FIELD) - .map(VariableElement.class::cast) - .toList(); + final List symbolTextFields = getAllFields(processingEnv, SYMBOL_TEXTS); + final List symbolFields = getAllFields(processingEnv, SYMBOLS); + final Map symbolTextFieldsByName = new HashMap<>(); - final List symbolFields = processingEnv.getElementUtils().getTypeElement(SYMBOLS) - .getEnclosedElements() - .stream() - .filter(element -> element.getKind() == ElementKind.FIELD) - .map(VariableElement.class::cast) - .toList(); + for (final VariableElement field : symbolTextFields) + { + final String name = field.getSimpleName().toString(); + final VariableElement previous = symbolTextFieldsByName.putIfAbsent(name, field); + if (previous != null) + { + throw new RuntimeException("Duplicate field name " + name + " found in SymbolTexts"); + } + } for (final VariableElement field : symbolFields) { if (field.getModifiers().contains(Modifier.STATIC) && SYMBOL.equals(field.asType().toString())) { final String name = field.getSimpleName().toString(); - final Optional optSymbolTextField = symbolTextFields.stream() - .filter(element -> element.getSimpleName().toString().equals(name)) - .findFirst(); - if (optSymbolTextField.isPresent() && optSymbolTextField.get().getConstantValue() != null) + final VariableElement symbolTextField = symbolTextFieldsByName.get(name); + if (symbolTextField != null && symbolTextField.getConstantValue() != null) { - NAME_MAPPING.put(String.valueOf(optSymbolTextField.get().getConstantValue()), "Symbols.%s".formatted(name)); + NAME_MAPPING.put(String.valueOf(symbolTextField.getConstantValue()), "Symbols.%s".formatted(name)); } else { @@ -89,4 +93,48 @@ static String getConstantName(String symbolText) { return NAME_MAPPING.getOrDefault(symbolText, "Symbol.valueOf(\"%s\")".formatted(symbolText)); } + + private static List getAllFields(final ProcessingEnvironment processingEnv, final String typeName) + { + final TypeElement typeElement = processingEnv.getElementUtils().getTypeElement(typeName); + if (typeElement == null) + { + throw new RuntimeException("Unable to resolve type " + typeName + " during SymbolMapper initialization"); + } + + final List fields = new ArrayList<>(); + collectFields(typeElement, fields, new HashSet<>()); + return fields; + } + + private static void collectFields(final TypeElement typeElement, + final List fields, + final Set visited) + { + final String typeName = typeElement.getQualifiedName().toString(); + if (!visited.add(typeName)) + { + return; + } + + for (final Element element : typeElement.getEnclosedElements()) + { + if (element.getKind() == ElementKind.FIELD) + { + fields.add((VariableElement) element); + } + } + + for (final TypeMirror iface : typeElement.getInterfaces()) + { + if (iface instanceof DeclaredType) + { + final Element element = ((DeclaredType) iface).asElement(); + if (element instanceof TypeElement) + { + collectFields((TypeElement) element, fields, visited); + } + } + } + } } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java index 63750c77ea..c1564a8c7f 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/SymbolTexts.java @@ -4,7 +4,7 @@ * 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 + * "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 @@ -20,139 +20,17 @@ package org.apache.qpid.server.protocol.v1_0.constants; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.capabilities.CapabilitiesSymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.messaging.MessagingSymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.security.SaslSymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.transaction.TransactionSymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.transport.TransportSymbolTexts; +import org.apache.qpid.server.protocol.v1_0.constants.qpid.QpidSymbolTexts; /** - * Utility class to store constant {@link Symbol} texts. - * - * Please note that this class contain the string definitions for {@link Symbols} class and field names in - * {@link Symbols} must match the field names in {@link SymbolTexts}, otherwise the annotation processot in broker-codegen - * module will throw an exception during the compilation + * Aggregates all AMQP and Qpid-specific Symbol text constants. + * Keep field names aligned with {@link Symbols} for code generation mapping. */ -public final class SymbolTexts +public interface SymbolTexts extends TransportSymbolTexts, MessagingSymbolTexts, TransactionSymbolTexts, SaslSymbolTexts, CapabilitiesSymbolTexts, QpidSymbolTexts { - private SymbolTexts() - { - - } - - public static final String AMQP_ACCEPTED = "amqp:accepted:list"; - public static final String AMQP_APPLICATION_PROPERTIES = "amqp:application-properties:map"; - public static final String AMQP_ATTACH = "amqp:attach:list"; - public static final String AMQP_BEGIN = "amqp:begin:list"; - public static final String AMQP_CLOSE = "amqp:close:list"; - public static final String AMQP_CONN_ESTABLISHMENT_FAILED = "amqp:connection-establishment-failed"; - public static final String AMQP_CONN_FORCED = "amqp:connection:forced"; - public static final String AMQP_CONN_FRAMING_ERROR = "amqp:connection:framing-error"; - public static final String AMQP_CONN_REDIRECT = "amqp:connection:redirect"; - public static final String AMQP_CONN_SOCKET_ERROR = "amqp:connection:socket-error"; - public static final String AMQP_DATA = "amqp:data:binary"; - public static final String AMQP_DELETE_ON_CLOSE = "amqp:delete-on-close:list"; - public static final String AMQP_DELETE_ON_NO_LINKS = "amqp:delete-on-no-links:list"; - public static final String AMQP_DELETE_ON_NO_LINKS_OR_MSGS = "amqp:delete-on-no-links-or-messages:list"; - public static final String AMQP_DELETE_ON_NO_MSGS = "amqp:delete-on-no-messages:list"; - public static final String AMQP_DETACH = "amqp:detach:list"; - public static final String AMQP_DELIVERY_ANNOTATIONS = "amqp:delivery-annotations:map"; - public static final String AMQP_DISPOSITION = "amqp:disposition:list"; - public static final String AMQP_DISTRIBUTED_TXN = "amqp:distributed-transactions"; - public static final String AMQP_END = "amqp:end:list"; - public static final String AMQP_ERROR = "amqp:error:list"; - public static final String AMQP_ERR_DECODE = "amqp:decode-error"; - public static final String AMQP_ERR_FRAME_SIZE_TOO_SMALL = "amqp:frame-size-too-small"; - public static final String AMQP_ERR_ILLEGAL_STATE = "amqp:illegal-state"; - public static final String AMQP_ERR_INTERNAL = "amqp:internal-error"; - public static final String AMQP_ERR_INVALID_FIELD = "amqp:invalid-field"; - public static final String AMQP_ERR_NOT_ALLOWED = "amqp:not-allowed"; - public static final String AMQP_ERR_NOT_AUTHORIZED = "amqp:unauthorized-access"; - public static final String AMQP_ERR_NOT_FOUND = "amqp:not-found"; - public static final String AMQP_ERR_NOT_IMPLEMENTED = "amqp:not-implemented"; - public static final String AMQP_ERR_PRECONDITION_FAILED = "amqp:precondition-failed"; - public static final String AMQP_ERR_RESOURCE_DELETED = "amqp:resource-deleted"; - public static final String AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = "amqp:resource-limit-exceeded"; - public static final String AMQP_ERR_RESOURCE_LOCKED = "amqp:resource-locked"; - public static final String AMQP_FLOW = "amqp:flow:list"; - public static final String AMQP_FOOTER = "amqp:footer:map"; - public static final String AMQP_HEADER = "amqp:header:list"; - public static final String AMQP_LINK_DETACH_FORCED = "amqp:link:detach-forced"; - public static final String AMQP_LINK_MSG_SIZE_EXCEEDED = "amqp:link:message-size-exceeded"; - public static final String AMQP_LINK_REDIRECT = "amqp:link:redirect"; - public static final String AMQP_LINK_STOLEN = "amqp:link:stolen"; - public static final String AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = "amqp:link:transfer-limit-exceeded"; - public static final String AMQP_LOCAL_TXN = "amqp:local-transactions"; - public static final String AMQP_MESSAGE_ANNOTATIONS = "amqp:message-annotations:map"; - public static final String AMQP_MODIFIED = "amqp:modified:list"; - public static final String AMQP_MULTI_SESSIONS_PER_TXN = "amqp:multi-ssns-per-txn"; - public static final String AMQP_MULTI_TXN_PER_SESSION = "amqp:multi-txns-per-ssn"; - public static final String AMQP_OPEN = "amqp:open:list"; - public static final String AMQP_PROMOTABLE_TXN = "amqp:promotable-transactions"; - public static final String AMQP_PROPERTIES = "amqp:properties:list"; - public static final String AMQP_RECEIVED = "amqp:received:list"; - public static final String AMQP_REJECTED = "amqp:rejected:list"; - public static final String AMQP_RELEASED = "amqp:released:list"; - public static final String AMQP_SASL_CHALLENGE = "amqp:sasl-challenge:list"; - public static final String AMQP_SASL_INIT = "amqp:sasl-init:list"; - public static final String AMQP_SASL_MECHANISMS = "amqp:sasl-mechanisms:list"; - public static final String AMQP_SASL_OUTCOME = "amqp:sasl-outcome:list"; - public static final String AMQP_SASL_RESPONSE = "amqp:sasl-response:list"; - public static final String AMQP_SEQUENCE = "amqp:amqp-sequence:list"; - public static final String AMQP_SESSION_ERRANT_LINK = "amqp:session:errant-link"; - public static final String AMQP_SESSION_HANDLE_IN_USE = "amqp:session:handle-in-use"; - public static final String AMQP_SESSION_UNATTACHED_HANDLE = "amqp:session:unattached-handle"; - public static final String AMQP_SESSION_WINDOW_VIOLATION = "amqp:session:window-violation"; - public static final String AMQP_SOURCE = "amqp:source:list"; - public static final String AMQP_TARGET = "amqp:target:list"; - public static final String AMQP_TRANSFER = "amqp:transfer:list"; - public static final String AMQP_TXN_COORDINATOR = "amqp:coordinator:list"; - public static final String AMQP_TXN_DECLARE = "amqp:declare:list"; - public static final String AMQP_TXN_DECLARED = "amqp:declared:list"; - public static final String AMQP_TXN_DISCHARGE = "amqp:discharge:list"; - public static final String AMQP_TXN_ROLLBACK = "amqp:transaction:rollback"; - public static final String AMQP_TXN_STATE = "amqp:transactional-state:list"; - public static final String AMQP_TXN_TIMEOUT = "amqp:transaction:timeout"; - public static final String AMQP_TXN_UNKNOWN_ID = "amqp:transaction:unknown-id"; - public static final String AMQP_VALUE = "amqp:amqp-value:*"; - public static final String ANONYMOUS_RELAY = "ANONYMOUS-RELAY"; - public static final String ANNOTATION_KEY = "x-opt-jms-msg-type"; - public static final String APACHE_LEGACY_DIRECT_BINDING = "apache.org:legacy-amqp-direct-binding:string"; - public static final String APACHE_LEGACY_NO_LOCAL_FILTER = "apache.org:jms-no-local-filter:list"; - public static final String APACHE_LEGACY_SELECTOR_FILTER = "apache.org:jms-selector-filter:string"; - public static final String APACHE_LEGACY_TOPIC_BINDING = "apache.org:legacy-amqp-topic-binding:string"; - public static final String APACHE_NO_LOCAL_FILTER = "apache.org:no-local-filter:list"; - public static final String APACHE_SELECTOR_FILTER = "apache.org:selector-filter:string"; - public static final String APP_OCTET_STREAM = "application/octet-stream"; - public static final String APP_X_JAVA_SERIALIZED_OBJ = "application/x-java-serialized-object"; - public static final String CONNECTION_CLOSE = "connection-close"; - public static final String CONTAINER_ID = "container-id"; - public static final String COPY = "copy"; - public static final String DELAYED_DELIVERY = "DELAYED_DELIVERY"; - public static final String DELIVERY_TAG = "delivery-tag"; - public static final String DELIVERY_TIME = "x-opt-delivery-time"; - public static final String DISCARD_UNROUTABLE = "DISCARD_UNROUTABLE"; - public static final String FIELD = "field"; - public static final String FILTER = "filter"; - public static final String GLOBAL_CAPABILITY = "global"; - public static final String INVALID_FIELD = "invalid-field"; - public static final String LIFETIME_POLICY = "lifetime-policy"; - public static final String LINK_DETACH = "link-detach"; - public static final String MOVE = "move"; - public static final String NETWORK_HOST = "network-host"; - public static final String NEVER = "never"; - public static final String NOT_VALID_BEFORE = "x-qpid-not-valid-before"; - public static final String PRIORITY = "priority"; - public static final String PORT = "port"; - public static final String PRODUCT = "product"; - public static final String REJECT_UNROUTABLE = "REJECT_UNROUTABLE"; - public static final String SHARED_CAPABILITY = "shared"; - public static final String SESSION_END = "session-end"; - public static final String SHARED_SUBSCRIPTIONS = "SHARED-SUBS"; - public static final String SOLE_CONNECTION_ENFORCEMENT = "sole-connection-enforcement"; - public static final String SOLE_CONNECTION_ENFORCEMENT_POLICY = "sole-connection-enforcement-policy"; - public static final String SOLE_CONNECTION_DETECTION_POLICY = "sole-connection-detection-policy"; - public static final String SOLE_CONNECTION_FOR_CONTAINER = "sole-connection-for-container"; - public static final String SUPPORTED_DIST_MODES = "supported-dist-modes"; - public static final String TEMPORARY_QUEUE = "temporary-queue"; - public static final String TEMPORARY_TOPIC = "temporary-topic"; - public static final String TOPIC = "topic"; - public static final String TXN_ID = "txn-id"; - public static final String VERSION = "version"; } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java index f9f96a60d7..2c5e12ebfe 100644 --- a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/Symbols.java @@ -20,136 +20,17 @@ package org.apache.qpid.server.protocol.v1_0.constants; -import org.apache.qpid.server.protocol.v1_0.type.Symbol; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.capabilities.CapabilitiesSymbols; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.messaging.MessagingSymbols; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.security.SaslSymbols; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.transaction.TransactionSymbols; +import org.apache.qpid.server.protocol.v1_0.constants.amqp.transport.TransportSymbols; +import org.apache.qpid.server.protocol.v1_0.constants.qpid.QpidSymbols; /** - * Utility class to store constant Symbols. - * - * Please note that {@link SymbolTexts} contain the string definitions for this class and field names in {@link Symbols} - * must match the field names in {@link SymbolTexts}, otherwise the annotation processot in broker-codegen module will throw - * an exception during the compilation + * Aggregates all AMQP and Qpid-specific Symbol constants. + * Field names must match those in {@link SymbolTexts} for code generation mapping. */ -public final class Symbols +public interface Symbols extends TransportSymbols, MessagingSymbols, TransactionSymbols, SaslSymbols, CapabilitiesSymbols, QpidSymbols { - private Symbols() - { - - } - - public static final Symbol AMQP_ACCEPTED = Symbol.valueOf(SymbolTexts.AMQP_ACCEPTED); - public static final Symbol AMQP_APPLICATION_PROPERTIES = Symbol.valueOf(SymbolTexts.AMQP_APPLICATION_PROPERTIES); - public static final Symbol AMQP_CONN_ESTABLISHMENT_FAILED = Symbol.valueOf(SymbolTexts.AMQP_CONN_ESTABLISHMENT_FAILED); - public static final Symbol AMQP_CONN_FORCED = Symbol.valueOf(SymbolTexts.AMQP_CONN_FORCED); - public static final Symbol AMQP_CONN_FRAMING_ERROR = Symbol.valueOf(SymbolTexts.AMQP_CONN_FRAMING_ERROR); - public static final Symbol AMQP_CONN_REDIRECT = Symbol.valueOf(SymbolTexts.AMQP_CONN_REDIRECT); - public static final Symbol AMQP_CONN_SOCKET_ERROR = Symbol.valueOf(SymbolTexts.AMQP_CONN_SOCKET_ERROR); - public static final Symbol AMQP_DATA = Symbol.valueOf(SymbolTexts.AMQP_DATA); - public static final Symbol AMQP_DELETE_ON_CLOSE = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_CLOSE); - public static final Symbol AMQP_DELETE_ON_NO_LINKS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_LINKS); - public static final Symbol AMQP_DELETE_ON_NO_LINKS_OR_MSGS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_LINKS_OR_MSGS); - public static final Symbol AMQP_DELETE_ON_NO_MSGS = Symbol.valueOf(SymbolTexts.AMQP_DELETE_ON_NO_MSGS); - public static final Symbol AMQP_DETACH = Symbol.valueOf(SymbolTexts.AMQP_DETACH); - public static final Symbol AMQP_DELIVERY_ANNOTATIONS = Symbol.valueOf(SymbolTexts.AMQP_DELIVERY_ANNOTATIONS); - public static final Symbol AMQP_DISPOSITION = Symbol.valueOf(SymbolTexts.AMQP_DISPOSITION); - public static final Symbol AMQP_DISTRIBUTED_TXN = Symbol.valueOf(SymbolTexts.AMQP_DISTRIBUTED_TXN); - public static final Symbol AMQP_END = Symbol.valueOf(SymbolTexts.AMQP_END); - public static final Symbol AMQP_ERROR = Symbol.valueOf(SymbolTexts.AMQP_ERROR); - public static final Symbol AMQP_ERR_DECODE = Symbol.valueOf(SymbolTexts.AMQP_ERR_DECODE); - public static final Symbol AMQP_ERR_FRAME_SIZE_TOO_SMALL = Symbol.valueOf(SymbolTexts.AMQP_ERR_FRAME_SIZE_TOO_SMALL); - public static final Symbol AMQP_ERR_ILLEGAL_STATE = Symbol.valueOf(SymbolTexts.AMQP_ERR_ILLEGAL_STATE); - public static final Symbol AMQP_ERR_INTERNAL = Symbol.valueOf(SymbolTexts.AMQP_ERR_INTERNAL); - public static final Symbol AMQP_ERR_INVALID_FIELD = Symbol.valueOf(SymbolTexts.AMQP_ERR_INVALID_FIELD); - public static final Symbol AMQP_ERR_NOT_ALLOWED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_ALLOWED); - public static final Symbol AMQP_ERR_NOT_AUTHORIZED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_AUTHORIZED); - public static final Symbol AMQP_ERR_NOT_FOUND = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_FOUND); - public static final Symbol AMQP_ERR_NOT_IMPLEMENTED = Symbol.valueOf(SymbolTexts.AMQP_ERR_NOT_IMPLEMENTED); - public static final Symbol AMQP_ERR_PRECONDITION_FAILED = Symbol.valueOf(SymbolTexts.AMQP_ERR_PRECONDITION_FAILED); - public static final Symbol AMQP_ERR_RESOURCE_DELETED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_DELETED); - public static final Symbol AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_LIMIT_EXCEEDED); - public static final Symbol AMQP_ERR_RESOURCE_LOCKED = Symbol.valueOf(SymbolTexts.AMQP_ERR_RESOURCE_LOCKED); - public static final Symbol AMQP_FLOW = Symbol.valueOf(SymbolTexts.AMQP_FLOW); - public static final Symbol AMQP_FOOTER = Symbol.valueOf(SymbolTexts.AMQP_FOOTER); - public static final Symbol AMQP_HEADER = Symbol.valueOf(SymbolTexts.AMQP_HEADER); - public static final Symbol AMQP_LINK_DETACH_FORCED = Symbol.valueOf(SymbolTexts.AMQP_LINK_DETACH_FORCED); - public static final Symbol AMQP_LINK_MSG_SIZE_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_LINK_MSG_SIZE_EXCEEDED); - public static final Symbol AMQP_LINK_REDIRECT = Symbol.valueOf(SymbolTexts.AMQP_LINK_REDIRECT); - public static final Symbol AMQP_LINK_STOLEN = Symbol.valueOf(SymbolTexts.AMQP_LINK_STOLEN); - public static final Symbol AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = Symbol.valueOf(SymbolTexts.AMQP_LINK_TRANSFER_LIMIT_EXCEEDED); - public static final Symbol AMQP_LOCAL_TXN = Symbol.valueOf(SymbolTexts.AMQP_LOCAL_TXN); - public static final Symbol AMQP_MESSAGE_ANNOTATIONS = Symbol.valueOf(SymbolTexts.AMQP_MESSAGE_ANNOTATIONS); - public static final Symbol AMQP_MODIFIED = Symbol.valueOf(SymbolTexts.AMQP_MODIFIED); - public static final Symbol AMQP_MULTI_SESSIONS_PER_TXN = Symbol.valueOf(SymbolTexts.AMQP_MULTI_SESSIONS_PER_TXN); - public static final Symbol AMQP_MULTI_TXN_PER_SESSION = Symbol.valueOf(SymbolTexts.AMQP_MULTI_TXN_PER_SESSION); - public static final Symbol AMQP_OPEN = Symbol.valueOf(SymbolTexts.AMQP_OPEN); - public static final Symbol AMQP_PROMOTABLE_TXN = Symbol.valueOf(SymbolTexts.AMQP_PROMOTABLE_TXN); - public static final Symbol AMQP_PROPERTIES = Symbol.valueOf(SymbolTexts.AMQP_PROPERTIES); - public static final Symbol AMQP_RECEIVED = Symbol.valueOf(SymbolTexts.AMQP_RECEIVED); - public static final Symbol AMQP_REJECTED = Symbol.valueOf(SymbolTexts.AMQP_REJECTED); - public static final Symbol AMQP_RELEASED = Symbol.valueOf(SymbolTexts.AMQP_RELEASED); - public static final Symbol AMQP_SASL_CHALLENGE = Symbol.valueOf(SymbolTexts.AMQP_SASL_CHALLENGE); - public static final Symbol AMQP_SASL_INIT = Symbol.valueOf(SymbolTexts.AMQP_SASL_INIT); - public static final Symbol AMQP_SASL_MECHANISMS = Symbol.valueOf(SymbolTexts.AMQP_SASL_MECHANISMS); - public static final Symbol AMQP_SASL_OUTCOME = Symbol.valueOf(SymbolTexts.AMQP_SASL_OUTCOME); - public static final Symbol AMQP_SASL_RESPONSE = Symbol.valueOf(SymbolTexts.AMQP_SASL_RESPONSE); - public static final Symbol AMQP_SEQUENCE = Symbol.valueOf(SymbolTexts.AMQP_SEQUENCE); - public static final Symbol AMQP_SESSION_ERRANT_LINK = Symbol.valueOf(SymbolTexts.AMQP_SESSION_ERRANT_LINK); - public static final Symbol AMQP_SESSION_HANDLE_IN_USE = Symbol.valueOf(SymbolTexts.AMQP_SESSION_HANDLE_IN_USE); - public static final Symbol AMQP_SESSION_UNATTACHED_HANDLE = Symbol.valueOf(SymbolTexts.AMQP_SESSION_UNATTACHED_HANDLE); - public static final Symbol AMQP_SESSION_WINDOW_VIOLATION = Symbol.valueOf(SymbolTexts.AMQP_SESSION_WINDOW_VIOLATION); - public static final Symbol AMQP_SOURCE = Symbol.valueOf(SymbolTexts.AMQP_SOURCE); - public static final Symbol AMQP_TARGET = Symbol.valueOf(SymbolTexts.AMQP_TARGET); - public static final Symbol AMQP_TRANSFER = Symbol.valueOf(SymbolTexts.AMQP_TRANSFER); - public static final Symbol AMQP_TXN_COORDINATOR = Symbol.valueOf(SymbolTexts.AMQP_TXN_COORDINATOR); - public static final Symbol AMQP_TXN_DECLARE = Symbol.valueOf(SymbolTexts.AMQP_TXN_DECLARE); - public static final Symbol AMQP_TXN_DECLARED = Symbol.valueOf(SymbolTexts.AMQP_TXN_DECLARED); - public static final Symbol AMQP_TXN_DISCHARGE = Symbol.valueOf(SymbolTexts.AMQP_TXN_DISCHARGE); - public static final Symbol AMQP_TXN_ROLLBACK = Symbol.valueOf(SymbolTexts.AMQP_TXN_ROLLBACK); - public static final Symbol AMQP_TXN_STATE = Symbol.valueOf(SymbolTexts.AMQP_TXN_STATE); - public static final Symbol AMQP_TXN_TIMEOUT = Symbol.valueOf(SymbolTexts.AMQP_TXN_TIMEOUT); - public static final Symbol AMQP_TXN_UNKNOWN_ID = Symbol.valueOf(SymbolTexts.AMQP_TXN_UNKNOWN_ID); - public static final Symbol AMQP_VALUE = Symbol.valueOf(SymbolTexts.AMQP_VALUE); - public static final Symbol ANONYMOUS_RELAY = Symbol.valueOf(SymbolTexts.ANONYMOUS_RELAY); - public static final Symbol ANNOTATION_KEY = Symbol.valueOf(SymbolTexts.ANNOTATION_KEY); - public static final Symbol APACHE_LEGACY_DIRECT_BINDING = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_DIRECT_BINDING); - public static final Symbol APACHE_LEGACY_NO_LOCAL_FILTER = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_NO_LOCAL_FILTER); - public static final Symbol APACHE_LEGACY_SELECTOR_FILTER = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_SELECTOR_FILTER); - public static final Symbol APACHE_LEGACY_TOPIC_BINDING = Symbol.valueOf(SymbolTexts.APACHE_LEGACY_TOPIC_BINDING); - public static final Symbol APACHE_NO_LOCAL_FILTER = Symbol.valueOf(SymbolTexts.APACHE_NO_LOCAL_FILTER); - public static final Symbol APACHE_SELECTOR_FILTER = Symbol.valueOf(SymbolTexts.APACHE_SELECTOR_FILTER); - public static final Symbol APP_OCTET_STREAM = Symbol.valueOf(SymbolTexts.APP_OCTET_STREAM); - public static final Symbol APP_X_JAVA_SERIALIZED_OBJ = Symbol.valueOf(SymbolTexts.APP_X_JAVA_SERIALIZED_OBJ); - public static final Symbol CONNECTION_CLOSE = Symbol.valueOf(SymbolTexts.CONNECTION_CLOSE); - public static final Symbol CONTAINER_ID = Symbol.valueOf(SymbolTexts.CONTAINER_ID); - public static final Symbol COPY = Symbol.valueOf(SymbolTexts.COPY); - public static final Symbol DELAYED_DELIVERY = Symbol.valueOf(SymbolTexts.DELAYED_DELIVERY); - public static final Symbol DELIVERY_TAG = Symbol.valueOf(SymbolTexts.DELIVERY_TAG); - public static final Symbol DELIVERY_TIME = Symbol.valueOf(SymbolTexts.DELIVERY_TIME); - public static final Symbol DISCARD_UNROUTABLE = Symbol.valueOf(SymbolTexts.DISCARD_UNROUTABLE); - public static final Symbol FIELD = Symbol.valueOf(SymbolTexts.FIELD); - public static final Symbol FILTER = Symbol.valueOf(SymbolTexts.FILTER); - public static final Symbol GLOBAL_CAPABILITY = Symbol.getSymbol(SymbolTexts.GLOBAL_CAPABILITY); - public static final Symbol INVALID_FIELD = Symbol.valueOf(SymbolTexts.INVALID_FIELD); - public static final Symbol LIFETIME_POLICY = Symbol.valueOf(SymbolTexts.LIFETIME_POLICY); - public static final Symbol LINK_DETACH = Symbol.valueOf(SymbolTexts.LINK_DETACH); - public static final Symbol MOVE = Symbol.valueOf(SymbolTexts.MOVE); - public static final Symbol NETWORK_HOST = Symbol.valueOf(SymbolTexts.NETWORK_HOST); - public static final Symbol NEVER = Symbol.valueOf(SymbolTexts.NEVER); - public static final Symbol NOT_VALID_BEFORE = Symbol.valueOf(SymbolTexts.NOT_VALID_BEFORE); - public static final Symbol PRIORITY = Symbol.valueOf(SymbolTexts.PRIORITY); - public static final Symbol PORT = Symbol.valueOf(SymbolTexts.PORT); - public static final Symbol PRODUCT = Symbol.valueOf(SymbolTexts.PRODUCT); - public static final Symbol REJECT_UNROUTABLE = Symbol.valueOf(SymbolTexts.REJECT_UNROUTABLE); - public static final Symbol SHARED_CAPABILITY = Symbol.getSymbol(SymbolTexts.SHARED_CAPABILITY); - public static final Symbol SESSION_END = Symbol.valueOf(SymbolTexts.SESSION_END); - public static final Symbol SHARED_SUBSCRIPTIONS = Symbol.valueOf(SymbolTexts.SHARED_SUBSCRIPTIONS); - public static final Symbol SOLE_CONNECTION_ENFORCEMENT = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_ENFORCEMENT); - public static final Symbol SOLE_CONNECTION_ENFORCEMENT_POLICY = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_ENFORCEMENT_POLICY); - public static final Symbol SOLE_CONNECTION_DETECTION_POLICY = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_DETECTION_POLICY); - public static final Symbol SOLE_CONNECTION_FOR_CONTAINER = Symbol.valueOf(SymbolTexts.SOLE_CONNECTION_FOR_CONTAINER); - public static final Symbol SUPPORTED_DIST_MODES = Symbol.valueOf(SymbolTexts.SUPPORTED_DIST_MODES); - public static final Symbol TEMPORARY_QUEUE = Symbol.valueOf(SymbolTexts.TEMPORARY_QUEUE); - public static final Symbol TEMPORARY_TOPIC = Symbol.valueOf(SymbolTexts.TEMPORARY_TOPIC); - public static final Symbol TOPIC = Symbol.valueOf(SymbolTexts.TOPIC); - public static final Symbol TXN_ID = Symbol.valueOf(SymbolTexts.TXN_ID); - public static final Symbol VERSION = Symbol.valueOf(SymbolTexts.VERSION); } diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbolTexts.java new file mode 100644 index 0000000000..f9a1c81f34 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbolTexts.java @@ -0,0 +1,31 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.capabilities; + +/** + * Capability symbol text constants. + */ +public interface CapabilitiesSymbolTexts +{ + String ANONYMOUS_RELAY = "ANONYMOUS-RELAY"; + String GLOBAL_CAPABILITY = "global"; + String SHARED_CAPABILITY = "shared"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbols.java new file mode 100644 index 0000000000..598d3030ea --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/capabilities/CapabilitiesSymbols.java @@ -0,0 +1,33 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.capabilities; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +/** + * Capability symbol constants. + */ +public interface CapabilitiesSymbols +{ + Symbol ANONYMOUS_RELAY = Symbol.valueOf(CapabilitiesSymbolTexts.ANONYMOUS_RELAY); + Symbol GLOBAL_CAPABILITY = Symbol.getSymbol(CapabilitiesSymbolTexts.GLOBAL_CAPABILITY); + Symbol SHARED_CAPABILITY = Symbol.getSymbol(CapabilitiesSymbolTexts.SHARED_CAPABILITY); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbolTexts.java new file mode 100644 index 0000000000..3f81b076d8 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbolTexts.java @@ -0,0 +1,60 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.messaging; + +public interface MessagingSymbolTexts +{ + String AMQP_ACCEPTED = "amqp:accepted:list"; + String AMQP_APPLICATION_PROPERTIES = "amqp:application-properties:map"; + String AMQP_DATA = "amqp:data:binary"; + String AMQP_DELETE_ON_CLOSE = "amqp:delete-on-close:list"; + String AMQP_DELETE_ON_NO_LINKS = "amqp:delete-on-no-links:list"; + String AMQP_DELETE_ON_NO_LINKS_OR_MSGS = "amqp:delete-on-no-links-or-messages:list"; + String AMQP_DELETE_ON_NO_MSGS = "amqp:delete-on-no-messages:list"; + String AMQP_DELIVERY_ANNOTATIONS = "amqp:delivery-annotations:map"; + String AMQP_FOOTER = "amqp:footer:map"; + String AMQP_HEADER = "amqp:header:list"; + String AMQP_MESSAGE_ANNOTATIONS = "amqp:message-annotations:map"; + String AMQP_MODIFIED = "amqp:modified:list"; + String AMQP_PROPERTIES = "amqp:properties:list"; + String AMQP_RECEIVED = "amqp:received:list"; + String AMQP_REJECTED = "amqp:rejected:list"; + String AMQP_RELEASED = "amqp:released:list"; + String AMQP_SEQUENCE = "amqp:amqp-sequence:list"; + String AMQP_SOURCE = "amqp:source:list"; + String AMQP_TARGET = "amqp:target:list"; + String AMQP_VALUE = "amqp:amqp-value:*"; + String CONNECTION_CLOSE = "connection-close"; + String ANNOTATION_KEY = "x-opt-jms-msg-type"; + String COPY = "copy"; + String DELIVERY_TAG = "delivery-tag"; + String DELIVERY_TIME = "x-opt-delivery-time"; + String LIFETIME_POLICY = "lifetime-policy"; + String LINK_DETACH = "link-detach"; + String MOVE = "move"; + String NEVER = "never"; + String PRIORITY = "priority"; + String SESSION_END = "session-end"; + String SUPPORTED_DIST_MODES = "supported-dist-modes"; + String TEMPORARY_QUEUE = "temporary-queue"; + String TEMPORARY_TOPIC = "temporary-topic"; + String TOPIC = "topic"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbols.java new file mode 100644 index 0000000000..17cb37874e --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/messaging/MessagingSymbols.java @@ -0,0 +1,62 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.messaging; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +public interface MessagingSymbols +{ + Symbol AMQP_ACCEPTED = Symbol.valueOf(MessagingSymbolTexts.AMQP_ACCEPTED); + Symbol AMQP_APPLICATION_PROPERTIES = Symbol.valueOf(MessagingSymbolTexts.AMQP_APPLICATION_PROPERTIES); + Symbol AMQP_DATA = Symbol.valueOf(MessagingSymbolTexts.AMQP_DATA); + Symbol AMQP_DELETE_ON_CLOSE = Symbol.valueOf(MessagingSymbolTexts.AMQP_DELETE_ON_CLOSE); + Symbol AMQP_DELETE_ON_NO_LINKS = Symbol.valueOf(MessagingSymbolTexts.AMQP_DELETE_ON_NO_LINKS); + Symbol AMQP_DELETE_ON_NO_LINKS_OR_MSGS = Symbol.valueOf(MessagingSymbolTexts.AMQP_DELETE_ON_NO_LINKS_OR_MSGS); + Symbol AMQP_DELETE_ON_NO_MSGS = Symbol.valueOf(MessagingSymbolTexts.AMQP_DELETE_ON_NO_MSGS); + Symbol AMQP_DELIVERY_ANNOTATIONS = Symbol.valueOf(MessagingSymbolTexts.AMQP_DELIVERY_ANNOTATIONS); + Symbol AMQP_FOOTER = Symbol.valueOf(MessagingSymbolTexts.AMQP_FOOTER); + Symbol AMQP_HEADER = Symbol.valueOf(MessagingSymbolTexts.AMQP_HEADER); + Symbol AMQP_MESSAGE_ANNOTATIONS = Symbol.valueOf(MessagingSymbolTexts.AMQP_MESSAGE_ANNOTATIONS); + Symbol AMQP_MODIFIED = Symbol.valueOf(MessagingSymbolTexts.AMQP_MODIFIED); + Symbol AMQP_PROPERTIES = Symbol.valueOf(MessagingSymbolTexts.AMQP_PROPERTIES); + Symbol AMQP_RECEIVED = Symbol.valueOf(MessagingSymbolTexts.AMQP_RECEIVED); + Symbol AMQP_REJECTED = Symbol.valueOf(MessagingSymbolTexts.AMQP_REJECTED); + Symbol AMQP_RELEASED = Symbol.valueOf(MessagingSymbolTexts.AMQP_RELEASED); + Symbol AMQP_SEQUENCE = Symbol.valueOf(MessagingSymbolTexts.AMQP_SEQUENCE); + Symbol AMQP_SOURCE = Symbol.valueOf(MessagingSymbolTexts.AMQP_SOURCE); + Symbol AMQP_TARGET = Symbol.valueOf(MessagingSymbolTexts.AMQP_TARGET); + Symbol AMQP_VALUE = Symbol.valueOf(MessagingSymbolTexts.AMQP_VALUE); + Symbol ANNOTATION_KEY = Symbol.valueOf(MessagingSymbolTexts.ANNOTATION_KEY); + Symbol CONNECTION_CLOSE = Symbol.valueOf(MessagingSymbolTexts.CONNECTION_CLOSE); + Symbol COPY = Symbol.valueOf(MessagingSymbolTexts.COPY); + Symbol DELIVERY_TAG = Symbol.valueOf(MessagingSymbolTexts.DELIVERY_TAG); + Symbol DELIVERY_TIME = Symbol.valueOf(MessagingSymbolTexts.DELIVERY_TIME); + Symbol LIFETIME_POLICY = Symbol.valueOf(MessagingSymbolTexts.LIFETIME_POLICY); + Symbol LINK_DETACH = Symbol.valueOf(MessagingSymbolTexts.LINK_DETACH); + Symbol MOVE = Symbol.valueOf(MessagingSymbolTexts.MOVE); + Symbol NEVER = Symbol.valueOf(MessagingSymbolTexts.NEVER); + Symbol PRIORITY = Symbol.valueOf(MessagingSymbolTexts.PRIORITY); + Symbol SESSION_END = Symbol.valueOf(MessagingSymbolTexts.SESSION_END); + Symbol SUPPORTED_DIST_MODES = Symbol.valueOf(MessagingSymbolTexts.SUPPORTED_DIST_MODES); + Symbol TEMPORARY_QUEUE = Symbol.valueOf(MessagingSymbolTexts.TEMPORARY_QUEUE); + Symbol TEMPORARY_TOPIC = Symbol.valueOf(MessagingSymbolTexts.TEMPORARY_TOPIC); + Symbol TOPIC = Symbol.valueOf(MessagingSymbolTexts.TOPIC); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbolTexts.java new file mode 100644 index 0000000000..433fb10c2e --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbolTexts.java @@ -0,0 +1,30 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.security; + +public interface SaslSymbolTexts +{ + String AMQP_SASL_CHALLENGE = "amqp:sasl-challenge:list"; + String AMQP_SASL_INIT = "amqp:sasl-init:list"; + String AMQP_SASL_MECHANISMS = "amqp:sasl-mechanisms:list"; + String AMQP_SASL_OUTCOME = "amqp:sasl-outcome:list"; + String AMQP_SASL_RESPONSE = "amqp:sasl-response:list"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbols.java new file mode 100644 index 0000000000..69a753bbfe --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/security/SaslSymbols.java @@ -0,0 +1,32 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.security; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +public interface SaslSymbols +{ + Symbol AMQP_SASL_CHALLENGE = Symbol.valueOf(SaslSymbolTexts.AMQP_SASL_CHALLENGE); + Symbol AMQP_SASL_INIT = Symbol.valueOf(SaslSymbolTexts.AMQP_SASL_INIT); + Symbol AMQP_SASL_MECHANISMS = Symbol.valueOf(SaslSymbolTexts.AMQP_SASL_MECHANISMS); + Symbol AMQP_SASL_OUTCOME = Symbol.valueOf(SaslSymbolTexts.AMQP_SASL_OUTCOME); + Symbol AMQP_SASL_RESPONSE = Symbol.valueOf(SaslSymbolTexts.AMQP_SASL_RESPONSE); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbolTexts.java new file mode 100644 index 0000000000..57c77afb44 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbolTexts.java @@ -0,0 +1,39 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.transaction; + +public interface TransactionSymbolTexts +{ + String AMQP_DISTRIBUTED_TXN = "amqp:distributed-transactions"; + String AMQP_LOCAL_TXN = "amqp:local-transactions"; + String AMQP_MULTI_SESSIONS_PER_TXN = "amqp:multi-ssns-per-txn"; + String AMQP_MULTI_TXN_PER_SESSION = "amqp:multi-txns-per-ssn"; + String AMQP_PROMOTABLE_TXN = "amqp:promotable-transactions"; + String AMQP_TXN_COORDINATOR = "amqp:coordinator:list"; + String AMQP_TXN_DECLARE = "amqp:declare:list"; + String AMQP_TXN_DECLARED = "amqp:declared:list"; + String AMQP_TXN_DISCHARGE = "amqp:discharge:list"; + String AMQP_TXN_ROLLBACK = "amqp:transaction:rollback"; + String AMQP_TXN_STATE = "amqp:transactional-state:list"; + String AMQP_TXN_TIMEOUT = "amqp:transaction:timeout"; + String AMQP_TXN_UNKNOWN_ID = "amqp:transaction:unknown-id"; + String TXN_ID = "txn-id"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbols.java new file mode 100644 index 0000000000..adea4ebf3f --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transaction/TransactionSymbols.java @@ -0,0 +1,41 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.transaction; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +public interface TransactionSymbols +{ + Symbol AMQP_DISTRIBUTED_TXN = Symbol.valueOf(TransactionSymbolTexts.AMQP_DISTRIBUTED_TXN); + Symbol AMQP_LOCAL_TXN = Symbol.valueOf(TransactionSymbolTexts.AMQP_LOCAL_TXN); + Symbol AMQP_MULTI_SESSIONS_PER_TXN = Symbol.valueOf(TransactionSymbolTexts.AMQP_MULTI_SESSIONS_PER_TXN); + Symbol AMQP_MULTI_TXN_PER_SESSION = Symbol.valueOf(TransactionSymbolTexts.AMQP_MULTI_TXN_PER_SESSION); + Symbol AMQP_PROMOTABLE_TXN = Symbol.valueOf(TransactionSymbolTexts.AMQP_PROMOTABLE_TXN); + Symbol AMQP_TXN_COORDINATOR = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_COORDINATOR); + Symbol AMQP_TXN_DECLARE = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_DECLARE); + Symbol AMQP_TXN_DECLARED = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_DECLARED); + Symbol AMQP_TXN_DISCHARGE = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_DISCHARGE); + Symbol AMQP_TXN_ROLLBACK = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_ROLLBACK); + Symbol AMQP_TXN_STATE = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_STATE); + Symbol AMQP_TXN_TIMEOUT = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_TIMEOUT); + Symbol AMQP_TXN_UNKNOWN_ID = Symbol.valueOf(TransactionSymbolTexts.AMQP_TXN_UNKNOWN_ID); + Symbol TXN_ID = Symbol.valueOf(TransactionSymbolTexts.TXN_ID); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbolTexts.java new file mode 100644 index 0000000000..4762aedb6d --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbolTexts.java @@ -0,0 +1,75 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.transport; + +public interface TransportSymbolTexts +{ + String AMQP_ATTACH = "amqp:attach:list"; + String AMQP_BEGIN = "amqp:begin:list"; + String AMQP_CLOSE = "amqp:close:list"; + String AMQP_CONN_ESTABLISHMENT_FAILED = "amqp:connection-establishment-failed"; + String AMQP_CONN_FORCED = "amqp:connection:forced"; + String AMQP_CONN_FRAMING_ERROR = "amqp:connection:framing-error"; + String AMQP_CONN_REDIRECT = "amqp:connection:redirect"; + String AMQP_CONN_SOCKET_ERROR = "amqp:connection:socket-error"; + String AMQP_DETACH = "amqp:detach:list"; + String AMQP_DISPOSITION = "amqp:disposition:list"; + String AMQP_END = "amqp:end:list"; + String AMQP_ERROR = "amqp:error:list"; + String AMQP_ERR_DECODE = "amqp:decode-error"; + String AMQP_ERR_FRAME_SIZE_TOO_SMALL = "amqp:frame-size-too-small"; + String AMQP_ERR_ILLEGAL_STATE = "amqp:illegal-state"; + String AMQP_ERR_INTERNAL = "amqp:internal-error"; + String AMQP_ERR_INVALID_FIELD = "amqp:invalid-field"; + String AMQP_ERR_NOT_ALLOWED = "amqp:not-allowed"; + String AMQP_ERR_NOT_AUTHORIZED = "amqp:unauthorized-access"; + String AMQP_ERR_NOT_FOUND = "amqp:not-found"; + String AMQP_ERR_NOT_IMPLEMENTED = "amqp:not-implemented"; + String AMQP_ERR_PRECONDITION_FAILED = "amqp:precondition-failed"; + String AMQP_ERR_RESOURCE_DELETED = "amqp:resource-deleted"; + String AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = "amqp:resource-limit-exceeded"; + String AMQP_ERR_RESOURCE_LOCKED = "amqp:resource-locked"; + String AMQP_FLOW = "amqp:flow:list"; + String AMQP_LINK_DETACH_FORCED = "amqp:link:detach-forced"; + String AMQP_LINK_MSG_SIZE_EXCEEDED = "amqp:link:message-size-exceeded"; + String AMQP_LINK_REDIRECT = "amqp:link:redirect"; + String AMQP_LINK_STOLEN = "amqp:link:stolen"; + String AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = "amqp:link:transfer-limit-exceeded"; + String AMQP_OPEN = "amqp:open:list"; + String AMQP_SESSION_ERRANT_LINK = "amqp:session:errant-link"; + String AMQP_SESSION_HANDLE_IN_USE = "amqp:session:handle-in-use"; + String AMQP_SESSION_UNATTACHED_HANDLE = "amqp:session:unattached-handle"; + String AMQP_SESSION_WINDOW_VIOLATION = "amqp:session:window-violation"; + String AMQP_TRANSFER = "amqp:transfer:list"; + String CONTAINER_ID = "container-id"; + String FIELD = "field"; + String FILTER = "filter"; + String INVALID_FIELD = "invalid-field"; + String NETWORK_HOST = "network-host"; + String PORT = "port"; + String PRODUCT = "product"; + String SHARED_SUBSCRIPTIONS = "SHARED-SUBS"; + String SOLE_CONNECTION_DETECTION_POLICY = "sole-connection-detection-policy"; + String SOLE_CONNECTION_ENFORCEMENT = "sole-connection-enforcement"; + String SOLE_CONNECTION_ENFORCEMENT_POLICY = "sole-connection-enforcement-policy"; + String SOLE_CONNECTION_FOR_CONTAINER = "sole-connection-for-container"; + String VERSION = "version"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbols.java new file mode 100644 index 0000000000..793ee7ce60 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/amqp/transport/TransportSymbols.java @@ -0,0 +1,77 @@ +/* + * 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.server.protocol.v1_0.constants.amqp.transport; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +public interface TransportSymbols +{ + Symbol AMQP_ATTACH = Symbol.valueOf(TransportSymbolTexts.AMQP_ATTACH); + Symbol AMQP_BEGIN = Symbol.valueOf(TransportSymbolTexts.AMQP_BEGIN); + Symbol AMQP_CLOSE = Symbol.valueOf(TransportSymbolTexts.AMQP_CLOSE); + Symbol AMQP_CONN_ESTABLISHMENT_FAILED = Symbol.valueOf(TransportSymbolTexts.AMQP_CONN_ESTABLISHMENT_FAILED); + Symbol AMQP_CONN_FORCED = Symbol.valueOf(TransportSymbolTexts.AMQP_CONN_FORCED); + Symbol AMQP_CONN_FRAMING_ERROR = Symbol.valueOf(TransportSymbolTexts.AMQP_CONN_FRAMING_ERROR); + Symbol AMQP_CONN_REDIRECT = Symbol.valueOf(TransportSymbolTexts.AMQP_CONN_REDIRECT); + Symbol AMQP_CONN_SOCKET_ERROR = Symbol.valueOf(TransportSymbolTexts.AMQP_CONN_SOCKET_ERROR); + Symbol AMQP_DETACH = Symbol.valueOf(TransportSymbolTexts.AMQP_DETACH); + Symbol AMQP_DISPOSITION = Symbol.valueOf(TransportSymbolTexts.AMQP_DISPOSITION); + Symbol AMQP_END = Symbol.valueOf(TransportSymbolTexts.AMQP_END); + Symbol AMQP_ERROR = Symbol.valueOf(TransportSymbolTexts.AMQP_ERROR); + Symbol AMQP_ERR_DECODE = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_DECODE); + Symbol AMQP_ERR_FRAME_SIZE_TOO_SMALL = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_FRAME_SIZE_TOO_SMALL); + Symbol AMQP_ERR_ILLEGAL_STATE = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_ILLEGAL_STATE); + Symbol AMQP_ERR_INTERNAL = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_INTERNAL); + Symbol AMQP_ERR_INVALID_FIELD = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_INVALID_FIELD); + Symbol AMQP_ERR_NOT_ALLOWED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_NOT_ALLOWED); + Symbol AMQP_ERR_NOT_AUTHORIZED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_NOT_AUTHORIZED); + Symbol AMQP_ERR_NOT_FOUND = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_NOT_FOUND); + Symbol AMQP_ERR_NOT_IMPLEMENTED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_NOT_IMPLEMENTED); + Symbol AMQP_ERR_PRECONDITION_FAILED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_PRECONDITION_FAILED); + Symbol AMQP_ERR_RESOURCE_DELETED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_RESOURCE_DELETED); + Symbol AMQP_ERR_RESOURCE_LIMIT_EXCEEDED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_RESOURCE_LIMIT_EXCEEDED); + Symbol AMQP_ERR_RESOURCE_LOCKED = Symbol.valueOf(TransportSymbolTexts.AMQP_ERR_RESOURCE_LOCKED); + Symbol AMQP_FLOW = Symbol.valueOf(TransportSymbolTexts.AMQP_FLOW); + Symbol AMQP_LINK_DETACH_FORCED = Symbol.valueOf(TransportSymbolTexts.AMQP_LINK_DETACH_FORCED); + Symbol AMQP_LINK_MSG_SIZE_EXCEEDED = Symbol.valueOf(TransportSymbolTexts.AMQP_LINK_MSG_SIZE_EXCEEDED); + Symbol AMQP_LINK_REDIRECT = Symbol.valueOf(TransportSymbolTexts.AMQP_LINK_REDIRECT); + Symbol AMQP_LINK_STOLEN = Symbol.valueOf(TransportSymbolTexts.AMQP_LINK_STOLEN); + Symbol AMQP_LINK_TRANSFER_LIMIT_EXCEEDED = Symbol.valueOf(TransportSymbolTexts.AMQP_LINK_TRANSFER_LIMIT_EXCEEDED); + Symbol AMQP_OPEN = Symbol.valueOf(TransportSymbolTexts.AMQP_OPEN); + Symbol AMQP_SESSION_ERRANT_LINK = Symbol.valueOf(TransportSymbolTexts.AMQP_SESSION_ERRANT_LINK); + Symbol AMQP_SESSION_HANDLE_IN_USE = Symbol.valueOf(TransportSymbolTexts.AMQP_SESSION_HANDLE_IN_USE); + Symbol AMQP_SESSION_UNATTACHED_HANDLE = Symbol.valueOf(TransportSymbolTexts.AMQP_SESSION_UNATTACHED_HANDLE); + Symbol AMQP_SESSION_WINDOW_VIOLATION = Symbol.valueOf(TransportSymbolTexts.AMQP_SESSION_WINDOW_VIOLATION); + Symbol AMQP_TRANSFER = Symbol.valueOf(TransportSymbolTexts.AMQP_TRANSFER); + Symbol CONTAINER_ID = Symbol.valueOf(TransportSymbolTexts.CONTAINER_ID); + Symbol FIELD = Symbol.valueOf(TransportSymbolTexts.FIELD); + Symbol FILTER = Symbol.valueOf(TransportSymbolTexts.FILTER); + Symbol INVALID_FIELD = Symbol.valueOf(TransportSymbolTexts.INVALID_FIELD); + Symbol NETWORK_HOST = Symbol.valueOf(TransportSymbolTexts.NETWORK_HOST); + Symbol PORT = Symbol.valueOf(TransportSymbolTexts.PORT); + Symbol PRODUCT = Symbol.valueOf(TransportSymbolTexts.PRODUCT); + Symbol SHARED_SUBSCRIPTIONS = Symbol.valueOf(TransportSymbolTexts.SHARED_SUBSCRIPTIONS); + Symbol SOLE_CONNECTION_DETECTION_POLICY = Symbol.valueOf(TransportSymbolTexts.SOLE_CONNECTION_DETECTION_POLICY); + Symbol SOLE_CONNECTION_ENFORCEMENT = Symbol.valueOf(TransportSymbolTexts.SOLE_CONNECTION_ENFORCEMENT); + Symbol SOLE_CONNECTION_ENFORCEMENT_POLICY = Symbol.valueOf(TransportSymbolTexts.SOLE_CONNECTION_ENFORCEMENT_POLICY); + Symbol SOLE_CONNECTION_FOR_CONTAINER = Symbol.valueOf(TransportSymbolTexts.SOLE_CONNECTION_FOR_CONTAINER); + Symbol VERSION = Symbol.valueOf(TransportSymbolTexts.VERSION); +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbolTexts.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbolTexts.java new file mode 100644 index 0000000000..0f3b35b880 --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbolTexts.java @@ -0,0 +1,37 @@ +/* + * 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.server.protocol.v1_0.constants.qpid; + +public interface QpidSymbolTexts +{ + String APACHE_LEGACY_DIRECT_BINDING = "apache.org:legacy-amqp-direct-binding:string"; + String APACHE_LEGACY_NO_LOCAL_FILTER = "apache.org:jms-no-local-filter:list"; + String APACHE_LEGACY_SELECTOR_FILTER = "apache.org:jms-selector-filter:string"; + String APACHE_LEGACY_TOPIC_BINDING = "apache.org:legacy-amqp-topic-binding:string"; + String APACHE_NO_LOCAL_FILTER = "apache.org:no-local-filter:list"; + String APACHE_SELECTOR_FILTER = "apache.org:selector-filter:string"; + String APP_OCTET_STREAM = "application/octet-stream"; + String APP_X_JAVA_SERIALIZED_OBJ = "application/x-java-serialized-object"; + String DELAYED_DELIVERY = "DELAYED_DELIVERY"; + String DISCARD_UNROUTABLE = "DISCARD_UNROUTABLE"; + String NOT_VALID_BEFORE = "x-qpid-not-valid-before"; + String REJECT_UNROUTABLE = "REJECT_UNROUTABLE"; +} diff --git a/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbols.java b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbols.java new file mode 100644 index 0000000000..9808398c1a --- /dev/null +++ b/broker-plugins/amqp-1-0-protocol/src/main/java/org/apache/qpid/server/protocol/v1_0/constants/qpid/QpidSymbols.java @@ -0,0 +1,39 @@ +/* + * 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.server.protocol.v1_0.constants.qpid; + +import org.apache.qpid.server.protocol.v1_0.type.Symbol; + +public interface QpidSymbols +{ + Symbol APACHE_LEGACY_DIRECT_BINDING = Symbol.valueOf(QpidSymbolTexts.APACHE_LEGACY_DIRECT_BINDING); + Symbol APACHE_LEGACY_NO_LOCAL_FILTER = Symbol.valueOf(QpidSymbolTexts.APACHE_LEGACY_NO_LOCAL_FILTER); + Symbol APACHE_LEGACY_SELECTOR_FILTER = Symbol.valueOf(QpidSymbolTexts.APACHE_LEGACY_SELECTOR_FILTER); + Symbol APACHE_LEGACY_TOPIC_BINDING = Symbol.valueOf(QpidSymbolTexts.APACHE_LEGACY_TOPIC_BINDING); + Symbol APACHE_NO_LOCAL_FILTER = Symbol.valueOf(QpidSymbolTexts.APACHE_NO_LOCAL_FILTER); + Symbol APACHE_SELECTOR_FILTER = Symbol.valueOf(QpidSymbolTexts.APACHE_SELECTOR_FILTER); + Symbol APP_OCTET_STREAM = Symbol.valueOf(QpidSymbolTexts.APP_OCTET_STREAM); + Symbol APP_X_JAVA_SERIALIZED_OBJ = Symbol.valueOf(QpidSymbolTexts.APP_X_JAVA_SERIALIZED_OBJ); + Symbol DELAYED_DELIVERY = Symbol.valueOf(QpidSymbolTexts.DELAYED_DELIVERY); + Symbol DISCARD_UNROUTABLE = Symbol.valueOf(QpidSymbolTexts.DISCARD_UNROUTABLE); + Symbol NOT_VALID_BEFORE = Symbol.valueOf(QpidSymbolTexts.NOT_VALID_BEFORE); + Symbol REJECT_UNROUTABLE = Symbol.valueOf(QpidSymbolTexts.REJECT_UNROUTABLE); +}