Liferay 6.2-ce-ga5

com.liferay.portal.kernel.nio.intraband
Class Datagram

java.lang.Object
  extended by com.liferay.portal.kernel.nio.intraband.Datagram

public class Datagram
extends Object

Represents the communication unit of Intraband.

Encodes/decodes data to/from big-endian byte order data format:

NameTypeSize(byte)Offset
Status Flagbyte10
Sequence IDlong81
Data Typebyte19
Data Sizeint410
Data Chunk byte[]
${Data Size}
14


Field Summary
protected  Object attachment
           
protected  CompletionHandler<Object> completionHandler
           
protected  EnumSet<CompletionHandler.CompletionType> completionTypes
           
protected  long expireTime
           
protected  long timeout
           
 
Method Summary
protected static Datagram createACKResponseDatagram(long sequenceId)
           
protected static Datagram createReceiveDatagram()
           
static Datagram createRequestDatagram(byte type, byte[] data)
           
static Datagram createRequestDatagram(byte type, ByteBuffer dataByteBuffer)
           
static Datagram createResponseDatagram(Datagram requestDatagram, byte[] data)
           
static Datagram createResponseDatagram(Datagram requestDatagram, ByteBuffer byteBuffer)
           
 ByteBuffer getDataByteBuffer()
           
protected  long getSequenceId()
           
 byte getType()
           
protected  boolean isAckRequest()
           
protected  boolean isAckResponse()
           
protected  boolean isRequest()
           
protected  boolean isResponse()
           
protected  boolean readFrom(ScatteringByteChannel scatteringByteChannel)
           
protected  void setAckRequest(boolean ackRequest)
           
protected  void setSequenceId(long sequenceId)
           
 String toString()
           
protected  boolean writeTo(GatheringByteChannel gatheringByteChannel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

attachment

protected Object attachment

completionHandler

protected CompletionHandler<Object> completionHandler

completionTypes

protected EnumSet<CompletionHandler.CompletionType> completionTypes

expireTime

protected long expireTime

timeout

protected long timeout
Method Detail

createRequestDatagram

public static Datagram createRequestDatagram(byte type,
                                             byte[] data)

createRequestDatagram

public static Datagram createRequestDatagram(byte type,
                                             ByteBuffer dataByteBuffer)

createResponseDatagram

public static Datagram createResponseDatagram(Datagram requestDatagram,
                                              byte[] data)

createResponseDatagram

public static Datagram createResponseDatagram(Datagram requestDatagram,
                                              ByteBuffer byteBuffer)

getDataByteBuffer

public ByteBuffer getDataByteBuffer()

getType

public byte getType()

toString

public String toString()
Overrides:
toString in class Object

createACKResponseDatagram

protected static Datagram createACKResponseDatagram(long sequenceId)

createReceiveDatagram

protected static Datagram createReceiveDatagram()

getSequenceId

protected long getSequenceId()

isAckRequest

protected boolean isAckRequest()

isAckResponse

protected boolean isAckResponse()

isRequest

protected boolean isRequest()

isResponse

protected boolean isResponse()

readFrom

protected boolean readFrom(ScatteringByteChannel scatteringByteChannel)
                    throws IOException
Throws:
IOException

setAckRequest

protected void setAckRequest(boolean ackRequest)

setSequenceId

protected void setSequenceId(long sequenceId)

writeTo

protected boolean writeTo(GatheringByteChannel gatheringByteChannel)
                   throws IOException
Throws:
IOException

Liferay 6.2-ce-ga5