com.cybersource.ws.client
Class FaultException

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

public class FaultException
extends java.lang.Exception

Exception that encapsulates a fault returned by CyberSource. Used by both the Basic and XML clients.

See Also:
Serialized Form

Constructor Summary
FaultException(org.w3c.dom.Document _faultDocument, java.lang.String nsURI, Logger logger)
          Constructor.
 
Method Summary
 java.lang.String getFaultCode()
          Returns the fault code.
 org.w3c.dom.Document getFaultDocument()
          Returns the fault document passed in the constructor.
 java.lang.String getFaultString()
          Returns the fault string.
 java.lang.String getLogString()
          Returns a string representation of the object for logging purposes.
 java.lang.String getMessage()
          Returns a description of the exception.
 java.lang.String getRequestID()
          Returns the request id returned by CyberSource.
 boolean isCritical()
          Returns whether or not this exception is critical.
 void log(Logger logger)
          Logs the fault 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

FaultException

public FaultException(org.w3c.dom.Document _faultDocument,
                      java.lang.String nsURI,
                      Logger logger)
Constructor.

Parameters:
_faultDocument - Document object representing the fault.
logger - used to log the fault details.
Method Detail

getFaultDocument

public org.w3c.dom.Document getFaultDocument()
Returns the fault document passed in the constructor.

Returns:
the fault document passed in the constructor.

getFaultCode

public java.lang.String getFaultCode()
Returns the fault code.

Returns:
the fault code.

getFaultString

public java.lang.String getFaultString()
Returns the fault string.

Returns:
the fault string.

getRequestID

public java.lang.String getRequestID()
Returns the request id returned by CyberSource.

Returns:
the request id returned by Cybersource or null if none was returned, which would mean that the fault occurred before CyberSource was able to create one.

isCritical

public boolean isCritical()
Returns whether or not this exception is critical. It will return true if the local part of the fault code is "CriticalServerError".

Returns:
whether or not this exception is critical.

log

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

Parameters:
logger - used to log the fault 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.