org.ogf.graap.wsag.api.exceptions
Class WSAgreementException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.ogf.graap.wsag.api.exceptions.WSAgreementException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AgreementFactoryException, NegotiationException, NegotiationFactoryException, ResourceUnavailableException, ResourceUnknownException

public abstract class WSAgreementException
extends Exception

Base class for WSAG4J exceptions.

Author:
Oliver Waeldrich
See Also:
Serialized Form

Field Summary
static int AGREEMENT_CONSTRAINT_VALIDATION_ERROR
          Error code for the CreationConstraintsViolationException
static int AGREEMENT_CREATION_ERROR
          Error code for the AgreementCreationException
static int AGREEMENT_FACTORY_ERROR
          Error code for the AgreementFactoryException
static int NEGOTIATION_ERROR
          Error code for the NegotiationException
static int NEGOTIATION_INSTANTIATION_ERROR
          Error code for the NegotiationFactoryException
static int NEGOTIATION_VALIDATION_ERROR
          Error code for the ValidationException
static int RESOURCE_UNAVAILABLE_ERROR
          Error code for the ResourceUnavailableException
static int RESOURCE_UNKNOWN_ERROR
          Error code for the ResourceUnknownException
 
Constructor Summary
WSAgreementException()
          default constructor
WSAgreementException(String message)
          Constructs the exception with the given message.
WSAgreementException(String message, Throwable cause)
          Constructs the exception with the given message and initializes the exception cause.
WSAgreementException(Throwable cause)
          Constructs the exception and initializes the exception cause.
 
Method Summary
 int getErrorClass()
          Maps an application error to an error class.
abstract  int getErrorCode()
          Returns a unique error code for the specific Exception;
 
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
 

Field Detail

AGREEMENT_FACTORY_ERROR

public static final int AGREEMENT_FACTORY_ERROR
Error code for the AgreementFactoryException

See Also:
Constant Field Values

AGREEMENT_CONSTRAINT_VALIDATION_ERROR

public static final int AGREEMENT_CONSTRAINT_VALIDATION_ERROR
Error code for the CreationConstraintsViolationException

See Also:
Constant Field Values

AGREEMENT_CREATION_ERROR

public static final int AGREEMENT_CREATION_ERROR
Error code for the AgreementCreationException

See Also:
Constant Field Values

NEGOTIATION_INSTANTIATION_ERROR

public static final int NEGOTIATION_INSTANTIATION_ERROR
Error code for the NegotiationFactoryException

See Also:
Constant Field Values

NEGOTIATION_ERROR

public static final int NEGOTIATION_ERROR
Error code for the NegotiationException

See Also:
Constant Field Values

NEGOTIATION_VALIDATION_ERROR

public static final int NEGOTIATION_VALIDATION_ERROR
Error code for the ValidationException

See Also:
Constant Field Values

RESOURCE_UNKNOWN_ERROR

public static final int RESOURCE_UNKNOWN_ERROR
Error code for the ResourceUnknownException

See Also:
Constant Field Values

RESOURCE_UNAVAILABLE_ERROR

public static final int RESOURCE_UNAVAILABLE_ERROR
Error code for the ResourceUnavailableException

See Also:
Constant Field Values
Constructor Detail

WSAgreementException

public WSAgreementException()
default constructor


WSAgreementException

public WSAgreementException(String message)
Constructs the exception with the given message.

Parameters:
message - the exception message

WSAgreementException

public WSAgreementException(String message,
                            Throwable cause)
Constructs the exception with the given message and initializes the exception cause.

Parameters:
message - the exception message
cause - the exception cause

WSAgreementException

public WSAgreementException(Throwable cause)
Constructs the exception and initializes the exception cause.

Parameters:
cause - the exception cause
Method Detail

getErrorCode

public abstract int getErrorCode()
Returns a unique error code for the specific Exception;

Returns:
the exception specific error code

getErrorClass

public int getErrorClass()
Maps an application error to an error class. This error class reflects a HTTP error code. By default this method returns 500 as error class indicating an application error. Exceptions may overwrite this method in order to provide a more appropriate error code.

Returns:
the code of the error class


Copyright © 2008-2012. All Rights Reserved.