uk.org.ogsadai.exception
Class DAIUncheckedException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--uk.org.ogsadai.exception.DAIUncheckedException
All Implemented Interfaces:
DAIExceptionInformation, java.io.Serializable
Direct Known Subclasses:
ClientToolkitException, CryptographyException, DAISerializationException, DAIUnregisteredSerializationException, DAIUnsupportedSerializationException, ExternalModuleException, FileLockException, MissingSystemPropertyException, NoExistingFileLockException, OutOfMemoryException, PipeAccessException, PropertyImmutableException, ServiceTypeException

public abstract class DAIUncheckedException
extends java.lang.RuntimeException
implements DAIExceptionInformation

Base class for OGSA-DAI unchecked exceptions.

Author:
The OGSA-DAI Project Team
See Also:
Serialized Form

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
           
private  ErrorID mErrorID
           
private  java.lang.Object[] mParameters
           
private  DAIUniqueID mUniqueID
           
 
Fields inherited from class java.lang.RuntimeException
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
protected DAIUncheckedException()
          No-argument constructor used by sub-classes that need to perform work before the error ID and parameters are known.
  DAIUncheckedException(ErrorID errorID)
          Constructs an exception corresponding to the given error ID.
  DAIUncheckedException(ErrorID errorID, java.lang.Object[] parameters)
          Constructs an exception corresponding the given error ID and parameters.
 
Method Summary
 ErrorID getErrorID()
          Gets the error ID.
 DAIUniqueID getExceptionID()
          Gets the unique ID associated with this exception.
 java.lang.String getLocalizedMessage()
          Gets a localized message describing the error.
 java.lang.String getMessage()
          Gets a message describing the error.
 java.lang.Object[] getParameters()
          Gets the parameters associated with the error.
 boolean hasChild()
          Gets whether there is a child exception.
protected  void setErrorID(ErrorID errorID)
          Sets the error ID.
protected  void setParameters(java.lang.Object[] parameters)
          Sets the error parameters.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, 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

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values

mErrorID

private ErrorID mErrorID

mParameters

private java.lang.Object[] mParameters

mUniqueID

private DAIUniqueID mUniqueID
Constructor Detail

DAIUncheckedException

protected DAIUncheckedException()
No-argument constructor used by sub-classes that need to perform work before the error ID and parameters are known. If this constuctor is used the caller must subsequently set the error ID and possibly the parameters.


DAIUncheckedException

public DAIUncheckedException(ErrorID errorID)
Constructs an exception corresponding to the given error ID. This error ID is associated with no parameters.

Parameters:
errorID - Error ID identifying the error type.

DAIUncheckedException

public DAIUncheckedException(ErrorID errorID,
                             java.lang.Object[] parameters)
Constructs an exception corresponding the given error ID and parameters.

Parameters:
errorID - Error ID identifying the error type.
parameters - Parameters associated with the error.
Method Detail

getErrorID

public ErrorID getErrorID()
Gets the error ID.

Specified by:
getErrorID in interface DAIExceptionInformation
Returns:
the error ID.

getParameters

public java.lang.Object[] getParameters()
Gets the parameters associated with the error.

Specified by:
getParameters in interface DAIExceptionInformation
Returns:
the parameters accociated with the error. If there are no parameters associated with the error then the array length will be 0.
See Also:
DAIExceptionInformation.getParameters()

getExceptionID

public DAIUniqueID getExceptionID()
Gets the unique ID associated with this exception.

Specified by:
getExceptionID in interface DAIExceptionInformation
Returns:
the unique ID associated with the exception.
See Also:
DAIExceptionInformation.getExceptionID()

hasChild

public boolean hasChild()
Gets whether there is a child exception.

Specified by:
hasChild in interface DAIExceptionInformation
Returns:
true if there is a child exception, false otherwise.
See Also:
DAIExceptionInformation.hasChild()

getMessage

public java.lang.String getMessage()
Gets a message describing the error.

Specified by:
getMessage in interface DAIExceptionInformation
Overrides:
getMessage in class java.lang.Throwable
Returns:
the string describing the error of the form [uniqueID] key : param1 , param2 , ....
See Also:
Throwable.getMessage()

getLocalizedMessage

public java.lang.String getLocalizedMessage()
Gets a localized message describing the error.

Specified by:
getLocalizedMessage in interface DAIExceptionInformation
Overrides:
getLocalizedMessage in class java.lang.Throwable
Returns:
the string describing the error.
See Also:
Throwable.getLocalizedMessage()

setErrorID

protected void setErrorID(ErrorID errorID)
Sets the error ID. Used by sub-classes that are unable to specify the error ID when the constructor was called.

Parameters:
errorID - Error ID identifying the error type.

setParameters

protected void setParameters(java.lang.Object[] parameters)
Sets the error parameters. Used by sub-classes that are unable to specify the parameters when the constructor was called.

Parameters:
parameters - Parameters associated with the error.