Class AmqpSupport
- java.lang.Object
-
- org.apache.activemq.transport.amqp.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 org.apache.qpid.proton.amqp.SymbolANONYMOUS_RELAYstatic 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.SymbolDELAYED_DELIVERYstatic 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_NAMEstatic org.apache.qpid.proton.amqp.SymbolLIFETIME_POLICYstatic 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.SymbolPLATFORMstatic 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.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 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 ActiveMQDestinationcreateDestination(Object endpoint)Given an AMQP endpoint, deduce the appropriate ActiveMQDestination type and create a new instance.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 indentification values in the Map of filters.static org.apache.qpid.proton.amqp.SymbolgetDestinationTypeSymbol(ActiveMQDestination destination)Given an ActiveMQDestination return the proper Capability value for the concrete destination type.static org.fusesource.hawtbuf.BuffertoBuffer(ByteBuffer data)Conversion from Java ByteBuffer to a HawtBuf buffer.static byte[]toBytes(long value)Given a long value, convert it to a byte array for marshalling.static longtoLong(org.apache.qpid.proton.amqp.Binary value)Converts a Binary value to a long assuming that the contained value is stored in Big Endian encoding.
-
-
-
Field Detail
-
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
-
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
-
COPY
public static final org.apache.qpid.proton.amqp.Symbol COPY
-
LIFETIME_POLICY
public static final org.apache.qpid.proton.amqp.Symbol LIFETIME_POLICY
-
-
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 indentification 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.
-
toBuffer
public static org.fusesource.hawtbuf.Buffer toBuffer(ByteBuffer data)
Conversion from Java ByteBuffer to a HawtBuf buffer.- Parameters:
data- the ByteBuffer instance to convert.- Returns:
- a new HawtBuf buffer converted from the given ByteBuffer.
-
toBytes
public static byte[] toBytes(long value)
Given a long value, convert it to a byte array for marshalling.- Parameters:
value- the value to convert.- Returns:
- a new byte array that holds the big endian value of the long.
-
toLong
public static long toLong(org.apache.qpid.proton.amqp.Binary value)
Converts a Binary value to a long assuming that the contained value is stored in Big Endian encoding.- Parameters:
value- the Binary object whose payload is converted to a long.- Returns:
- a long value constructed from the bytes of the Binary instance.
-
createDestination
public static ActiveMQDestination createDestination(Object endpoint) throws AmqpProtocolException
Given an AMQP endpoint, deduce the appropriate ActiveMQDestination type and create a new instance. By default if the endpoint address does not carry the standard prefix value then we default to a Queue type destination. If the endpoint is null or is an AMQP Coordinator type endpoint this method returns null to indicate no destination can be mapped.- Parameters:
endpoint- the AMQP endpoint to construct an ActiveMQDestination from.- Returns:
- a new ActiveMQDestination that best matches the address of the given endpoint
- Throws:
AmqpProtocolException- if an error occurs while deducing the destination type.
-
getDestinationTypeSymbol
public static org.apache.qpid.proton.amqp.Symbol getDestinationTypeSymbol(ActiveMQDestination destination)
Given an ActiveMQDestination return the proper Capability value for the concrete destination type.- Parameters:
destination- The ActiveMQDestination whose capability is being requested.- Returns:
- a Symbol that matches the defined Capability value for the ActiveMQDestiantion.
-
-