|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fossilec.odettej.service.OdetteExchangeBuffer
org.fossilec.odettej.service.CommandExchangeBuffer
public class CommandExchangeBuffer
A Command Exchange Buffer contains a single command starting at the beginning of the buffer. Commands and data are never mixed within an Exchange Buffer. Each command has a fixed length and can not be compressed.
Field Summary |
---|
Fields inherited from class org.fossilec.odettej.service.OdetteExchangeBuffer |
---|
buffer, BUFFER_CHARSET, MAX_OEB_LENGTH, MIN_OEB_LENGTH |
Constructor Summary | |
---|---|
protected |
CommandExchangeBuffer(java.nio.ByteBuffer rawBuffer,
boolean strictFormat)
|
Method Summary | |
---|---|
static CommandExchangeBuffer |
changeDirection()
Create the Change Direction command. |
static CommandExchangeBuffer |
endFile(int recordCount,
long unitCount)
Create the End File command indicating the count of records and overall octets from the transmitted Virtual File. The count will express the real size of the file (before compression, header not included). |
static CommandExchangeBuffer |
endFileNegativeAnswer(AnswerReason reason)
Create the End File Negative Answer command providing the reason for stopping transfer. |
static CommandExchangeBuffer |
endFilePositiveAnswer(boolean changeDirection)
Create the End File Positive Answer command indicating whether the Listener is requesting or not a Change Direction (CD) command from Speaker or not. |
static CommandExchangeBuffer |
endSession(EndSessionReason reason)
Create the End Session command indicating the reason code for terminating the session. |
static CommandExchangeBuffer |
endToEndResponse(java.lang.String dataSetName,
java.lang.String reserved,
java.util.Date dateTime,
java.lang.String userData,
java.lang.String destination,
java.lang.String originator)
Create the End to End Response command with given parameters. |
java.lang.String |
getParameter(java.lang.String name)
Return a Command Exchange Buffer parameter value for the specified field. |
java.util.Collection |
getParameters()
|
protected void |
parse(java.nio.ByteBuffer rawBuffer)
Method used to set configure this object with the value from parsing the given raw buffer. |
static CommandExchangeBuffer |
readyMessage()
Start Session Ready Message. |
static CommandExchangeBuffer |
readyToReceive()
Create the Ready to Receive command. |
static CommandExchangeBuffer |
setCredit(java.lang.String reserved)
Create the Set Credit command which is used to avoid congestion at the protocol level a flow control. |
protected void |
setParamater(java.lang.String name,
java.lang.String value)
Set a parameter in command stream with the given value. |
static CommandExchangeBuffer |
startFile(java.lang.String datasetName,
java.lang.String reserved,
java.util.Date dateTime,
java.lang.String userData,
java.lang.String destination,
java.lang.String originator,
RecordFormat recordFormat,
int maxRecordSize,
int fileSize,
int restartOffset)
Create the Start File command with given parameters. The Start File command includes a count allowing the restart of an interrupted transmission to be negotiated. |
static CommandExchangeBuffer |
startFileNegativeAnswer(AnswerReason reason,
boolean retry)
Create the Start File Negative Answer command containing the the reason why transmission can not proced. This retry parameter is used to advise the Speaker if it
should retry at a latter point in time due to a temporary condition at
the Listener site, such as a lack of storage space. |
static CommandExchangeBuffer |
startFilePositiveAnswer(int answerCount)
Create the Start File Positive Answer command. |
static CommandExchangeBuffer |
startSession(java.lang.String code,
java.lang.String pswd,
int sdeb,
TransferMode mode,
boolean compression,
boolean restart,
boolean specialLogic,
int credit,
java.lang.String reserved,
java.lang.String userData)
Create the Start Session command with given parameters. |
Methods inherited from class org.fossilec.odettej.service.OdetteExchangeBuffer |
---|
getBuffer, getIdentifier, getInstance, getLength, setBuffer, setIdentifier, setLength |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected CommandExchangeBuffer(java.nio.ByteBuffer rawBuffer, boolean strictFormat) throws OdetteFTPException
OdetteFTPException
Method Detail |
---|
public static CommandExchangeBuffer readyMessage() throws OdetteFTPException
CommandExchangeBuffer
.
OdetteFTPException
public static CommandExchangeBuffer startSession(java.lang.String code, java.lang.String pswd, int sdeb, TransferMode mode, boolean compression, boolean restart, boolean specialLogic, int credit, java.lang.String reserved, java.lang.String userData) throws OdetteFTPException
code
- Initiator's Identification Code which uniquely identifies the
Initiator (sender) participating in the Odette FTP session.pswd
- Key to authenticate the sender. Assigned by bilateral
agreement.sdeb
- The length, in octets, of the largest Exchange Buffer that can
be accepted by the location.sendReceive
- Sender / Receiver capabilities:compression
- Compression indicator. true
if the location can
handle compressed data. Otherwise it should be
false
.restart
- Restart indication informing whether the location can handle
the restart of a partially transmitted file.specialLogic
- Special logic indication.credit
- Credit.reserved
- Reserved for future use.userData
- User Data.
OdetteFTPException
public static CommandExchangeBuffer startFile(java.lang.String datasetName, java.lang.String reserved, java.util.Date dateTime, java.lang.String userData, java.lang.String destination, java.lang.String originator, RecordFormat recordFormat, int maxRecordSize, int fileSize, int restartOffset) throws OdetteFTPException
datasetName
- Dataset name of the Virtual File being transferred assigned by
bilateral agreement.reserved
- This field is reserved for future use.dateTime
- Specific Date and Time assigned by the Virtual File's
Originator indicating when the file was made avaiable for
transmission.userData
- May be used by the Odette FTP in any way. If unused it should
be initialized to spaces. It is expected that a bilateral
agreement exists as to the meaning of the data.destination
- The Identification Code for the final recipient of the Virtual
File. This is the location that will look into the Virtual
File content and perform mapping functions. It is also the
location that creates the End to End Response (EERP) command
for the received file.originator
- The Identification Code from the Originator of the Virtual
File. It is the location that created (mapped) the data for
transmission.recordFormat
- Virtual File format (Fixed, Variable, Unustructured, Text
File). Used to calculate the restart position.maxRecordSize
- Length in octets of the longest logical record which may be
transferred to a location. Only user data is included. If File
format is 'T' or 'U' then this attribute must be set to
'00000'fileSize
- File Size, 1K (1024 octets) blocks.restartOffset
- Restart position.
OdetteFTPException
public static CommandExchangeBuffer startFilePositiveAnswer(int answerCount) throws OdetteFTPException
answerCount
- int
lower or equal to restart count specified
by the Speaker in the Start File (SFID) command. If restart
facilities are not avaiable, a count of zero must be
specified.
OdetteFTPException
public static CommandExchangeBuffer startFileNegativeAnswer(AnswerReason reason, boolean retry) throws OdetteFTPException
retry
parameter is used to advise the Speaker if it
should retry at a latter point in time due to a temporary condition at
the Listener site, such as a lack of storage space. It should be used in
conjunction with the Answer Reason code.
reason
- Answer Reason.retry
- true
if the transmission may be retried latter,
or false
to don't retry again.
OdetteFTPException
public static CommandExchangeBuffer setCredit(java.lang.String reserved) throws OdetteFTPException
reserved
- This field is reserved for future use.
OdetteFTPException
public static CommandExchangeBuffer endFile(int recordCount, long unitCount) throws OdetteFTPException
recordCount
- For FIXED or VARIABLE record formats, the exact record count.
For UNSTRUCTURED or TEXTFILE, must be zero.unitCount
- Exact number of units (octets) transmitted.
OdetteFTPException
public static CommandExchangeBuffer endFilePositiveAnswer(boolean changeDirection) throws OdetteFTPException
changeDirection
- Change Direction Indicator.
OdetteFTPException
public static CommandExchangeBuffer endFileNegativeAnswer(AnswerReason reason) throws OdetteFTPException
reason
- Reason why transmission can not proceed.
OdetteFTPException
public static CommandExchangeBuffer endSession(EndSessionReason reason) throws OdetteFTPException
reason
- End Session Reason.
OdetteFTPException
public static CommandExchangeBuffer changeDirection() throws OdetteFTPException
OdetteFTPException
public static CommandExchangeBuffer endToEndResponse(java.lang.String dataSetName, java.lang.String reserved, java.util.Date dateTime, java.lang.String userData, java.lang.String destination, java.lang.String originator) throws OdetteFTPException
dataSetName
- Dataset name of the Virtual File being transfered.reserved
- This field is reserved for future use.dateTime
- Virtual File date and time indicating when the file was made
available for transmission.userData
- May be used by the Odette FTP in any way.destination
- Identification code from the Originator of the Virtual File,
which created (mapped) the data for transmission.originator
- Identification code of the Final Recipient of the Virtual
File. This is the location that creates the EERP for the
received file.
OdetteFTPException
public static CommandExchangeBuffer readyToReceive() throws OdetteFTPException
OdetteFTPException
public java.lang.String getParameter(java.lang.String name)
name
- Field key name.
public java.util.Collection getParameters()
protected void setParamater(java.lang.String name, java.lang.String value) throws OdetteFTPException
name
- parameter name (as defined in protocol specification).value
- String
representing the given value as expected
by protocol specification.
OdetteFTPException
protected void parse(java.nio.ByteBuffer rawBuffer) throws OdetteFTPException
parse
in class OdetteExchangeBuffer
rawBuffer
- raw command exchange buffer to parse.
BufferCorruptedException
- When buffer has a invalid remaing size, or there's a wrong
command length (and the strictly check format option is set).
OdetteFTPException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |