org.neociclo.odetteftp.protocol
Enum EndSessionReason

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

public enum EndSessionReason
extends Enum<EndSessionReason>

Enumeration representing each End Session Reason available.

Code table:

          Value: 00 - Normal session termination
                 01 - Command not recognized
                 02 - Protocol violation
                 03 - User code not known
                 04 - Invalid password
                 05 - Local site emergency close down
                 06 - Command contained invalid data
                 07 - Exchange Buffer size error
                 08 - Resources not available
                 09 - Time out
                 10 - Mode or capabilities incompatible
                 99 - Unspecified Abort code
 
Following End Session Reasons are supported since ODETTE FTP v2.0:

ODETTE FTP v2.0 Extended End Session Reason Codes

        Value: 11 - Invalid challenge response
               12 - Secure authentication requirements incompatible
 

Version:
$Rev: 122 $ $Date: 2009-07-22 08:20:41 -0300 (Wed, 22 Jul 2009) $
Author:
Rafael Marins

Enum Constant Summary
COMMAND_NOT_RECOGNISED
          Command not recognised.
EMERGENCY_CLOSE_DOWN
          Local site emergency close down.
EXCHANGE_BUFFER_SIZE_ERROR
          Exchange Buffer size error.
INCOMPATIBLE_MODE
          Mode or capabilities are incompatible.
INCOMPATIBLE_SECURE_AUTHENTICATION
          Secure authentication requirements incompatible.
INVALID_CHALLENGE_RESPONSE
          Invalid challenge response.
INVALID_COMMAND_DATA
          Command contained invalid data.
INVALID_PASSWORD
          Invalid password.
NORMAL_TERMINATION
          Normal session termination.
PROTOCOL_VIOLATION
          Protocol violation.
RESOURCES_NOT_AVAIABLE
          Resources not avaiable.
TIME_OUT
          Time out.
UNKNOWN_USER_CODE
          User code not known.
UNSPECIFIED_ABORT
          Unspecified Abort code.
 
Method Summary
 int getCode()
          Return the protocol representation of enum.
static EndSessionReason parse(int code)
          Convenient method for parsing the proper EndSessionReason enum given a identifier character.
static EndSessionReason valueOf(String name)
          Returns the enum constant of this type with the specified name.
static EndSessionReason[] 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

COMMAND_NOT_RECOGNISED

public static final EndSessionReason COMMAND_NOT_RECOGNISED
Command not recognised.

An Exchange Buffer contains an invalid command identifier (1st octet of the buffer).


EMERGENCY_CLOSE_DOWN

public static final EndSessionReason EMERGENCY_CLOSE_DOWN
Local site emergency close down.

The local site has entered an emergency close down mode. Communications are being forcibly terminated.


EXCHANGE_BUFFER_SIZE_ERROR

public static final EndSessionReason EXCHANGE_BUFFER_SIZE_ERROR
Exchange Buffer size error.

The length of the Exchange Buffer as determined by the Stream Transmission Header is different to the length implied by the Command Code.


INCOMPATIBLE_MODE

public static final EndSessionReason INCOMPATIBLE_MODE
Mode or capabilities are incompatible.


INCOMPATIBLE_SECURE_AUTHENTICATION

public static final EndSessionReason INCOMPATIBLE_SECURE_AUTHENTICATION
Secure authentication requirements incompatible.


INVALID_COMMAND_DATA

public static final EndSessionReason INVALID_COMMAND_DATA
Command contained invalid data.

A field within a Command Exchange buffer contains invalid data.


INVALID_CHALLENGE_RESPONSE

public static final EndSessionReason INVALID_CHALLENGE_RESPONSE
Invalid challenge response.

The comparison between the authentication challenge original value sent (encrypted with other peer's public-key) and the returning challenge response doesn't match.


INVALID_PASSWORD

public static final EndSessionReason INVALID_PASSWORD
Invalid password.

A Start Session (SSID) command contains an invalid password for the specified user identification.


NORMAL_TERMINATION

public static final EndSessionReason NORMAL_TERMINATION
Normal session termination.


PROTOCOL_VIOLATION

public static final EndSessionReason PROTOCOL_VIOLATION
Protocol violation.

An Exchange Buffer contains an invalid command for the current state of the receiver.


RESOURCES_NOT_AVAIABLE

public static final EndSessionReason RESOURCES_NOT_AVAIABLE
Resources not avaiable.

The request for connection has been denied due to a resource shortage. The connection attempt should be retried later.


TIME_OUT

public static final EndSessionReason TIME_OUT
Time out.


UNKNOWN_USER_CODE

public static final EndSessionReason UNKNOWN_USER_CODE
User code not known.

A Start Session (SSID) command contains an unknown or invalid Identification Code.


UNSPECIFIED_ABORT

public static final EndSessionReason UNSPECIFIED_ABORT
Unspecified Abort code.

An error was detected for which no specific code is defined.

Method Detail

values

public static EndSessionReason[] 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 (EndSessionReason c : EndSessionReason.values())
    System.out.println(c);

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

valueOf

public static EndSessionReason 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 EndSessionReason parse(int code)
                              throws OdetteFtpException
Convenient method for parsing the proper EndSessionReason enum given a identifier character.

Parameters:
code - The end session reason being evaluated
Returns:
EndSessionReason enum that correspond to the given code.
Throws:
OdetteFtpException
CommandNotRecognisedException - Code not recognized

getCode

public int getCode()
Return the protocol representation of enum.

Returns:
byte corresponding protocol code.


ACCORD