com.iplanet.am.sdk
Class AMException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.iplanet.am.sdk.AMException
All Implemented Interfaces:
com.sun.identity.common.L10NMessage, java.io.Serializable
Direct Known Subclasses:
AMEntryExistsException, AMEventManagerException, AMInvalidDNException, AMPostCallBackException, AMPreCallBackException

public class AMException
extends java.lang.Exception
implements com.sun.identity.common.L10NMessage

The AMException is thrown whenever an error is is encountered while performing an operation on the data store.

See Also:
Serialized Form

Constructor Summary
AMException(SSOToken token, java.lang.String errorCode)
          Convenience method (protected)
AMException(SSOToken token, java.lang.String errorCode, com.iplanet.ums.UMSException ue)
          Constructs a new AMException with detailed message.
AMException(java.lang.String msg, java.lang.String errorCode)
          Constructs a new AMException with detailed message.
AMException(java.lang.String msg, java.lang.String errorCode, java.lang.Object[] args)
          Constructs a new AMException with detailed message.
AMException(java.lang.String msg, java.lang.String errorCode, java.lang.Object[] args, com.iplanet.ums.UMSException ue)
          Constructs a new AMException with detailed message.
AMException(java.lang.String msg, java.lang.String errorCode, com.iplanet.ums.UMSException ue)
          Constructs a new AMException with detailed message.
 
Method Summary
 java.lang.String getErrorCode()
          Returns the error code.
 java.lang.String getL10NMessage(java.util.Locale locale)
          Returns localized error message.
 java.lang.String getLDAPErrorCode()
          Method to obtain the LDAP error code.
 netscape.ldap.LDAPException getLDAPException()
          Returns the root LDAPException of this AMException, if any.
 java.lang.String getMessage()
          Overrides the default getMessage() method of super class Exception.
 java.lang.Object[] getMessageArgs()
          Returns the arguments corresponding to the error code.
 java.lang.String getResourceBundleName()
          Returns ResourceBundle Name associated with this exception
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMException

public AMException(java.lang.String msg,
                   java.lang.String errorCode)
Constructs a new AMException with detailed message.
Parameters:
msg - The detailed message
erroCode - Matches the appropriate entry in amProfile.properties.

AMException

public AMException(SSOToken token,
                   java.lang.String errorCode)
Convenience method (protected)

AMException

public AMException(java.lang.String msg,
                   java.lang.String errorCode,
                   com.iplanet.ums.UMSException ue)
Constructs a new AMException with detailed message.
Parameters:
msg - The detailed message.
errorCode - Matches the appropriate entry in amProfile.properties.
ue - if the root cause is a UMSException.

AMException

public AMException(SSOToken token,
                   java.lang.String errorCode,
                   com.iplanet.ums.UMSException ue)
Constructs a new AMException with detailed message.
Parameters:
token - a valid single sign on token of the user performing the operation.
errorCode - Matches the appropriate entry in amProfile.properties.
ue - if the root cause is a UMSException.

AMException

public AMException(java.lang.String msg,
                   java.lang.String errorCode,
                   java.lang.Object[] args)
Constructs a new AMException with detailed message.
Parameters:
msg - The detailed message.
errorCode - Matches the appropriate entry in amProfile.properties.
args - arguments if the error message needs specific values to be set.

AMException

public AMException(java.lang.String msg,
                   java.lang.String errorCode,
                   java.lang.Object[] args,
                   com.iplanet.ums.UMSException ue)
Constructs a new AMException with detailed message.
Parameters:
msg - The detailed message
errorCode - Matches the appropriate entry in amProfile.properties.
args - if the error message needs specific values to be set.
ue - if the root cause is a UMSException.
Method Detail

getErrorCode

public java.lang.String getErrorCode()
Returns the error code. This error code can be used with the arguments to construct a localized message.
Specified by:
getErrorCode in interface com.sun.identity.common.L10NMessage
Returns:
the error code which can be used to map the message to a user specific locale.

getMessageArgs

public java.lang.Object[] getMessageArgs()
Returns the arguments corresponding to the error code.
Specified by:
getMessageArgs in interface com.sun.identity.common.L10NMessage
Returns:
the arguments corresponding to the error code or null if no arguments are need to construct the message.

getMessage

public java.lang.String getMessage()
Overrides the default getMessage() method of super class Exception.
Specified by:
getMessage in interface com.sun.identity.common.L10NMessage
Overrides:
getMessage in class java.lang.Throwable
Returns:
The error message string.

getLDAPErrorCode

public java.lang.String getLDAPErrorCode()
Method to obtain the LDAP error code.
Returns:
The error code, which can be used to map the message to a specific locale. Returns a null, if not an LDAP error.

getLDAPException

public netscape.ldap.LDAPException getLDAPException()
Returns the root LDAPException of this AMException, if any.
Returns:
The LDAPException that caused this AMException. If null, it means no root LDAPException has been set.

getL10NMessage

public java.lang.String getL10NMessage(java.util.Locale locale)
Returns localized error message.
Specified by:
getL10NMessage in interface com.sun.identity.common.L10NMessage
Parameters:
locale - locale of the error message.
Returns:
Localized error message.

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns ResourceBundle Name associated with this exception
Specified by:
getResourceBundleName in interface com.sun.identity.common.L10NMessage
Returns:
ResourceBundle Name associated with this exception.


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.