com.lmax.api
Class FailureResponse

java.lang.Object
  extended by com.lmax.api.FailureResponse

public class FailureResponse
extends java.lang.Object

Generic failure response for outbound requests.


Constructor Summary
FailureResponse(boolean isSystemFailure, java.lang.String message)
          Constructs a failure response.
FailureResponse(java.lang.Exception e)
          Constructs a failure response as a result of an exception being caught.
FailureResponse(java.lang.String message, java.lang.String description)
          Constructs a failure response.
 
Method Summary
 java.lang.String getDescription()
          More detailed description of the failure response, may not be set depending on the nature of the failure.
 java.lang.Exception getException()
          Returns an exception that may have occurred.
 java.lang.String getMessage()
          Get the failure message.
 boolean isSystemFailure()
          Indicates that the failure was system related.
 java.lang.String toString()
          Get the FailureResponse as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FailureResponse

public FailureResponse(java.lang.String message,
                       java.lang.String description)
Constructs a failure response.

Parameters:
message - The failure message
description - Readable description of the error

FailureResponse

public FailureResponse(boolean isSystemFailure,
                       java.lang.String message)
Constructs a failure response.

Parameters:
isSystemFailure - Indicates a system failure
message - The failure message

FailureResponse

public FailureResponse(java.lang.Exception e)
Constructs a failure response as a result of an exception being caught. Will always be a system exception

Parameters:
e - The captured exception
Method Detail

getMessage

public java.lang.String getMessage()
Get the failure message.

Returns:
The failure message

getDescription

public java.lang.String getDescription()
More detailed description of the failure response, may not be set depending on the nature of the failure.

Returns:
Description of the failure, or "" if not set.

isSystemFailure

public boolean isSystemFailure()
Indicates that the failure was system related. This could indicate a connection error for example.

Returns:
If the failure indicates a system failure.

getException

public java.lang.Exception getException()
Returns an exception that may have occurred.

Returns:
A captured exception, may be null.

toString

public java.lang.String toString()
Get the FailureResponse as a string.

Overrides:
toString in class java.lang.Object
Returns:
The FailureResponse as a string
See Also:
Object.toString()