com.yosokumo.core
Class ServiceException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.yosokumo.core.ServiceException
All Implemented Interfaces:
java.io.Serializable

public class ServiceException
extends java.lang.Exception

Encapsulates all exceptions which can be thrown by the Yosokumo Service.

See Also:
Serialized Form

Constructor Summary
ServiceException(java.lang.String message)
          Constructs a new exception with the specified detail message.
ServiceException(java.lang.String message, java.lang.Throwable cause)
          Constructs a new exception with the specified detail message and cause.
ServiceException(java.lang.String message, java.lang.Throwable cause, int statusCode, java.lang.String failedMethodName)
          Constructs a new exception with the specified detail message, cause, status code and failed method name.
 
Method Summary
 java.lang.String getFailedMethodName()
          Return the name of the Service method which failed with this exception.
 int getStatusCode()
          Return HTTP status code.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ServiceException

public ServiceException(java.lang.String message)
Constructs a new exception with the specified detail message. The cause is not initialized and may subsequently be initialized by a call to Throwable.initCause(java.lang.Throwable).

Parameters:
message - the detail message. The detail message is saved for later retrieval by the Throwable.getMessage() method.

ServiceException

public ServiceException(java.lang.String message,
                        java.lang.Throwable cause)
Constructs a new exception with the specified detail message and cause. Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method.
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)

ServiceException

public ServiceException(java.lang.String message,
                        java.lang.Throwable cause,
                        int statusCode,
                        java.lang.String failedMethodName)
Constructs a new exception with the specified detail message, cause, status code and failed method name. Note that the detail message associated with cause is not automatically incorporated in this exception's detail message.

Parameters:
message - the detail message (which is saved for later retrieval by the Throwable.getMessage() method.
cause - the cause (which is saved for later retrieval by the Throwable.getCause() method). (A null value is permitted, and indicates that the cause is nonexistent or unknown.)
Method Detail

getStatusCode

public int getStatusCode()
Return HTTP status code.

Returns:
status code from most recent HTTP response. A zero means the most recent HTTP request did not result in a response, e.g., there is no network connection.

getFailedMethodName

public java.lang.String getFailedMethodName()
Return the name of the Service method which failed with this exception.

Returns:
name of the Service method which failed.