com.netscape.certsrv.base
Class EBaseException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.netscape.certsrv.base.EBaseException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
EACLsException, EAuthException, EAuthzException, ECAException, ECMSGWException, EDBException, EExtensionsException, EJobsException, EKRAException, ELdapException, EListenersException, ELogException, ENotificationException, EPasswordCheckException, EPolicyException, EProfileException, EPropertyException, EPropertyNotDefined, EPropertyNotFound, ERegistryException, ESelfTestException, EUsrGrpException, PolicyMessage

public class EBaseException
extends java.lang.Exception

An exception with localizable error messages. It is the base class for all exceptions in certificate server.

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $
See Also:
MessageFormat, BaseResources, Serialized Form

Field Summary
 java.lang.Object[] mParams
          Parameters to the exception error message.
 
Constructor Summary
EBaseException(java.lang.String msgFormat)
          Constructs an instance of this exception with the given resource key.
EBaseException(java.lang.String msgFormat, java.lang.Exception param)
          Constructs an instance of the exception given the resource key and a exception parameter.
EBaseException(java.lang.String msgFormat, java.lang.Object[] params)
          Constructs an instance of this exception given the resource key and an array of parameters.
EBaseException(java.lang.String msgFormat, java.lang.String param)
          Constructs an instance of this exception with the given resource key and a parameter as a string.
 
Method Summary
protected  java.lang.String getBundleName()
          Returns the given resource bundle name.
 java.lang.Object[] getParameters()
          Returns the list of parameters.
 java.lang.String toString()
          Returns the exception string in the default locale.
 java.lang.String toString(java.util.Locale locale)
          Returns the exception string in the given locale.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mParams

public java.lang.Object[] mParams
Parameters to the exception error message.

Constructor Detail

EBaseException

public EBaseException(java.lang.String msgFormat)
Constructs an instance of this exception with the given resource key. If resource key is not found in the resource bundle, the resource key specified is used as the error message.
      new EBaseException(BaseResources.PERMISSION_DENIED);
      new EBaseException("An plain error message");
 

Parameters:
msgFormat - The error message resource key.

EBaseException

public EBaseException(java.lang.String msgFormat,
                      java.lang.String param)
Constructs an instance of this exception with the given resource key and a parameter as a string.
      new EBaseException(BaseResource.NO_CONFIG_FILE, fileName);
 

Parameters:
msgFormat - exception details in message string format
param - message string parameter

EBaseException

public EBaseException(java.lang.String msgFormat,
                      java.lang.Exception param)
Constructs an instance of the exception given the resource key and a exception parameter.
                try {
                ...
                } catch (IOExeption e) {
                        throw new EBaseException(BaseResources.INTERNAL_ERROR_1, e);
      }
 

Parameters:
msgFormat - The resource key
param - The parameter as an exception

EBaseException

public EBaseException(java.lang.String msgFormat,
                      java.lang.Object[] params)
Constructs an instance of this exception given the resource key and an array of parameters.

Parameters:
msgFormat - The resource key
params - Array of params
Method Detail

getParameters

public java.lang.Object[] getParameters()
Returns the list of parameters.

Returns:
List of parameters.

toString

public java.lang.String toString()
Returns the exception string in the default locale.

Overrides:
toString in class java.lang.Throwable
Returns:
The exception string in the default locale.

toString

public java.lang.String toString(java.util.Locale locale)
Returns the exception string in the given locale.

Parameters:
locale - The locale
Returns:
The exception string in the given locale.

getBundleName

protected java.lang.String getBundleName()
Returns the given resource bundle name.

Returns:
the name of the resource bundle for this class.