com.metamatrix.admin.api.exception
Class AdminException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.metamatrix.core.MetaMatrixCoreException
              extended by com.metamatrix.admin.api.exception.AdminException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AdminComponentException, AdminProcessingException

public abstract class AdminException
extends MetaMatrixCoreException

AdminException is the base exception for the admin package. Many *Admin methods throw this exception. Instances will be one of the concrete subtypes: AdminComponentException or AdminProcessingException

AdminExceptions may contain multiple child exceptions. An example of this could be when performing an admin action results in multiple failures. Admin clients should be aware of this and use the hasMultiple() method to determine if they need to check the child exceptions.

See Also:
Serialized Form

Field Summary
static int NO_ERROR_CODE
          The error code is initialized to this value.
 
Method Summary
 void addChild(AdminException child)
          Add a child AdminException for a particular failure if and action resulted in multiple failures.
 java.util.List getChildren()
          Returns a non-null list of failures (AdminExceptions), one for each component that failed.
 int getCode()
          Get the optional error code.
 java.lang.String getMessage()
           
 boolean hasErrorCode()
          Check whether an error code has been set on this exception.
 boolean hasMultiple()
          Determine whether this exception is representing mutliple component failures.
 
Methods inherited from class com.metamatrix.core.MetaMatrixCoreException
getCause, initCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_ERROR_CODE

public static final int NO_ERROR_CODE
The error code is initialized to this value.

An error code of NO_ERROR_CODE indicates no error code has been set.

See Also:
Constant Field Values
Method Detail

getCode

public int getCode()
Get the optional error code. Useful for comparing to a known value.

Returns:
the error code.
Since:
4.3

hasErrorCode

public boolean hasErrorCode()
Check whether an error code has been set on this exception.

Returns:
true iff the error code differs from NO_ERROR_CODE.
Since:
4.3

hasMultiple

public boolean hasMultiple()
Determine whether this exception is representing mutliple component failures.

Returns:
true iff this exception contains multiple component failure exceptions.
Since:
4.3

getChildren

public java.util.List getChildren()
Returns a non-null list of failures (AdminExceptions), one for each component that failed.

The list will have members when hasMultiple() returns true.

Returns:
The non-null list of failures.
Since:
4.3

addChild

public void addChild(AdminException child)
Add a child AdminException for a particular failure if and action resulted in multiple failures.

Parameters:
child - a specific failure
Since:
4.3

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable
Since:
4.3
See Also:
Throwable.getMessage()


Copyright © 2009. All Rights Reserved.