ccc.api.exceptions
Class CCException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by ccc.api.exceptions.CCException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ConflictException, EntityNotFoundException, InsufficientPrivilegesException, InvalidException, UnauthorizedException

public class CCException
extends java.lang.RuntimeException

An exception representing the failure of a CCC command.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Field Summary
static java.lang.String MESSAGE
          MESSAGE : String.
 
Constructor Summary
  CCException()
          Constructor.
  CCException(java.lang.String message)
          Constructor.
  CCException(java.lang.String message, java.lang.Throwable cause)
          Constructor.
protected CCException(java.lang.String message, java.lang.Throwable cause, java.util.Map<java.lang.String,java.lang.String> params)
          Constructor.
 
Method Summary
protected  void addParam(java.lang.String key, java.lang.String value)
          Add a parameter to the exception.
 Failure getFailure()
          Accessor.
 java.lang.String getMessage()
          
protected  java.lang.String getParam(java.lang.String key)
          Accessor.
 void setId(java.util.UUID id)
          Mutator.
 void setParams(java.util.Map<java.lang.String,java.lang.String> params)
          Mutator.
 
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
 

Field Detail

MESSAGE

public static final java.lang.String MESSAGE
MESSAGE : String.

See Also:
Constant Field Values
Constructor Detail

CCException

public CCException()
Constructor.


CCException

protected CCException(java.lang.String message,
                      java.lang.Throwable cause,
                      java.util.Map<java.lang.String,java.lang.String> params)
Constructor.

Parameters:
message - Description of the exception.
cause - Cause of the exception.
params - Further details describing the exception.

CCException

public CCException(java.lang.String message)
Constructor.

Parameters:
message - Description of the exception.

CCException

public CCException(java.lang.String message,
                   java.lang.Throwable cause)
Constructor.

Parameters:
message - Description of the exception.
cause - Cause of the exception.
Method Detail

getFailure

public Failure getFailure()
Accessor.

Returns:
The failure.

getParam

protected java.lang.String getParam(java.lang.String key)
Accessor.

Parameters:
key - The parameter's key.
Returns:
The parameter's value.

setId

public void setId(java.util.UUID id)
Mutator.

Parameters:
id - The id to set.

setParams

public void setParams(java.util.Map<java.lang.String,java.lang.String> params)
Mutator.

Parameters:
params - The parameters to set.

getMessage

public java.lang.String getMessage()

Overrides:
getMessage in class java.lang.Throwable

addParam

protected void addParam(java.lang.String key,
                        java.lang.String value)
Add a parameter to the exception.

Parameters:
key - The paramater's key.
value - The parameter's value.


Copyright © 2010. All Rights Reserved.