ittp.protocol.response
Class Response.Code

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byittp.protocol.response.Response.Code
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable
Enclosing class:
Response

public class Response.Code
extends java.util.HashMap

This class allow to know the state of the response. It allows also to declare the different number of response code.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
static int ITTP_BAD_REQUEST
           
static int ITTP_INTERNAL_ERROR
           
static int ITTP_METHOD_NOT_ALLOWED
           
static int ITTP_NOT_FOUND
           
static int ITTP_NOT_IMPLEMENTED
           
static int ITTP_NOT_MODIFIED
           
static int ITTP_OK
           
static int ITTP_OUT_OF_RANGE
           
static int ITTP_PARTIAL
           
static int ITTP_UNAVAILABLE
           
static int ITTP_VERSION
           
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
Response.Code()
          Constructor of the class.
 
Method Summary
(package private)  int getResponseCode()
          Accessors that allows to return the code of the state of the response.
 void setResponseCode(int response_code)
          Mutators for the response_code.
 java.lang.String toString()
          Accessors that allows to return the code and the message of the state of the response.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

ITTP_OK

public static final int ITTP_OK
See Also:
Constant Field Values

ITTP_PARTIAL

public static final int ITTP_PARTIAL
See Also:
Constant Field Values

ITTP_NOT_MODIFIED

public static final int ITTP_NOT_MODIFIED
See Also:
Constant Field Values

ITTP_BAD_REQUEST

public static final int ITTP_BAD_REQUEST
See Also:
Constant Field Values

ITTP_NOT_FOUND

public static final int ITTP_NOT_FOUND
See Also:
Constant Field Values

ITTP_METHOD_NOT_ALLOWED

public static final int ITTP_METHOD_NOT_ALLOWED
See Also:
Constant Field Values

ITTP_OUT_OF_RANGE

public static final int ITTP_OUT_OF_RANGE
See Also:
Constant Field Values

ITTP_INTERNAL_ERROR

public static final int ITTP_INTERNAL_ERROR
See Also:
Constant Field Values

ITTP_NOT_IMPLEMENTED

public static final int ITTP_NOT_IMPLEMENTED
See Also:
Constant Field Values

ITTP_UNAVAILABLE

public static final int ITTP_UNAVAILABLE
See Also:
Constant Field Values

ITTP_VERSION

public static final int ITTP_VERSION
See Also:
Constant Field Values
Constructor Detail

Response.Code

public Response.Code()
Constructor of the class. It associate each code to a corresponding error message.

Method Detail

setResponseCode

public void setResponseCode(int response_code)
Mutators for the response_code. If the code is superior to 400, then it is register like an error.

Parameters:
response_code - int containing the number of the error code.

getResponseCode

int getResponseCode()
Accessors that allows to return the code of the state of the response.

Returns:
the response code.

toString

public java.lang.String toString()
Accessors that allows to return the code and the message of the state of the response.

Returns:
the error message that the clieant will receive.