Class AmqpWireFormat
java.lang.Object
org.apache.activemq.transport.amqp.AmqpWireFormat
- All Implemented Interfaces:
org.apache.activemq.wireformat.WireFormat
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanstatic final intstatic final intstatic final intstatic final longstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintintlongReturns an AMQP Header object that represents the minimally protocol versions supported by this transport.intintbooleanbooleanisHeaderValid(AmqpHeader header, boolean authenticated) Given an AMQP header validate that the AMQP magic is present and if so that the version and protocol values align with what we support.booleanvoidmarshal(Object command, DataOutput dataOut) voidvoidsetAllowNonSaslConnections(boolean allowNonSaslConnections) voidsetConnectAttemptTimeout(int connectAttemptTimeout) voidsetIdleTimeout(int idelTimeout) voidsetMaxAmqpFrameSize(int maxAmqpFrameSize) voidsetMaxFrameSize(long maxFrameSize) voidsetProducerCredit(int producerCredit) voidvoidsetTransformer(String transformer) voidsetVersion(int version) unmarshal(ByteSequence packet)
-
Field Details
-
DEFAULT_MAX_FRAME_SIZE
public static final long DEFAULT_MAX_FRAME_SIZE- See Also:
-
NO_AMQP_MAX_FRAME_SIZE
public static final int NO_AMQP_MAX_FRAME_SIZE- See Also:
-
DEFAULT_CONNECTION_TIMEOUT
public static final int DEFAULT_CONNECTION_TIMEOUT- See Also:
-
DEFAULT_IDLE_TIMEOUT
public static final int DEFAULT_IDLE_TIMEOUT- See Also:
-
DEFAULT_PRODUCER_CREDIT
public static final int DEFAULT_PRODUCER_CREDIT- See Also:
-
DEFAULT_ALLOW_NON_SASL_CONNECTIONS
public static final boolean DEFAULT_ALLOW_NON_SASL_CONNECTIONS- See Also:
-
DEFAULT_ANQP_FRAME_SIZE
public static final int DEFAULT_ANQP_FRAME_SIZE- See Also:
-
-
Constructor Details
-
AmqpWireFormat
public AmqpWireFormat()
-
-
Method Details
-
marshal
- Specified by:
marshalin interfaceorg.apache.activemq.wireformat.WireFormat- Throws:
IOException
-
unmarshal
- Specified by:
unmarshalin interfaceorg.apache.activemq.wireformat.WireFormat- Throws:
IOException
-
marshal
- Specified by:
marshalin interfaceorg.apache.activemq.wireformat.WireFormat- Throws:
IOException
-
unmarshal
- Specified by:
unmarshalin interfaceorg.apache.activemq.wireformat.WireFormat- Throws:
IOException
-
isHeaderValid
Given an AMQP header validate that the AMQP magic is present and if so that the version and protocol values align with what we support. In the case where authentication occurs the client sends us two AMQP headers, the first being the SASL initial header which triggers the authentication process and then if that succeeds we should get a second AMQP header that does not contain the SASL protocol ID indicating the connection process should follow the normal path. We validate that the header align with these expectations.- Parameters:
header- the header instance received from the client.authenticated- has the client already authenticated already.- Returns:
- true if the header is valid against the current WireFormat.
-
getMinimallySupportedHeader
Returns an AMQP Header object that represents the minimally protocol versions supported by this transport. A client that attempts to connect with an AMQP version that doesn't at least meat this value will receive this prior to the connection being closed.- Returns:
- the minimal AMQP version needed from the client.
-
setVersion
public void setVersion(int version) - Specified by:
setVersionin interfaceorg.apache.activemq.wireformat.WireFormat
-
getVersion
public int getVersion()- Specified by:
getVersionin interfaceorg.apache.activemq.wireformat.WireFormat
-
resetMagicRead
public void resetMagicRead() -
setProtocolResetListener
-
isMagicRead
public boolean isMagicRead() -
getMaxFrameSize
public long getMaxFrameSize() -
setMaxFrameSize
public void setMaxFrameSize(long maxFrameSize) -
getMaxAmqpFrameSize
public int getMaxAmqpFrameSize() -
setMaxAmqpFrameSize
public void setMaxAmqpFrameSize(int maxAmqpFrameSize) -
isAllowNonSaslConnections
public boolean isAllowNonSaslConnections() -
setAllowNonSaslConnections
public void setAllowNonSaslConnections(boolean allowNonSaslConnections) -
getConnectAttemptTimeout
public int getConnectAttemptTimeout() -
setConnectAttemptTimeout
public void setConnectAttemptTimeout(int connectAttemptTimeout) -
setProducerCredit
public void setProducerCredit(int producerCredit) -
getProducerCredit
public int getProducerCredit() -
getTransformer
-
setTransformer
-
getIdleTimeout
public int getIdleTimeout() -
setIdleTimeout
public void setIdleTimeout(int idelTimeout)
-