Package com.sun.identity.idm
Class IdRepoException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.sun.identity.idm.IdRepoException
- All Implemented Interfaces:
com.sun.identity.shared.locale.L10NMessage
,Serializable
- Direct Known Subclasses:
IdRepoDuplicateObjectException
,IdRepoFatalException
,IdRepoUnsupportedOpException
,PasswordPolicyException
@SupportedAll
public class IdRepoException
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:
-
Constructor Summary
ConstructorDescriptionIdRepoException
(String msg) IdRepoException
(String msg, String errorCode) IdRepoException
(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.IdRepoException
(String rbName, String errorCode, String ldapErrCode, Object[] args) Deprecated.Passing in an ldapErrorCode as a String is not recommended, use the OO ctor instead.IdRepoException
(String rbName, String errorCode, ResultCode ldapResultCode, 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. -
Method Summary
Modifier and TypeMethodDescriptionIf this error is an instance of a LDAP Constraint Violated Error (LDAP code 313) attempts to return useful information about the error that occured without leaking additional information about the system to the calling user.Returns error code associated with this error message.getL10NMessage
(Locale locale) Returns a localized error messageDeprecated.Use #getLdapErrorIntCode() instead.int
Returns an int representation ofldapErrCode
.Returns the error message of this exception.Object[]
Returns arguments for formatting this error message.ReturnsResourceBundle
Name associated with this error message.void
setLDAPErrorCode
(String errorCode) Replace the LDAP error code associated with this error message.toString()
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
IdRepoException
public IdRepoException() -
IdRepoException
- Parameters:
msg
- The message provided by the object which is throwing the exception
-
IdRepoException
-
IdRepoException
@Deprecated public IdRepoException(String rbName, String errorCode, String ldapErrCode, Object[] args) Deprecated.Passing in an ldapErrorCode as a String is not recommended, use the OO ctor instead.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 ,error code and LDAP error code ( in case of LDAP related exception 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)
.ldapErrCode
- ldap error codeargs
- arguments to message. If it is not present pass the as null.
-
IdRepoException
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 ,error code and LDAP Result Code ( in case of LDAP related exception 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)
.ldapResultCode
- ldap result codeargs
- arguments to message. If it is not present pass the as null.
-
IdRepoException
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
ReturnsResourceBundle
Name associated with this error message.- Returns:
ResourceBundle
name associated with this error message.- See Also:
-
getLdapErrorIntCode
public int getLdapErrorIntCode()Returns an int representation ofldapErrCode
. This is to be used with ResultCode.valueOf() which will return a valid ResultCode object regardless of the return of this method. A null or invalidldapErrorCode
will return-1
.- Returns:
- an int representation of this exception's LDAP error code.
-
getErrorCode
Returns error code associated with this error message.- Returns:
- Error code associated with this error message.
- See Also:
-
getLDAPErrorCode
Deprecated.Use #getLdapErrorIntCode() instead. The ldap error code is always an intReturns the LDAP error code associated with this error message.- Returns:
- Error code associated with this error message and null if
not caused by
LDAPException
. - See Also:
-
setLDAPErrorCode
Replace the LDAP error code associated with this error message. -
getMessageArgs
Returns arguments for formatting this error message.- Returns:
- arguments for formatting this error message. You need to use
MessageFormat
class to format the message It can be null. - See Also:
-
toString
-
getMessage
Returns the error message of this exception.- Overrides:
getMessage
in classThrowable
- Returns:
- String representing the error message
-
getConstraintViolationDetails
If this error is an instance of a LDAP Constraint Violated Error (LDAP code 313) attempts to return useful information about the error that occured without leaking additional information about the system to the calling user. If this error is not an instance of LDAP Constraint Violated Error, the message of the error is returned.- Returns:
- a user-facing representation of this exception.
-