|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fossilec.odettej.service.OdetteExchangeBuffer
public abstract class OdetteExchangeBuffer
The communication between Odette FTP entities is basically done by sending and receiving messages in Exchange Buffers via the transport layer. An Odette Exchange Buffer can have either a Command or Data buffer.
Field Summary | |
---|---|
protected java.nio.ByteBuffer |
buffer
The content of this Exchange Buffer. |
protected static java.lang.String |
BUFFER_CHARSET
|
static int |
MAX_OEB_LENGTH
Maximum Exchange Buffer length allowed by protocol specification. |
static int |
MIN_OEB_LENGTH
Minimum Exchange Buffer length allowed by protocol specification. |
Constructor Summary | |
---|---|
protected |
OdetteExchangeBuffer()
|
Method Summary | |
---|---|
java.nio.ByteBuffer |
getBuffer()
Return the Exchange Buffer rewinded. |
CommandIdentifier |
getIdentifier()
Return the corresponding CommandIdentifier relative to the
Exchange Buffer contents. |
static OdetteExchangeBuffer |
getInstance(java.nio.ByteBuffer rawBuffer,
boolean strictFormat)
Create and return a new OdetteExchangeBuffer instance corresponding to a Command Exchange Buffer or Data Exchange Buffer, regarding the identifier at first octet of the exchange buffer data. |
int |
getLength()
Get the Odette Exchange Buffer length. |
protected abstract void |
parse(java.nio.ByteBuffer rawBuffer)
|
protected void |
setBuffer(java.nio.ByteBuffer buffer)
|
protected void |
setIdentifier(CommandIdentifier identifier)
|
protected void |
setLength(int length)
Set the Odette Exchange Buffer length. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MIN_OEB_LENGTH
public static final int MAX_OEB_LENGTH
protected static final java.lang.String BUFFER_CHARSET
protected java.nio.ByteBuffer buffer
Constructor Detail |
---|
protected OdetteExchangeBuffer()
Method Detail |
---|
public CommandIdentifier getIdentifier() throws OdetteFTPException
CommandIdentifier
relative to the
Exchange Buffer contents. Its value is parsed from the first octet of the
Exchange Buffer specified through class constructor.
The CommandIdentifier defines the format of the Exchange Buffer contents.
CommandNotRecognisedException
- Command identifier not recognised in the specified buffer.
java.nio.charset.IllegalCharsetNameException
- Error while decoding byte buffer with a invalid charset.
OdetteFTPException
CommandIdentifier
protected void setIdentifier(CommandIdentifier identifier)
public java.nio.ByteBuffer getBuffer()
protected void setBuffer(java.nio.ByteBuffer buffer)
protected abstract void parse(java.nio.ByteBuffer rawBuffer) throws OdetteFTPException
rawBuffer
- bufferLength
-
java.lang.IllegalArgumentException
- If the buffer is null.
OdetteFTPException
BufferCorruptedException
- When a invalid buffer length is specified or with a wrong
position.public int getLength()
protected void setLength(int length)
length
- The length of Odette Exchange Buffer.public static OdetteExchangeBuffer getInstance(java.nio.ByteBuffer rawBuffer, boolean strictFormat) throws OdetteFTPException
rawBuffer
- The overall Exchange Buffer.bufferLength
- Length of the remaining buffer to be read.
OdetteFTPException
CommandNotRecognisedException
- Command identifier not recognised.
BufferCorruptedException
- When a invalid buffer length is specified or the buffer is
badly positioned.CommandExchangeBuffer
,
DataExchangeBuffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |