org.apache.qpid.nclient.util
Class ByteBufferMessage

java.lang.Object
  extended by org.apache.qpid.nclient.util.ByteBufferMessage
All Implemented Interfaces:
org.apache.qpid.api.Message

public class ByteBufferMessage
extends Object
implements org.apache.qpid.api.Message

A Simple implementation of the message interface for small messages. When the readData methods are called we assume the message is complete. i.e there want be any appendData operations after that.

If you need large message support please see FileMessage and StreamingMessage


Constructor Summary
ByteBufferMessage()
           
ByteBufferMessage(int transferId)
           
ByteBufferMessage(org.apache.qpid.transport.MessageProperties messageProperties, org.apache.qpid.transport.DeliveryProperties deliveryProperties)
           
 
Method Summary
 void appendData(byte[] src)
           
 void appendData(ByteBuffer src)
          write the data from the current position up to the buffer limit
 void clearData()
           
 org.apache.qpid.transport.DeliveryProperties getDeliveryProperties()
           
 org.apache.qpid.transport.Header getHeader()
           
 org.apache.qpid.transport.MessageProperties getMessageProperties()
           
 int getMessageTransferId()
           
 ByteBuffer readData()
           
 void readData(byte[] target)
           
 void setDeliveryProperties(org.apache.qpid.transport.DeliveryProperties props)
           
 void setHeader(org.apache.qpid.transport.Header header)
           
 void setMessageProperties(org.apache.qpid.transport.MessageProperties props)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteBufferMessage

public ByteBufferMessage(org.apache.qpid.transport.MessageProperties messageProperties,
                         org.apache.qpid.transport.DeliveryProperties deliveryProperties)

ByteBufferMessage

public ByteBufferMessage()

ByteBufferMessage

public ByteBufferMessage(int transferId)
Method Detail

setHeader

public void setHeader(org.apache.qpid.transport.Header header)
Specified by:
setHeader in interface org.apache.qpid.api.Message

getHeader

public org.apache.qpid.transport.Header getHeader()
Specified by:
getHeader in interface org.apache.qpid.api.Message

getMessageTransferId

public int getMessageTransferId()
Specified by:
getMessageTransferId in interface org.apache.qpid.api.Message

clearData

public void clearData()
Specified by:
clearData in interface org.apache.qpid.api.Message

appendData

public void appendData(byte[] src)
                throws IOException
Specified by:
appendData in interface org.apache.qpid.api.Message
Throws:
IOException

appendData

public void appendData(ByteBuffer src)
                throws IOException
write the data from the current position up to the buffer limit

Specified by:
appendData in interface org.apache.qpid.api.Message
Throws:
IOException

getDeliveryProperties

public org.apache.qpid.transport.DeliveryProperties getDeliveryProperties()
Specified by:
getDeliveryProperties in interface org.apache.qpid.api.Message

getMessageProperties

public org.apache.qpid.transport.MessageProperties getMessageProperties()
Specified by:
getMessageProperties in interface org.apache.qpid.api.Message

setDeliveryProperties

public void setDeliveryProperties(org.apache.qpid.transport.DeliveryProperties props)

setMessageProperties

public void setMessageProperties(org.apache.qpid.transport.MessageProperties props)

readData

public void readData(byte[] target)
Specified by:
readData in interface org.apache.qpid.api.Message

readData

public ByteBuffer readData()
Specified by:
readData in interface org.apache.qpid.api.Message

toString

public String toString()
Overrides:
toString in class Object


Licensed to the Apache Software Foundation