Class AmqpSupport
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.proton.AmqpSupport
-
public class AmqpSupport extends Object
Set of useful methods and definitions used in the AMQP protocol handling
-
-
Field Summary
Fields Modifier and Type Field Description static intAMQP_CREDITS_DEFAULTstatic ObjectAMQP_LINK_INITIALIZER_KEYstatic intAMQP_LOW_CREDITS_DEFAULTstatic booleanAMQP_TREAT_REJECT_AS_UNMODIFIED_DELIVERY_FAILUREstatic booleanAMQP_USE_MODIFIED_FOR_TRANSIENT_DELIVERY_ERRORSstatic org.apache.qpid.proton.amqp.SymbolANONYMOUS_RELAYstatic org.apache.qpid.proton.amqp.SymbolCONNECTION_FORCEDstatic org.apache.qpid.proton.amqp.SymbolCONNECTION_OPEN_FAILEDstatic org.apache.qpid.proton.amqp.SymbolCONTAINER_IDstatic org.apache.qpid.proton.amqp.SymbolCOPYstatic org.apache.qpid.proton.amqp.SymbolCORE_MESSAGE_TUNNELING_SUPPORTA capability added to the sender or receiver links that indicate that the link either wants support for or offers support for tunneling Core messages as custom formatted AMQP messages.static org.apache.qpid.proton.amqp.SymbolDELAYED_DELIVERYstatic org.apache.qpid.proton.amqp.SymbolDETACH_FORCEDstatic org.apache.qpid.proton.amqp.SymbolGLOBALstatic org.apache.qpid.proton.amqp.SymbolINVALID_FIELDstatic org.apache.qpid.proton.amqp.UnsignedLongJMS_SELECTOR_CODEstatic Object[]JMS_SELECTOR_FILTER_IDSstatic org.apache.qpid.proton.amqp.SymbolJMS_SELECTOR_KEYstatic org.apache.qpid.proton.amqp.SymbolJMS_SELECTOR_NAMEstatic org.apache.qpid.proton.amqp.SymbolLIFETIME_POLICYstatic intMAX_FRAME_SIZE_DEFAULTstatic org.apache.qpid.proton.amqp.SymbolNETWORK_HOSTstatic org.apache.qpid.proton.amqp.UnsignedLongNO_LOCAL_CODEstatic Object[]NO_LOCAL_FILTER_IDSstatic org.apache.qpid.proton.amqp.SymbolNO_LOCAL_NAMEstatic org.apache.qpid.proton.amqp.SymbolNOT_FOUNDstatic org.apache.qpid.proton.amqp.SymbolPLATFORMstatic org.apache.qpid.proton.amqp.SymbolPORTstatic org.apache.qpid.proton.amqp.SymbolPRODUCTstatic org.apache.qpid.proton.amqp.SymbolQUEUE_CAPABILITYstatic org.apache.qpid.proton.amqp.SymbolQUEUE_PREFIXstatic org.apache.qpid.proton.amqp.SymbolRESOURCE_DELETEDstatic org.apache.qpid.proton.amqp.SymbolSHAREDstatic org.apache.qpid.proton.amqp.SymbolSHARED_SUBSstatic org.apache.qpid.proton.amqp.SymbolSOLE_CONNECTION_CAPABILITYstatic org.apache.qpid.proton.amqp.SymbolTEMP_QUEUE_CAPABILITYstatic org.apache.qpid.proton.amqp.SymbolTEMP_TOPIC_CAPABILITYstatic org.apache.qpid.proton.amqp.SymbolTOPIC_CAPABILITYstatic org.apache.qpid.proton.amqp.SymbolTOPIC_PREFIXstatic StringTUNNEL_CORE_MESSAGESProperty value that can be applied to federation configuration that controls if the federation receivers will request that the sender peer tunnel core messages inside an AMQP message as a binary blob to be unwrapped on the other side.static org.apache.qpid.proton.amqp.SymbolVERSION
-
Constructor Summary
Constructors Constructor Description AmqpSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancontains(org.apache.qpid.proton.amqp.Symbol[] symbols, org.apache.qpid.proton.amqp.Symbol key)Search for a given Symbol in a given array of Symbol object.static SimpleStringcreateQueueName(boolean useCoreSubscriptionNaming, String clientId, String senderId, boolean shared, boolean global, boolean isVolatile)Given the input values construct a Queue name for use in messaging handlers.static Map.Entry<org.apache.qpid.proton.amqp.Symbol,org.apache.qpid.proton.amqp.DescribedType>findFilter(Map<org.apache.qpid.proton.amqp.Symbol,Object> filters, Object[] filterIds)Search for a particular filter using a set of known identification values in the Map of filters.static booleanverifyCapabilities(org.apache.qpid.proton.amqp.Symbol[] offered, org.apache.qpid.proton.amqp.Symbol... desired)Verifies that the given set of capabilities contains each of the desired capabilities.static booleanverifyDesiredCapability(org.apache.qpid.proton.engine.Link link, org.apache.qpid.proton.amqp.Symbol desiredCapability)Verifies that the given desired capability is present in the remote link details.static booleanverifyOfferedCapabilities(org.apache.qpid.proton.engine.Link link)Verifies that the desired capabilities that were sent to the remote were indeed offered in return.static booleanverifyOfferedCapabilities(org.apache.qpid.proton.engine.Link link, org.apache.qpid.proton.amqp.Symbol... capabilities)Verifies that the given set of desired capabilities (which should be the full set of desired capabilities configured on the link or a subset of those values) are indeed offered in return.static booleanverifySourceCapability(org.apache.qpid.proton.amqp.messaging.Source source, org.apache.qpid.proton.amqp.Symbol capability)Verifies that the desired capability is present in the Source capabilities.static booleanverifyTargetCapability(org.apache.qpid.proton.amqp.messaging.Target target, org.apache.qpid.proton.amqp.Symbol capability)Verifies that the desired capability is present in the Source capabilities.
-
-
-
Field Detail
-
AMQP_LINK_INITIALIZER_KEY
public static final Object AMQP_LINK_INITIALIZER_KEY
-
AMQP_CREDITS_DEFAULT
public static final int AMQP_CREDITS_DEFAULT
- See Also:
- Constant Field Values
-
AMQP_LOW_CREDITS_DEFAULT
public static final int AMQP_LOW_CREDITS_DEFAULT
- See Also:
- Constant Field Values
-
AMQP_TREAT_REJECT_AS_UNMODIFIED_DELIVERY_FAILURE
public static final boolean AMQP_TREAT_REJECT_AS_UNMODIFIED_DELIVERY_FAILURE
- See Also:
- Constant Field Values
-
AMQP_USE_MODIFIED_FOR_TRANSIENT_DELIVERY_ERRORS
public static final boolean AMQP_USE_MODIFIED_FOR_TRANSIENT_DELIVERY_ERRORS
- See Also:
- Constant Field Values
-
JMS_SELECTOR_KEY
public static final org.apache.qpid.proton.amqp.Symbol JMS_SELECTOR_KEY
-
JMS_SELECTOR_CODE
public static final org.apache.qpid.proton.amqp.UnsignedLong JMS_SELECTOR_CODE
-
JMS_SELECTOR_NAME
public static final org.apache.qpid.proton.amqp.Symbol JMS_SELECTOR_NAME
-
JMS_SELECTOR_FILTER_IDS
public static final Object[] JMS_SELECTOR_FILTER_IDS
-
NO_LOCAL_CODE
public static final org.apache.qpid.proton.amqp.UnsignedLong NO_LOCAL_CODE
-
NO_LOCAL_NAME
public static final org.apache.qpid.proton.amqp.Symbol NO_LOCAL_NAME
-
NO_LOCAL_FILTER_IDS
public static final Object[] NO_LOCAL_FILTER_IDS
-
TEMP_QUEUE_CAPABILITY
public static final org.apache.qpid.proton.amqp.Symbol TEMP_QUEUE_CAPABILITY
-
TEMP_TOPIC_CAPABILITY
public static final org.apache.qpid.proton.amqp.Symbol TEMP_TOPIC_CAPABILITY
-
QUEUE_CAPABILITY
public static final org.apache.qpid.proton.amqp.Symbol QUEUE_CAPABILITY
-
TOPIC_CAPABILITY
public static final org.apache.qpid.proton.amqp.Symbol TOPIC_CAPABILITY
-
INVALID_FIELD
public static final org.apache.qpid.proton.amqp.Symbol INVALID_FIELD
-
CONTAINER_ID
public static final org.apache.qpid.proton.amqp.Symbol CONTAINER_ID
-
ANONYMOUS_RELAY
public static final org.apache.qpid.proton.amqp.Symbol ANONYMOUS_RELAY
-
DELAYED_DELIVERY
public static final org.apache.qpid.proton.amqp.Symbol DELAYED_DELIVERY
-
QUEUE_PREFIX
public static final org.apache.qpid.proton.amqp.Symbol QUEUE_PREFIX
-
TOPIC_PREFIX
public static final org.apache.qpid.proton.amqp.Symbol TOPIC_PREFIX
-
SHARED
public static final org.apache.qpid.proton.amqp.Symbol SHARED
-
GLOBAL
public static final org.apache.qpid.proton.amqp.Symbol GLOBAL
-
CONNECTION_OPEN_FAILED
public static final org.apache.qpid.proton.amqp.Symbol CONNECTION_OPEN_FAILED
-
PRODUCT
public static final org.apache.qpid.proton.amqp.Symbol PRODUCT
-
VERSION
public static final org.apache.qpid.proton.amqp.Symbol VERSION
-
PLATFORM
public static final org.apache.qpid.proton.amqp.Symbol PLATFORM
-
RESOURCE_DELETED
public static final org.apache.qpid.proton.amqp.Symbol RESOURCE_DELETED
-
CONNECTION_FORCED
public static final org.apache.qpid.proton.amqp.Symbol CONNECTION_FORCED
-
DETACH_FORCED
public static final org.apache.qpid.proton.amqp.Symbol DETACH_FORCED
-
NOT_FOUND
public static final org.apache.qpid.proton.amqp.Symbol NOT_FOUND
-
SHARED_SUBS
public static final org.apache.qpid.proton.amqp.Symbol SHARED_SUBS
-
NETWORK_HOST
public static final org.apache.qpid.proton.amqp.Symbol NETWORK_HOST
-
PORT
public static final org.apache.qpid.proton.amqp.Symbol PORT
-
MAX_FRAME_SIZE_DEFAULT
public static final int MAX_FRAME_SIZE_DEFAULT
- See Also:
- Constant Field Values
-
COPY
public static final org.apache.qpid.proton.amqp.Symbol COPY
-
LIFETIME_POLICY
public static final org.apache.qpid.proton.amqp.Symbol LIFETIME_POLICY
-
SOLE_CONNECTION_CAPABILITY
public static final org.apache.qpid.proton.amqp.Symbol SOLE_CONNECTION_CAPABILITY
-
CORE_MESSAGE_TUNNELING_SUPPORT
public static final org.apache.qpid.proton.amqp.Symbol CORE_MESSAGE_TUNNELING_SUPPORT
A capability added to the sender or receiver links that indicate that the link either wants support for or offers support for tunneling Core messages as custom formatted AMQP messages.
-
TUNNEL_CORE_MESSAGES
public static final String TUNNEL_CORE_MESSAGES
Property value that can be applied to federation configuration that controls if the federation receivers will request that the sender peer tunnel core messages inside an AMQP message as a binary blob to be unwrapped on the other side. The sending peer would still need to support this feature for message tunneling to occur.- See Also:
- Constant Field Values
-
-
Method Detail
-
contains
public static boolean contains(org.apache.qpid.proton.amqp.Symbol[] symbols, org.apache.qpid.proton.amqp.Symbol key)Search for a given Symbol in a given array of Symbol object.- Parameters:
symbols- the set of Symbols to search.key- the value to try and find in the Symbol array.- Returns:
- true if the key is found in the given Symbol array.
-
findFilter
public static Map.Entry<org.apache.qpid.proton.amqp.Symbol,org.apache.qpid.proton.amqp.DescribedType> findFilter(Map<org.apache.qpid.proton.amqp.Symbol,Object> filters, Object[] filterIds)
Search for a particular filter using a set of known identification values in the Map of filters.- Parameters:
filters- The filters map that should be searched.filterIds- The aliases for the target filter to be located.- Returns:
- the filter if found in the mapping or null if not found.
-
verifyOfferedCapabilities
public static boolean verifyOfferedCapabilities(org.apache.qpid.proton.engine.Link link)
Verifies that the desired capabilities that were sent to the remote were indeed offered in return. If the remote has not offered a capability that was desired then the initiating resource should determine if the offered set is still acceptable or it should close the link and report the reason.The remote could have offered more capabilities than the requested desired capabilities, this method does not validate that or consider that a failure.
- Parameters:
link- The link in question (Sender or Receiver).- Returns:
- true if the remote offered all of the capabilities that were desired.
-
verifyOfferedCapabilities
public static boolean verifyOfferedCapabilities(org.apache.qpid.proton.engine.Link link, org.apache.qpid.proton.amqp.Symbol... capabilities)Verifies that the given set of desired capabilities (which should be the full set of desired capabilities configured on the link or a subset of those values) are indeed offered in return. If the remote has not offered a capability that was desired then the initiating resource should determine if the offered set is still acceptable or it should close the link and report the reason.The remote could have offered more capabilities than the requested desired capabilities, this method does not validate that or consider that a failure.
- Parameters:
link- The link in question (Sender or Receiver).capabilities- The capabilities that are required being checked for.- Returns:
- true if the remote offered all of the capabilities that were desired.
-
verifyDesiredCapability
public static boolean verifyDesiredCapability(org.apache.qpid.proton.engine.Link link, org.apache.qpid.proton.amqp.Symbol desiredCapability)Verifies that the given desired capability is present in the remote link details.The remote could have desired more capabilities than the one given, this method does not validate that or consider that a failure.
- Parameters:
link- The link in question (Sender or Receiver).desiredCapability- The non-null capability that is being checked as being desired.- Returns:
- true if the remote desired all of the capabilities that were given.
-
verifySourceCapability
public static boolean verifySourceCapability(org.apache.qpid.proton.amqp.messaging.Source source, org.apache.qpid.proton.amqp.Symbol capability)Verifies that the desired capability is present in the Source capabilities.- Parameters:
source- The Source instance whose capabilities are being searched.capability- The non-null capability that is being checked as being desired.- Returns:
- true if the remote desired all of the capabilities that were given.
-
verifyTargetCapability
public static boolean verifyTargetCapability(org.apache.qpid.proton.amqp.messaging.Target target, org.apache.qpid.proton.amqp.Symbol capability)Verifies that the desired capability is present in the Source capabilities.- Parameters:
target- The Target instance whose capabilities are being searched.capability- The non-null capability that is being checked as being desired.- Returns:
- true if the remote desired all of the capabilities that were given.
-
verifyCapabilities
public static boolean verifyCapabilities(org.apache.qpid.proton.amqp.Symbol[] offered, org.apache.qpid.proton.amqp.Symbol... desired)Verifies that the given set of capabilities contains each of the desired capabilities.The remote could have offered more capabilities than the requested desired capabilities, this method does not validate that or consider that a failure.
- Parameters:
offered- The capabilities that were offered from the remote or were set by the local sidedesired- The desired capabilities to search for in the offered set.- Returns:
trueif the desired capabilities were found in the offered set.
-
createQueueName
public static SimpleString createQueueName(boolean useCoreSubscriptionNaming, String clientId, String senderId, boolean shared, boolean global, boolean isVolatile)
Given the input values construct a Queue name for use in messaging handlers.- Parameters:
useCoreSubscriptionNaming- Should the name match core client subscription naming.clientId- The client ID of the remote peer.senderId- The ID assigned to the sender asking for a generated Queue name.shared- Is this Queue used for shared subscriptionsglobal- Should the shared subscription Queue indicate globally shared.isVolatile- Is the Queue meant to be volatile or not.- Returns:
- a queue name based on the provided inputs.
-
-