org.apache.qpid.framing
Class AMQMethodBodyImpl

java.lang.Object
  extended by org.apache.qpid.framing.AMQMethodBodyImpl
All Implemented Interfaces:
AMQBody, AMQMethodBody
Direct Known Subclasses:
AMQMethodBody_0_9, AMQMethodBody_0_91, AMQMethodBody_8_0

public abstract class AMQMethodBodyImpl
extends Object
implements AMQMethodBody


Field Summary
static byte TYPE
           
 
Constructor Summary
AMQMethodBodyImpl()
           
 
Method Summary
 AMQFrame generateFrame(int channelId)
           
protected abstract  int getBodySize()
          unsigned short
 AMQChannelException getChannelException(AMQConstant code, String message)
           
 AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause)
           
 AMQChannelException getChannelNotFoundException(int channelId)
          Convenience Method to create a channel not found exception
 AMQConnectionException getConnectionException(AMQConstant code, String message)
           
 AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause)
           
 byte getFrameType()
           
 int getSize()
          Get the size of the body
protected  int getSizeOf(AMQShortString string)
           
protected  int getSizeOf(byte[] response)
           
protected  int getSizeOf(Content body)
           
protected  int getSizeOf(FieldTable table)
           
 void handle(int channelId, AMQVersionAwareProtocolSession session)
           
protected  AMQShortString readAMQShortString(org.apache.mina.common.ByteBuffer buffer)
           
protected  byte readBitfield(org.apache.mina.common.ByteBuffer buffer)
           
protected  byte readByte(org.apache.mina.common.ByteBuffer buffer)
           
protected  byte[] readBytes(org.apache.mina.common.ByteBuffer buffer)
           
protected  Content readContent(org.apache.mina.common.ByteBuffer buffer)
           
protected  FieldTable readFieldTable(org.apache.mina.common.ByteBuffer buffer)
           
protected  int readInt(org.apache.mina.common.ByteBuffer buffer)
           
protected  long readLong(org.apache.mina.common.ByteBuffer buffer)
           
protected  short readShort(org.apache.mina.common.ByteBuffer buffer)
           
protected  long readTimestamp(org.apache.mina.common.ByteBuffer buffer)
           
protected  short readUnsignedByte(org.apache.mina.common.ByteBuffer buffer)
           
protected  long readUnsignedInteger(org.apache.mina.common.ByteBuffer buffer)
           
protected  int readUnsignedShort(org.apache.mina.common.ByteBuffer buffer)
           
protected  void writeAMQShortString(org.apache.mina.common.ByteBuffer buffer, AMQShortString string)
           
protected  void writeBitfield(org.apache.mina.common.ByteBuffer buffer, byte bitfield0)
           
protected  void writeByte(org.apache.mina.common.ByteBuffer buffer, byte b)
           
protected  void writeBytes(org.apache.mina.common.ByteBuffer buffer, byte[] data)
           
protected  void writeContent(org.apache.mina.common.ByteBuffer buffer, Content body)
           
protected  void writeFieldTable(org.apache.mina.common.ByteBuffer buffer, FieldTable table)
           
protected  void writeInt(org.apache.mina.common.ByteBuffer buffer, int i)
           
protected  void writeLong(org.apache.mina.common.ByteBuffer buffer, long l)
           
 void writePayload(org.apache.mina.common.ByteBuffer buffer)
           
protected  void writeShort(org.apache.mina.common.ByteBuffer buffer, short s)
           
protected  void writeTimestamp(org.apache.mina.common.ByteBuffer buffer, long t)
           
protected  void writeUnsignedByte(org.apache.mina.common.ByteBuffer buffer, short unsignedByte)
           
protected  void writeUnsignedInteger(org.apache.mina.common.ByteBuffer buffer, long i)
           
protected  void writeUnsignedShort(org.apache.mina.common.ByteBuffer buffer, int s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.qpid.framing.AMQMethodBody
execute, getClazz, getMajor, getMethod, getMinor, toString, writeMethodPayload
 

Field Detail

TYPE

public static final byte TYPE
See Also:
Constant Field Values
Constructor Detail

AMQMethodBodyImpl

public AMQMethodBodyImpl()
Method Detail

getFrameType

public byte getFrameType()
Specified by:
getFrameType in interface AMQBody

getBodySize

protected abstract int getBodySize()
unsigned short


generateFrame

public AMQFrame generateFrame(int channelId)
Specified by:
generateFrame in interface AMQMethodBody

getChannelNotFoundException

public AMQChannelException getChannelNotFoundException(int channelId)
Convenience Method to create a channel not found exception

Specified by:
getChannelNotFoundException in interface AMQMethodBody
Parameters:
channelId - The channel id that is not found
Returns:
new AMQChannelException

getChannelException

public AMQChannelException getChannelException(AMQConstant code,
                                               String message)
Specified by:
getChannelException in interface AMQMethodBody

getChannelException

public AMQChannelException getChannelException(AMQConstant code,
                                               String message,
                                               Throwable cause)
Specified by:
getChannelException in interface AMQMethodBody

getConnectionException

public AMQConnectionException getConnectionException(AMQConstant code,
                                                     String message)
Specified by:
getConnectionException in interface AMQMethodBody

getConnectionException

public AMQConnectionException getConnectionException(AMQConstant code,
                                                     String message,
                                                     Throwable cause)
Specified by:
getConnectionException in interface AMQMethodBody

handle

public void handle(int channelId,
                   AMQVersionAwareProtocolSession session)
            throws AMQException
Specified by:
handle in interface AMQBody
Throws:
AMQException

getSize

public int getSize()
Description copied from interface: AMQBody
Get the size of the body

Specified by:
getSize in interface AMQBody
Specified by:
getSize in interface AMQMethodBody
Returns:
unsigned short

writePayload

public void writePayload(org.apache.mina.common.ByteBuffer buffer)
Specified by:
writePayload in interface AMQBody
Specified by:
writePayload in interface AMQMethodBody

readByte

protected byte readByte(org.apache.mina.common.ByteBuffer buffer)

readAMQShortString

protected AMQShortString readAMQShortString(org.apache.mina.common.ByteBuffer buffer)

getSizeOf

protected int getSizeOf(AMQShortString string)

writeByte

protected void writeByte(org.apache.mina.common.ByteBuffer buffer,
                         byte b)

writeAMQShortString

protected void writeAMQShortString(org.apache.mina.common.ByteBuffer buffer,
                                   AMQShortString string)

readInt

protected int readInt(org.apache.mina.common.ByteBuffer buffer)

writeInt

protected void writeInt(org.apache.mina.common.ByteBuffer buffer,
                        int i)

readFieldTable

protected FieldTable readFieldTable(org.apache.mina.common.ByteBuffer buffer)
                             throws AMQFrameDecodingException
Throws:
AMQFrameDecodingException

getSizeOf

protected int getSizeOf(FieldTable table)

writeFieldTable

protected void writeFieldTable(org.apache.mina.common.ByteBuffer buffer,
                               FieldTable table)

readLong

protected long readLong(org.apache.mina.common.ByteBuffer buffer)

writeLong

protected void writeLong(org.apache.mina.common.ByteBuffer buffer,
                         long l)

getSizeOf

protected int getSizeOf(byte[] response)

writeBytes

protected void writeBytes(org.apache.mina.common.ByteBuffer buffer,
                          byte[] data)

readBytes

protected byte[] readBytes(org.apache.mina.common.ByteBuffer buffer)

readShort

protected short readShort(org.apache.mina.common.ByteBuffer buffer)

writeShort

protected void writeShort(org.apache.mina.common.ByteBuffer buffer,
                          short s)

readContent

protected Content readContent(org.apache.mina.common.ByteBuffer buffer)

getSizeOf

protected int getSizeOf(Content body)

writeContent

protected void writeContent(org.apache.mina.common.ByteBuffer buffer,
                            Content body)

readBitfield

protected byte readBitfield(org.apache.mina.common.ByteBuffer buffer)

readUnsignedShort

protected int readUnsignedShort(org.apache.mina.common.ByteBuffer buffer)

writeBitfield

protected void writeBitfield(org.apache.mina.common.ByteBuffer buffer,
                             byte bitfield0)

writeUnsignedShort

protected void writeUnsignedShort(org.apache.mina.common.ByteBuffer buffer,
                                  int s)

readUnsignedInteger

protected long readUnsignedInteger(org.apache.mina.common.ByteBuffer buffer)

writeUnsignedInteger

protected void writeUnsignedInteger(org.apache.mina.common.ByteBuffer buffer,
                                    long i)

readUnsignedByte

protected short readUnsignedByte(org.apache.mina.common.ByteBuffer buffer)

writeUnsignedByte

protected void writeUnsignedByte(org.apache.mina.common.ByteBuffer buffer,
                                 short unsignedByte)

readTimestamp

protected long readTimestamp(org.apache.mina.common.ByteBuffer buffer)

writeTimestamp

protected void writeTimestamp(org.apache.mina.common.ByteBuffer buffer,
                              long t)


Licensed to the Apache Software Foundation