com.cybersource.ws.client
Class ClientException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.cybersource.ws.client.ClientException
All Implemented Interfaces:
java.io.Serializable

public class ClientException
extends java.lang.Exception

Exception class used by both Basic and XML clients.

See Also:
Serialized Form

Constructor Summary
ClientException(java.lang.Exception _innerException, boolean _critical, Logger logger)
          Constructor.
ClientException(java.lang.Exception _innerException, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, java.lang.String _httpError, boolean _critical, Logger logger)
          Constructor.
ClientException(int _httpStatusCode, java.lang.String _httpError, Logger logger)
          Constructor.
 
Method Summary
 java.lang.String getHttpError()
          Returns additional HTTP error information, if any.
 int getHttpStatusCode()
          Returns the HTTP status code, if any.
 java.lang.Exception getInnerException()
          Returns the actual exception that occurred, if any.
 java.lang.String getLogString()
          Returns a string representation of the object for logging purposes.
 java.lang.String getMessage()
          Returns a description of the exception.
 boolean isCritical()
          Returns whether or not this exception is critical.
 void log(Logger logger)
          Logs the exception details.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

ClientException

public ClientException(java.lang.Exception _innerException,
                       Logger logger)
Constructor.

Parameters:
_innerException - the actual exception that occurred.
logger - used to log the exception details.

ClientException

public ClientException(java.lang.Exception _innerException,
                       boolean _critical,
                       Logger logger)
Constructor.

Parameters:
_innerException - the actual exception that occurred.
_critical - flag that tells whether or not the exception occurred at a critical point in the transaction.
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       java.lang.String _httpError,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
_httpError - Additional HTTP error information; may be null.
logger - used to log the exception details.

ClientException

public ClientException(int _httpStatusCode,
                       java.lang.String _httpError,
                       boolean _critical,
                       Logger logger)
Constructor.

Parameters:
_httpStatusCode - HTTP status code
_httpError - Additional HTTP error information; may be null.
_critical - flag that tells whether or not the exception occurred at a critical point in the transaction.
logger - used to log the exception details.
Method Detail

getInnerException

public java.lang.Exception getInnerException()
Returns the actual exception that occurred, if any.

Returns:
the actual exception that occurred or null if this object was constructed using an HTTP status code.

isCritical

public boolean isCritical()
Returns whether or not this exception is critical. It will return true in the following cases:

Returns:
whether or not this exception is critical.

getHttpStatusCode

public int getHttpStatusCode()
Returns the HTTP status code, if any.

Returns:
the HTTP status code or -1 if this object was constructed using an actual exception that occurred.

getHttpError

public java.lang.String getHttpError()
Returns additional HTTP error information, if any.

Returns:
additional HTTP error information or null if this object was constructed using an actual exception that occurred.

log

public void log(Logger logger)
Logs the exception details.

Parameters:
logger - used to log the exception details.

getLogString

public java.lang.String getLogString()
Returns a string representation of the object for logging purposes.

Returns:
a string representation of the object for logging purposes.

getMessage

public java.lang.String getMessage()
Returns a description of the exception.

Returns:
a description of the exception.


Copyright © 2003-2006 CyberSource Corporation. All Rights Reserved.