Class AmqpWireFormat

java.lang.Object
org.apache.activemq.transport.amqp.AmqpWireFormat
All Implemented Interfaces:
org.apache.activemq.wireformat.WireFormat

public class AmqpWireFormat extends Object implements org.apache.activemq.wireformat.WireFormat
  • 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

      public ByteSequence marshal(Object command) throws IOException
      Specified by:
      marshal in interface org.apache.activemq.wireformat.WireFormat
      Throws:
      IOException
    • unmarshal

      public Object unmarshal(ByteSequence packet) throws IOException
      Specified by:
      unmarshal in interface org.apache.activemq.wireformat.WireFormat
      Throws:
      IOException
    • marshal

      public void marshal(Object command, DataOutput dataOut) throws IOException
      Specified by:
      marshal in interface org.apache.activemq.wireformat.WireFormat
      Throws:
      IOException
    • unmarshal

      public Object unmarshal(DataInput dataIn) throws IOException
      Specified by:
      unmarshal in interface org.apache.activemq.wireformat.WireFormat
      Throws:
      IOException
    • isHeaderValid

      public boolean isHeaderValid(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. 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

      public AmqpHeader 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:
      setVersion in interface org.apache.activemq.wireformat.WireFormat
    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface org.apache.activemq.wireformat.WireFormat
    • resetMagicRead

      public void resetMagicRead()
    • setProtocolResetListener

      public void setProtocolResetListener(AmqpWireFormat.ResetListener listener)
    • 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

      public String getTransformer()
    • setTransformer

      public void setTransformer(String transformer)
    • getIdleTimeout

      public int getIdleTimeout()
    • setIdleTimeout

      public void setIdleTimeout(int idelTimeout)