org.neociclo.odetteftp.protocol
Enum CommandIdentifier

java.lang.Object
  extended by java.lang.Enum<CommandIdentifier>
      extended by org.neociclo.odetteftp.protocol.CommandIdentifier
All Implemented Interfaces:
Serializable, Comparable<CommandIdentifier>

public enum CommandIdentifier
extends Enum<CommandIdentifier>

Odette FTP entities communicate by sending and receiving messages in Exchange Buffers. Each Exchange Buffer correspond to a command which is defined by the Command Identifier. The identifier is verified at the first octet of an Exchange Buffer that define the format of the remaing buffer.

The CommandIdentifier class provide type safe instances to distinguish every Exchange Buffer over all supported commands types.

Version:
$Rev: 302 $ $Date: 2010-04-27 15:32:42 -0300 (Tue, 27 Apr 2010) $
Author:
Rafael Marins

Enum Constant Summary
AUCH
          Authentication Challenge
AURP
          Authentication Response
CD
          Change Direction
CDT
          Set Credit
DATA
          Data
EERP
          End to End Response
EFID
          End File
EFNA
          End File Negative Answer
EFPA
          End File Positive Answer
ESID
          End Session
NERP
          Negative End to End Response
RTR
          Ready To Receive
SECD
          Security Change Direction
SFID
          Start File
SFNA
          Start File Negative Answer
SFPA
          Start File Positive Answer
SSID
          Start Session
SSRM
          Start Session Ready Message
 
Method Summary
 char getCode()
          Return the protocol representation of CommandIdentifier enum.
static CommandIdentifier parse(char code)
          Convenient method for parsing the proper CommandIdentifier instance given a identifier character.
static CommandIdentifier valueOf(String name)
          Returns the enum constant of this type with the specified name.
static CommandIdentifier[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

AUCH

public static final CommandIdentifier AUCH
Authentication Challenge


AURP

public static final CommandIdentifier AURP
Authentication Response


CD

public static final CommandIdentifier CD
Change Direction


CDT

public static final CommandIdentifier CDT
Set Credit


DATA

public static final CommandIdentifier DATA
Data


EERP

public static final CommandIdentifier EERP
End to End Response


EFID

public static final CommandIdentifier EFID
End File


EFNA

public static final CommandIdentifier EFNA
End File Negative Answer


EFPA

public static final CommandIdentifier EFPA
End File Positive Answer


ESID

public static final CommandIdentifier ESID
End Session


NERP

public static final CommandIdentifier NERP
Negative End to End Response


RTR

public static final CommandIdentifier RTR
Ready To Receive


SECD

public static final CommandIdentifier SECD
Security Change Direction


SFID

public static final CommandIdentifier SFID
Start File


SFNA

public static final CommandIdentifier SFNA
Start File Negative Answer


SFPA

public static final CommandIdentifier SFPA
Start File Positive Answer


SSID

public static final CommandIdentifier SSID
Start Session


SSRM

public static final CommandIdentifier SSRM
Start Session Ready Message

Method Detail

values

public static CommandIdentifier[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (CommandIdentifier c : CommandIdentifier.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CommandIdentifier valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

parse

public static CommandIdentifier parse(char code)
                               throws OdetteFtpException
Convenient method for parsing the proper CommandIdentifier instance given a identifier character.

Parameters:
identifier - The command identifier being evaluated
Returns:
CommandIdentifier Instance that correspond to the parameter
Throws:
CommandNotRecognisedException - Command not recognised
OdetteFtpException

getCode

public char getCode()
Return the protocol representation of CommandIdentifier enum.

Returns:
String corresponding protocol code.


ACCORD