com.sun.identity.sm
Class SMSException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sun.identity.sm.SMSException
All Implemented Interfaces:
com.sun.identity.common.L10NMessage, java.io.Serializable
Direct Known Subclasses:
InvalidAttributeNameException, SchemaException, ServiceAlreadyExistsException, ServiceNotFoundException

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

The exception class whose instance is thrown if there is any error during the operation of objects of the com.sun.identity.sms package. This class maps the exception that occurred at a lower level to a high level error. Using the exception status code getExceptionCode() the errors are categorized as a ABORT, RETRY, CONFIG_PROBLEM or LDAP_OP_FAILED (typically a bug).

See Also:
Serialized Form

Field Summary
static int STATUS_ABORT
          Status to abort operation
static int STATUS_CONFIG_PROBLEM
          If the root LDAP exception is INVALID_CREDENTIALS or REFERRAL then this status is set
static int STATUS_LDAP_OP_FAILED
          If root LDAP cause is an LDAP exception with one of the following error codes then this status is set.
static int STATUS_NO_PERMISSION
          If the root LDAP cause is INSUFFICIENT_ACCESS_RIGHTS
static int STATUS_NONE
          No status code is set
static int STATUS_QUO_ANTE
          If root LDAP cause is LDAP_PARTIAL_RESULTS then this status is set
static int STATUS_REPEATEDLY_FAILED
          Repeated retry to data store failed
static int STATUS_RETRY
          Retry connection to data store
static int STATUS_UNKNOWN_EXCEPTION
          If the root cause is other than any of those listed in other status codes
 
Constructor Summary
SMSException()
          Default constructor for SMSException
SMSException(int status, java.lang.String errorCode)
           
SMSException(int status, java.lang.String exMessage, java.lang.String errorCode)
           
SMSException(java.lang.String msg)
           
SMSException(java.lang.String msg, java.lang.String errorCode)
           
SMSException(java.lang.String rbName, java.lang.String errorCode, java.lang.Object[] args)
          This constructor is used to pass the localized error message At this level, the locale of the caller is not known and it is not possible to throw localized error message at this level.
SMSException(java.lang.String rbName, java.lang.String message, java.lang.Throwable t, java.lang.String errorCode)
          Constructs an SMSException.
SMSException(java.lang.String message, java.lang.Throwable t, java.lang.String errorCode)
          Constructs an SMSException.
SMSException(java.lang.Throwable t, java.lang.String errorCode)
          Constructs an SMSException.
 
Method Summary
 java.lang.String getErrorCode()
          Returns error code associated with this error message.
 int getExceptionCode()
          Returns the status code for this exception.
 java.lang.String getL10NMessage(java.util.Locale locale)
          Returns a localized error message
 java.lang.String getMessage()
          Returns the error message of this exception.
 java.lang.Object[] getMessageArgs()
          Returns arguments for formatting this error message.
 java.lang.String getResourceBundleName()
          Returns ResourceBundle Name associated with this error message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_NONE

public static int STATUS_NONE
No status code is set

STATUS_RETRY

public static int STATUS_RETRY
Retry connection to data store

STATUS_REPEATEDLY_FAILED

public static int STATUS_REPEATEDLY_FAILED
Repeated retry to data store failed

STATUS_ABORT

public static int STATUS_ABORT
Status to abort operation

STATUS_QUO_ANTE

public static int STATUS_QUO_ANTE
If root LDAP cause is LDAP_PARTIAL_RESULTS then this status is set

STATUS_LDAP_OP_FAILED

public static int STATUS_LDAP_OP_FAILED
If root LDAP cause is an LDAP exception with one of the following error codes then this status is set.

  NO_SUCH_OBJECT
  OBJECT_CLASS_VIOLATION
  NAMING_VIOLATION
  CONSTRAINT_VIOLATION
  INVALID_DN_SYNTAX
  ENTRY_ALREADY_EXISTS
  ATTRIBUTE_OR_VALUE_EXISTS
  PROTOCOL_ERROR
  UNDEFINED_ATTRIBUTE_TYPE
 

STATUS_CONFIG_PROBLEM

public static int STATUS_CONFIG_PROBLEM
If the root LDAP exception is INVALID_CREDENTIALS or REFERRAL then this status is set

STATUS_UNKNOWN_EXCEPTION

public static int STATUS_UNKNOWN_EXCEPTION
If the root cause is other than any of those listed in other status codes

STATUS_NO_PERMISSION

public static int STATUS_NO_PERMISSION
If the root LDAP cause is INSUFFICIENT_ACCESS_RIGHTS
Constructor Detail

SMSException

public SMSException()
Default constructor for SMSException

SMSException

public SMSException(int status,
                    java.lang.String errorCode)
Parameters:
status - The exception status code.
errorCode - Key to resource bundle.

SMSException

public SMSException(int status,
                    java.lang.String exMessage,
                    java.lang.String errorCode)
Parameters:
status - The Exception status code.
exMessage - The message provided by the object which is throwing the exception
errorCode - Key to resource bundle.

SMSException

public SMSException(java.lang.String msg)
Parameters:
msg - The message provided by the object which is throwing the exception

SMSException

public SMSException(java.lang.String msg,
                    java.lang.String errorCode)
Parameters:
msg - The message provided by the object which is throwing the exception
errorCode - Key to resource bundle.

SMSException

public SMSException(java.lang.Throwable t,
                    java.lang.String errorCode)
Constructs an SMSException.
Parameters:
t - The Throwable object provided by the object which is throwing the exception
errorCode - Key to resource bundle.

SMSException

public SMSException(java.lang.String message,
                    java.lang.Throwable t,
                    java.lang.String errorCode)
Constructs an SMSException.
Parameters:
message - exception message.
t - The Throwable object provided by the object which is throwing the exception.
errorCode - Key to resource bundle.

SMSException

public SMSException(java.lang.String rbName,
                    java.lang.String message,
                    java.lang.Throwable t,
                    java.lang.String errorCode)
Constructs an SMSException.
Parameters:
rbName - Resource bundle Name to be used for getting localized error message.
message - exception message.
t - The Throwable object provided by the object which is throwing the exception.
errorCode - Key to resource bundle.

SMSException

public SMSException(java.lang.String rbName,
                    java.lang.String errorCode,
                    java.lang.Object[] args)
This constructor is used to pass the localized error message At this level, the locale of the caller is not known and it is not possible to throw localized error message at this level. Instead this constructor provides Resource Bundle name and error code for correctly locating the error message. The default getMessage() will always return English messages only. This is in consistent with current JRE.
Parameters:
rbName - Resource bundle Name to be used for getting localized error message.
errorCode - Key to resource bundle. You can use ResourceBundle rb = ResourceBunde.getBundle(rbName,locale); String localizedStr = rb.getString(errorCode).
args - arguments to message. If it is not present pass the as null.
Method Detail

getL10NMessage

public java.lang.String getL10NMessage(java.util.Locale locale)
Returns a localized error message
Specified by:
getL10NMessage in interface com.sun.identity.common.L10NMessage
Parameters:
locale - Uses the locale object to create the appropriate localized error message
Returns:
localized error message.
See Also:
SMSException(String, String, Object[])

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns ResourceBundle Name associated with this error message.
Specified by:
getResourceBundleName in interface com.sun.identity.common.L10NMessage
Returns:
ResourceBundle name associated with this error message.
See Also:
SMSException(String, String, Object[])

getErrorCode

public java.lang.String getErrorCode()
Returns error code associated with this error message.
Specified by:
getErrorCode in interface com.sun.identity.common.L10NMessage
Returns:
Error code associated with this error message.
See Also:
SMSException(String, String, Object[])

getMessageArgs

public java.lang.Object[] getMessageArgs()
Returns arguments for formatting this error message.
Specified by:
getMessageArgs in interface com.sun.identity.common.L10NMessage
Returns:
arguments for formatting this error message. You need to use MessageFormat class to format the message It can be null.
See Also:
SMSException(String, String, Object[])

getExceptionCode

public int getExceptionCode()
Returns the status code for this exception.
Returns:
Integer representing the exception status code

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Throwable

getMessage

public java.lang.String getMessage()
Returns the error message of this exception.
Specified by:
getMessage in interface com.sun.identity.common.L10NMessage
Overrides:
getMessage in class java.lang.Throwable
Returns:
String representing the error message


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