Package 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.shared.locale.L10NMessage,Serializable
- Direct Known Subclasses:
InvalidAttributeNameException,InvalidAttributeValueException,OrganizationAlreadyExistsException,SchemaException,ServiceAlreadyExistsException,ServiceConfigException,ServiceErrorException,ServiceNotFoundException
@SupportedAll
public class SMSException
extends Exception
implements com.sun.identity.shared.locale.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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final intStatus to abort operationstatic final intIf the root LDAP exception isINVALID_CREDENTIALSorREFERRALthen this status is setstatic final intIf root LDAP cause is an LDAP exception with one of the following error codes then this status is set.static final intIf the root LDAP cause isINSUFFICIENT_ACCESS_RIGHTSstatic final intNo status code is setstatic final intthe operation is not allowed.static final intIf root LDAP cause isLDAP_PARTIAL_RESULTSthen this status is setstatic final intRepeated retry to data store failedstatic final intRetry connection to data storestatic final intIf root cause is other than any of those listed in other status codes -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor forSMSExceptionSMSException(int status, String errorCode) SMSException(int status, String exMessage, String errorCode) SMSException(String msg) SMSException(String msg, String errorCode) SMSException(String rbName, String errorCode, 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(String rbName, String message, Throwable t, String errorCode) Constructs anSMSException.SMSException(String message, Throwable t, String errorCode) Constructs anSMSException.SMSException(Throwable t, String errorCode) Constructs anSMSException. -
Method Summary
Modifier and TypeMethodDescriptionReturns error code associated with this error message.intReturns the status code for this exception.getL10NMessage(Locale locale) Returns a localized error messageReturns the error message of this exception.Object[]Returns arguments for formatting this error message.ReturnsResourceBundleName associated with this error message.toString()Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Field Details
-
SMS_LDAP_REFERRAL_EXCEPTION
- See Also:
-
SMS_TIME_LIMIT_EXCEEDED
- See Also:
-
SMS_ADMIN_LIMIT_EXCEEDED
- See Also:
-
SMS_INSUFFICIENT_ACCESS_RIGHTS
- See Also:
-
SMS_NO_SUCH_OBJECT
- See Also:
-
SMS_LDAP_SERVER_BUSY
- See Also:
-
SMS_LDAP_NOT_SUPPORTED
- See Also:
-
SMS_SERVER_DOWN
- See Also:
-
SMS_LDAP_OPERATION_FAILED
- See Also:
-
SMS_UNEXPECTED_LDAP_EXCEPTION
- See Also:
-
SMS_UNKNOWN_EXCEPTION_OCCURRED
- See Also:
-
SMS_AUTHENTICATION_ERROR
- See Also:
-
SMS_XML_PARSER_EXCEPTION
- See Also:
-
STATUS_NONE
public static final int STATUS_NONENo status code is set- See Also:
-
STATUS_RETRY
public static final int STATUS_RETRYRetry connection to data store- See Also:
-
STATUS_REPEATEDLY_FAILED
public static final int STATUS_REPEATEDLY_FAILEDRepeated retry to data store failed- See Also:
-
STATUS_ABORT
public static final int STATUS_ABORTStatus to abort operation- See Also:
-
STATUS_QUO_ANTE
public static final int STATUS_QUO_ANTEIf root LDAP cause isLDAP_PARTIAL_RESULTSthen this status is set- See Also:
-
STATUS_LDAP_OP_FAILED
public static final int STATUS_LDAP_OP_FAILEDIf 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
- See Also:
-
STATUS_CONFIG_PROBLEM
public static final int STATUS_CONFIG_PROBLEMIf the root LDAP exception isINVALID_CREDENTIALSorREFERRALthen this status is set- See Also:
-
STATUS_UNKNOWN_EXCEPTION
public static final int STATUS_UNKNOWN_EXCEPTIONIf root cause is other than any of those listed in other status codes- See Also:
-
STATUS_NO_PERMISSION
public static final int STATUS_NO_PERMISSIONIf the root LDAP cause isINSUFFICIENT_ACCESS_RIGHTS- See Also:
-
STATUS_NOT_ALLOW
public static final int STATUS_NOT_ALLOWthe operation is not allowed.- See Also:
-
-
Constructor Details
-
SMSException
public SMSException()Default constructor forSMSException -
SMSException
- Parameters:
status- The exception status code.errorCode- Key to resource bundle.
-
SMSException
- Parameters:
status- The Exception status code.exMessage- The message provided by the object which is throwing the exceptionerrorCode- Key to resource bundle.
-
SMSException
- Parameters:
msg- The message provided by the object which is throwing the exception
-
SMSException
- Parameters:
msg- The message provided by the object which is throwing the exceptionerrorCode- Key to resource bundle.
-
SMSException
Constructs anSMSException.- Parameters:
t- TheThrowableobject provided by the object which is throwing the exceptionerrorCode- Key to resource bundle.
-
SMSException
Constructs anSMSException.- Parameters:
message- exception message.t- TheThrowableobject provided by the object which is throwing the exception.errorCode- Key to resource bundle.
-
SMSException
Constructs anSMSException.- Parameters:
rbName- Resource bundle Name to be used for getting localized error message.message- exception message.t- TheThrowableobject provided by the object which is throwing the exception.errorCode- Key to resource bundle.
-
SMSException
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 defaultgetMessage()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 useResourceBundle rb = ResourceBunde.getBundle(rbName,locale); String localizedStr = rb.getString(errorCode).args- arguments to message. If it is not present pass the as null.
-
-
Method Details
-
getL10NMessage
Returns a localized error message- Parameters:
locale- Uses the locale object to create the appropriate localized error message- Returns:
- localized error message.
- See Also:
-
getResourceBundleName
ReturnsResourceBundleName associated with this error message.- Returns:
ResourceBundlename associated with this error message.- See Also:
-
getErrorCode
Returns error code associated with this error message.- Returns:
- Error code associated with this error message.
- See Also:
-
getMessageArgs
Returns arguments for formatting this error message.- Returns:
- arguments for formatting this error message. You need to use
MessageFormatclass to format the message It can be null. - See Also:
-
getExceptionCode
public int getExceptionCode()Returns the status code for this exception.- Returns:
- Integer representing the exception status code
-
toString
-
getMessage
Returns the error message of this exception.- Overrides:
getMessagein classThrowable- Returns:
- String representing the error message
-