public class SMSException extends Exception implements L10NMessage
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).Modifier and Type | Field and Description |
---|---|
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_NOT_ALLOW
the operation is not allowed.
|
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 root cause is other than any of those listed in other status codes
|
Constructor and Description |
---|
SMSException()
Default constructor for
SMSException |
SMSException(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 an
SMSException . |
SMSException(String message,
Throwable t,
String errorCode)
Constructs an
SMSException . |
SMSException(Throwable t,
String errorCode)
Constructs an
SMSException . |
Modifier and Type | Method and Description |
---|---|
String |
getErrorCode()
Returns error code associated with this error message.
|
int |
getExceptionCode()
Returns the status code for this exception.
|
String |
getL10NMessage(Locale locale)
Returns a localized error message
|
String |
getMessage()
Returns the error message of this exception.
|
Object[] |
getMessageArgs()
Returns arguments for formatting this error message.
|
String |
getResourceBundleName()
Returns
ResourceBundle Name associated with this error
message. |
String |
toString() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
public static final int STATUS_NONE
public static final int STATUS_RETRY
public static final int STATUS_REPEATEDLY_FAILED
public static final int STATUS_ABORT
public static final int STATUS_QUO_ANTE
LDAP_PARTIAL_RESULTS
then this
status is setpublic static final int STATUS_LDAP_OP_FAILED
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
public static final int STATUS_CONFIG_PROBLEM
INVALID_CREDENTIALS
or
REFERRAL
then this status is setpublic static final int STATUS_UNKNOWN_EXCEPTION
public static final int STATUS_NO_PERMISSION
INSUFFICIENT_ACCESS_RIGHTS
public static final int STATUS_NOT_ALLOW
public SMSException()
SMSException
public SMSException(int status, String errorCode)
status
- The exception status code.errorCode
- Key to resource bundle.public SMSException(int status, String exMessage, String errorCode)
status
- The Exception status code.exMessage
- The message provided by the object which is throwing the
exceptionerrorCode
- Key to resource bundle.public SMSException(String msg)
msg
- The message provided by the object which is throwing the
exceptionpublic SMSException(String msg, String errorCode)
msg
- The message provided by the object which is throwing the
exceptionerrorCode
- Key to resource bundle.public SMSException(Throwable t, String errorCode)
SMSException
.t
- The Throwable
object provided by the object
which is throwing the exceptionerrorCode
- Key to resource bundle.public SMSException(String message, Throwable t, String errorCode)
SMSException
.message
- exception message.t
- The Throwable
object provided by the object
which is throwing the exception.errorCode
- Key to resource bundle.public SMSException(String rbName, String message, Throwable t, String errorCode)
SMSException
.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.public SMSException(String rbName, String errorCode, Object[] args)
getMessage()
will always return
English messages only. This is in consistent with current JRE.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.public String getL10NMessage(Locale locale)
getL10NMessage
in interface L10NMessage
locale
- Uses the locale object to create the appropriate localized
error messageSMSException(String, String, Object[])
public String getResourceBundleName()
ResourceBundle
Name associated with this error
message.getResourceBundleName
in interface L10NMessage
ResourceBundle
name associated with this error
message.SMSException(String, String, Object[])
public String getErrorCode()
getErrorCode
in interface L10NMessage
SMSException(String, String, Object[])
public Object[] getMessageArgs()
getMessageArgs
in interface L10NMessage
MessageFormat
class to format the message It can
be null.SMSException(String, String, Object[])
public int getExceptionCode()
public String getMessage()
getMessage
in interface L10NMessage
getMessage
in class Throwable
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.