org.springframework.extensions.webscripts
Class Status

java.lang.Object
  extended by org.springframework.extensions.webscripts.Status
Direct Known Subclasses:
ResponseStatus

public class Status
extends Object

Web Script Status Records the outcome of a Web Script.

Author:
davidc

Field Summary
static int STATUS_ACCEPTED
           
static int STATUS_BAD_GATEWAY
           
static int STATUS_BAD_REQUEST
           
static int STATUS_CONFLICT
           
static int STATUS_CONTINUE
          Status code constants
static int STATUS_CREATED
           
static int STATUS_EXPECTATION_FAILED
           
static int STATUS_FORBIDDEN
           
static int STATUS_FOUND
           
static int STATUS_GATEWAY_TIMEOUT
           
static int STATUS_GONE
           
static int STATUS_HTTP_VERSION_NOT_SUPPORTED
           
static int STATUS_INTERNAL_SERVER_ERROR
           
static int STATUS_LENGTH_REQUIRED
           
static int STATUS_METHOD_NOT_ALLOWED
           
static int STATUS_MOVED_PERMANENTLY
           
static int STATUS_MOVED_TEMPORARILY
           
static int STATUS_MULTIPLE_CHOICES
           
static int STATUS_NO_CONTENT
           
static int STATUS_NON_AUTHORITATIVE_INFORMATION
           
static int STATUS_NOT_ACCEPTABLE
           
static int STATUS_NOT_FOUND
           
static int STATUS_NOT_IMPLEMENTED
           
static int STATUS_NOT_MODIFIED
           
static int STATUS_OK
           
static int STATUS_PARTIAL_CONTENT
           
static int STATUS_PAYMENT_REQUIRED
           
static int STATUS_PRECONDITION_FAILED
           
static int STATUS_PROXY_AUTHENTICATION_REQUIRED
           
static int STATUS_REQUEST_ENTITY_TOO_LARGE
           
static int STATUS_REQUEST_TIMEOUT
           
static int STATUS_REQUEST_URI_TOO_LONG
           
static int STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
           
static int STATUS_RESET_CONTENT
           
static int STATUS_SEE_OTHER
           
static int STATUS_SERVICE_UNAVAILABLE
           
static int STATUS_SWITCHING_PROTOCOLS
           
static int STATUS_TEMPORARY_REDIRECT
           
static int STATUS_UNAUTHORIZED
           
static int STATUS_UNSUPPORTED_MEDIA_TYPE
           
static int STATUS_USE_PROXY
           
 
Constructor Summary
Status()
           
 
Method Summary
 int getCode()
           
 String getCodeDescription()
          Gets the description of the status code
 String getCodeName()
          Gets the short name of the status code
 Throwable getException()
           
 String getLocation()
           
 String getMessage()
           
 boolean getRedirect()
           
 void setCode(int code)
           
 void setCode(int code, String message)
          Helper method to set the code and message.
 void setException(Throwable exception)
           
 void setLocation(String location)
           
 void setMessage(String message)
           
 void setRedirect(boolean redirect)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_CONTINUE

public static final int STATUS_CONTINUE
Status code constants

See Also:
Constant Field Values

STATUS_SWITCHING_PROTOCOLS

public static final int STATUS_SWITCHING_PROTOCOLS
See Also:
Constant Field Values

STATUS_OK

public static final int STATUS_OK
See Also:
Constant Field Values

STATUS_CREATED

public static final int STATUS_CREATED
See Also:
Constant Field Values

STATUS_ACCEPTED

public static final int STATUS_ACCEPTED
See Also:
Constant Field Values

STATUS_NON_AUTHORITATIVE_INFORMATION

public static final int STATUS_NON_AUTHORITATIVE_INFORMATION
See Also:
Constant Field Values

STATUS_NO_CONTENT

public static final int STATUS_NO_CONTENT
See Also:
Constant Field Values

STATUS_RESET_CONTENT

public static final int STATUS_RESET_CONTENT
See Also:
Constant Field Values

STATUS_PARTIAL_CONTENT

public static final int STATUS_PARTIAL_CONTENT
See Also:
Constant Field Values

STATUS_MULTIPLE_CHOICES

public static final int STATUS_MULTIPLE_CHOICES
See Also:
Constant Field Values

STATUS_MOVED_PERMANENTLY

public static final int STATUS_MOVED_PERMANENTLY
See Also:
Constant Field Values

STATUS_MOVED_TEMPORARILY

public static final int STATUS_MOVED_TEMPORARILY
See Also:
Constant Field Values

STATUS_FOUND

public static final int STATUS_FOUND
See Also:
Constant Field Values

STATUS_SEE_OTHER

public static final int STATUS_SEE_OTHER
See Also:
Constant Field Values

STATUS_NOT_MODIFIED

public static final int STATUS_NOT_MODIFIED
See Also:
Constant Field Values

STATUS_USE_PROXY

public static final int STATUS_USE_PROXY
See Also:
Constant Field Values

STATUS_TEMPORARY_REDIRECT

public static final int STATUS_TEMPORARY_REDIRECT
See Also:
Constant Field Values

STATUS_BAD_REQUEST

public static final int STATUS_BAD_REQUEST
See Also:
Constant Field Values

STATUS_UNAUTHORIZED

public static final int STATUS_UNAUTHORIZED
See Also:
Constant Field Values

STATUS_PAYMENT_REQUIRED

public static final int STATUS_PAYMENT_REQUIRED
See Also:
Constant Field Values

STATUS_FORBIDDEN

public static final int STATUS_FORBIDDEN
See Also:
Constant Field Values

STATUS_NOT_FOUND

public static final int STATUS_NOT_FOUND
See Also:
Constant Field Values

STATUS_METHOD_NOT_ALLOWED

public static final int STATUS_METHOD_NOT_ALLOWED
See Also:
Constant Field Values

STATUS_NOT_ACCEPTABLE

public static final int STATUS_NOT_ACCEPTABLE
See Also:
Constant Field Values

STATUS_PROXY_AUTHENTICATION_REQUIRED

public static final int STATUS_PROXY_AUTHENTICATION_REQUIRED
See Also:
Constant Field Values

STATUS_REQUEST_TIMEOUT

public static final int STATUS_REQUEST_TIMEOUT
See Also:
Constant Field Values

STATUS_CONFLICT

public static final int STATUS_CONFLICT
See Also:
Constant Field Values

STATUS_GONE

public static final int STATUS_GONE
See Also:
Constant Field Values

STATUS_LENGTH_REQUIRED

public static final int STATUS_LENGTH_REQUIRED
See Also:
Constant Field Values

STATUS_PRECONDITION_FAILED

public static final int STATUS_PRECONDITION_FAILED
See Also:
Constant Field Values

STATUS_REQUEST_ENTITY_TOO_LARGE

public static final int STATUS_REQUEST_ENTITY_TOO_LARGE
See Also:
Constant Field Values

STATUS_REQUEST_URI_TOO_LONG

public static final int STATUS_REQUEST_URI_TOO_LONG
See Also:
Constant Field Values

STATUS_UNSUPPORTED_MEDIA_TYPE

public static final int STATUS_UNSUPPORTED_MEDIA_TYPE
See Also:
Constant Field Values

STATUS_REQUESTED_RANGE_NOT_SATISFIABLE

public static final int STATUS_REQUESTED_RANGE_NOT_SATISFIABLE
See Also:
Constant Field Values

STATUS_EXPECTATION_FAILED

public static final int STATUS_EXPECTATION_FAILED
See Also:
Constant Field Values

STATUS_INTERNAL_SERVER_ERROR

public static final int STATUS_INTERNAL_SERVER_ERROR
See Also:
Constant Field Values

STATUS_NOT_IMPLEMENTED

public static final int STATUS_NOT_IMPLEMENTED
See Also:
Constant Field Values

STATUS_BAD_GATEWAY

public static final int STATUS_BAD_GATEWAY
See Also:
Constant Field Values

STATUS_SERVICE_UNAVAILABLE

public static final int STATUS_SERVICE_UNAVAILABLE
See Also:
Constant Field Values

STATUS_GATEWAY_TIMEOUT

public static final int STATUS_GATEWAY_TIMEOUT
See Also:
Constant Field Values

STATUS_HTTP_VERSION_NOT_SUPPORTED

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

Status

public Status()
Method Detail

setCode

public void setCode(int code,
                    String message)
Helper method to set the code and message.

Redirect is set to true.

Parameters:
code - code
message - message

setException

public void setException(Throwable exception)
Parameters:
exception -

getException

public Throwable getException()
Returns:
exception

setMessage

public void setMessage(String message)
Parameters:
message -

getMessage

public String getMessage()
Returns:
message

setRedirect

public void setRedirect(boolean redirect)
Parameters:
redirect - redirect to status code response

getRedirect

public boolean getRedirect()
Returns:
redirect to status code response

setCode

public void setCode(int code)
Parameters:
code - status code
See Also:
javax.servlet.http.HTTPServletResponse

getCode

public int getCode()
Returns:
status code

getCodeName

public String getCodeName()
Gets the short name of the status code

Returns:
status code name

setLocation

public void setLocation(String location)
Parameters:
location - location response-header
See Also:
javax.servlet.http.HTTPServletResponse

getLocation

public String getLocation()
Returns:
location

getCodeDescription

public String getCodeDescription()
Gets the description of the status code

Returns:
status code description

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 SpringSource, Inc. All Rights Reserved.