org.neociclo.odetteftp.protocol
Enum AnswerReason

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

public enum AnswerReason
extends Enum<AnswerReason>

Enumeration that represents each reason code for available Answer Reasons while transferring a Virtual File.

Answer Codes

        Value: 01 - Invalid filename.
               02 - Invalid destination.
               03 - Invalid origin.
               04 - Storage record format not supported.
               05 - Maximum record length not supported.
               06 - File size is too big.
               10 - Invalid record count.
               11 - Invalid byte count.
               12 - Access method failure.
               13 - Duplicate file.
               14 - File direction refused (since ODETTE FTP version 1.4).
               99 - Unspecified reason.
 
Following Answer Reasons are supported since ODETTE FTP v2.0:

ODETTE FTP v2.0 Extended Answer Codes

        Value: 15 - Cipher suite not supported.
               16 - Encrypted file not allowed.
               17 - Unencrypted file not allowed.
               18 - Compression not allowed.
               19 - Signed file not allowed.
               20 - Unsigned file not allowed.
               21 - Invalid file signature
               22 - File decryption failure
               23 - File decompression failure
 

Version:
$Rev: 765 $ $Date: 2010-10-06 16:58:26 -0300 (Wed, 06 Oct 2010) $
Author:
Rafael Marins

Enum Constant Summary
ACCESS_METHOD_FAILURE
          Access method failure.
CIPHER_SUITE_NOT_SUPPORTED
           
COMPRESSION_NOT_ALLOWED
           
DUPLICATE_FILE
          Duplicate file.
ENCRYPTED_FILE_NOT_ALLOWED
           
FILE_DECOMPRESSION_FAILURE
           
FILE_DECRYPTION_FAILURE
           
FILE_DIRECTION_REFUSED
          File direction refused.
FILE_SIZE_EXCEED
          File size is too big.
INVALID_BYTE_COUNT
          Invalid byte count.
INVALID_DESTINATION
          Invalid destination.
INVALID_FILE_SIGNATURE
           
INVALID_FILENAME
          Invalid filename.
INVALID_ORIGIN
          Invalid origin.
INVALID_RECORD_COUNT
          Invalid record count.
SIGNED_FILE_NOT_ALLOWED
           
UNENCRYPTED_FILE_NOT_ALLOWED
           
UNSIGNED_FILE_NOT_ALLOWED
           
UNSPECIFIED
          Unspecified reason.
UNSUPPORTED_MAXIMUM_RECORD_LENGTH
          Maximum record length not supported.
UNSUPPORTED_STORAGE_RECORD_FORMAT
          Storage record format not supported.
 
Method Summary
 int getCode()
          Return the protocol representation of AnswerReason enum.
static AnswerReason parse(int code)
          Convenient method for parsing the proper AnswerReason instance given a code String.
static AnswerReason valueOf(String name)
          Returns the enum constant of this type with the specified name.
static AnswerReason[] 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

ACCESS_METHOD_FAILURE

public static final AnswerReason ACCESS_METHOD_FAILURE
Access method failure.


CIPHER_SUITE_NOT_SUPPORTED

public static final AnswerReason CIPHER_SUITE_NOT_SUPPORTED

COMPRESSION_NOT_ALLOWED

public static final AnswerReason COMPRESSION_NOT_ALLOWED

DUPLICATE_FILE

public static final AnswerReason DUPLICATE_FILE
Duplicate file.


ENCRYPTED_FILE_NOT_ALLOWED

public static final AnswerReason ENCRYPTED_FILE_NOT_ALLOWED

FILE_DECOMPRESSION_FAILURE

public static final AnswerReason FILE_DECOMPRESSION_FAILURE

FILE_DECRYPTION_FAILURE

public static final AnswerReason FILE_DECRYPTION_FAILURE

FILE_DIRECTION_REFUSED

public static final AnswerReason FILE_DIRECTION_REFUSED
File direction refused. Valid only on ODDETE-FTP version 1.4 and above.


FILE_SIZE_EXCEED

public static final AnswerReason FILE_SIZE_EXCEED
File size is too big.


INVALID_BYTE_COUNT

public static final AnswerReason INVALID_BYTE_COUNT
Invalid byte count.


INVALID_DESTINATION

public static final AnswerReason INVALID_DESTINATION
Invalid destination.


INVALID_FILE_SIGNATURE

public static final AnswerReason INVALID_FILE_SIGNATURE

INVALID_FILENAME

public static final AnswerReason INVALID_FILENAME
Invalid filename.


INVALID_ORIGIN

public static final AnswerReason INVALID_ORIGIN
Invalid origin.


INVALID_RECORD_COUNT

public static final AnswerReason INVALID_RECORD_COUNT
Invalid record count.


SIGNED_FILE_NOT_ALLOWED

public static final AnswerReason SIGNED_FILE_NOT_ALLOWED

UNENCRYPTED_FILE_NOT_ALLOWED

public static final AnswerReason UNENCRYPTED_FILE_NOT_ALLOWED

UNSIGNED_FILE_NOT_ALLOWED

public static final AnswerReason UNSIGNED_FILE_NOT_ALLOWED

UNSPECIFIED

public static final AnswerReason UNSPECIFIED
Unspecified reason.


UNSUPPORTED_MAXIMUM_RECORD_LENGTH

public static final AnswerReason UNSUPPORTED_MAXIMUM_RECORD_LENGTH
Maximum record length not supported.


UNSUPPORTED_STORAGE_RECORD_FORMAT

public static final AnswerReason UNSUPPORTED_STORAGE_RECORD_FORMAT
Storage record format not supported.

Method Detail

values

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

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

valueOf

public static AnswerReason 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 AnswerReason parse(int code)
                          throws OdetteFtpException
Convenient method for parsing the proper AnswerReason instance given a code String.

Parameters:
code - The answer reason string being evaluated
Returns:
AnswerReason Instance that correspond to the parameter
Throws:
OdetteFtpException
CommandNotRecognisedException - Command not recognized

getCode

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

Returns:
String corresponding protocol code.


ACCORD