Package com.sun.identity.policy.remote
Class PolicyEvaluationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.sun.identity.policy.PolicyException
-
- com.sun.identity.policy.remote.PolicyEvaluationException
-
- All Implemented Interfaces:
L10NMessage,Serializable
public class PolicyEvaluationException extends PolicyException
The classPolicyEvaluationExceptionis the exception for the error happening in policy request XML parsing and policy request evaluation.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.sun.identity.policy.PolicyException
CONDITION_COLLECTION, ORGANIZATION, POLICY, REFERRAL_COLLECTION, REFERRAL_TYPE, RESPONSE_PROVIDER_COLLECTION, RULE, SERVICE, SUBJECT_TYPE, USER_COLLECTION
-
-
Constructor Summary
Constructors Constructor Description PolicyEvaluationException(String message)Constructs an instance of thePolicyEvaluationException.PolicyEvaluationException(String message, String reqId)Constructs an instance of thePolicyEvaluationExceptionclass.PolicyEvaluationException(String rbName, String errorCode, Object[] args, Throwable nestedException)Constructs an instance ofPolicyEvaluationExceptionto 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.PolicyEvaluationException(String rbName, String errorCode, Object[] args, Throwable nestedException, String reqId)Constructs an instance ofPolicyEvaluationExceptionto 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.PolicyEvaluationException(String message, Throwable nestedException)Constructs an instance of thePolicyEvaluationExceptionclass.PolicyEvaluationException(String message, Throwable nestedException, String reqId)Constructs an instance of thePolicyEvaluationExceptionclass.PolicyEvaluationException(Throwable nestedException)Constructs an instance of thePolicyEvaluationExceptionPolicyEvaluationException(Throwable nestedException, String reqId)Constructs an instance of thePolicyEvaluationExceptionclass.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCompleteL10NMessage(Locale locale)StringgetErrorCode()Use this method to chain this exception with another to get localized error messge use getL10NMessage methodStringgetL10NMessage(Locale locale)Use this method to get localized error message directly.StringgetMessage()Gets messages of the exceptions including the chained exceptionsObject[]getMessageArgs()Use this method to chain this exception with another to get localized error messge use getL10NMessage methodThrowablegetNestedException()StringgetRequestId()Returns the request Id.StringgetResourceBundleName()Use this method to chain this exception with another to get localized error messge use getL10NMessage methodvoidprintStackTrace()Prints the stack trace of the root exception to standard error stream.voidprintStackTrace(PrintStream ps)Prints the stack trace of the root exception to a PrintStream Also prints the messages of all the exceptions starting from top exception to the root exception, at the top of stack tracevoidprintStackTrace(PrintWriter pw)Prints the stack trace of the root exception to a PrintWriter Also prints the messages of all the exceptions starting from top exception to the root exception, at the top of stack trace-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
-
-
-
Constructor Detail
-
PolicyEvaluationException
public PolicyEvaluationException(String message)
Constructs an instance of thePolicyEvaluationException.- Parameters:
message- The message provided by the object that is throwing the exception.
-
PolicyEvaluationException
public PolicyEvaluationException(Throwable nestedException)
Constructs an instance of thePolicyEvaluationException- Parameters:
nestedException- the exception caught by the code block creating this.
-
PolicyEvaluationException
public PolicyEvaluationException(Throwable nestedException, String reqId)
Constructs an instance of thePolicyEvaluationExceptionclass.- Parameters:
nestedException- the exception caught by the code block creating thisreqId- The id of the policy request exception.
-
PolicyEvaluationException
public PolicyEvaluationException(String rbName, String errorCode, Object[] args, Throwable nestedException, String reqId)
Constructs an instance ofPolicyEvaluationExceptionto 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 nullnestedException- the exception caught by the code block creating thisreqId- The id of the policy request exception.
-
PolicyEvaluationException
public PolicyEvaluationException(String rbName, String errorCode, Object[] args, Throwable nestedException)
Constructs an instance ofPolicyEvaluationExceptionto 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 nullnestedException- the exception caught by the code block creating this
-
PolicyEvaluationException
public PolicyEvaluationException(String message, String reqId)
Constructs an instance of thePolicyEvaluationExceptionclass.- Parameters:
message- The message provided by the object that is throwing the exception.reqId- The id of the policy request exception.
-
PolicyEvaluationException
public PolicyEvaluationException(String message, Throwable nestedException)
Constructs an instance of thePolicyEvaluationExceptionclass.- Parameters:
message- message of this exceptionnestedException- the exception caught by the code block creating this exception.
-
PolicyEvaluationException
public PolicyEvaluationException(String message, Throwable nestedException, String reqId)
Constructs an instance of thePolicyEvaluationExceptionclass.- Parameters:
message- message of this exceptionnestedException- the exception caught by the code block creating this exceptionreqId- The id of the policy request
-
-
Method Detail
-
getRequestId
public String getRequestId()
Returns the request Id.- Returns:
- the request Id.
-
getL10NMessage
public String getL10NMessage(Locale locale)
Description copied from interface:L10NMessageUse this method to get localized error message directly.- Specified by:
getL10NMessagein interfaceL10NMessage- Parameters:
locale-Localeto be used.- Returns:
- String localized error message.
- See Also:
ChainedException(String, String, Object[], Throwable)
-
getCompleteL10NMessage
public String getCompleteL10NMessage(Locale locale)
- Parameters:
locale-Localeto be used.- Returns:
- String localized error message.
- See Also:
ChainedException(String, String, Object[], Throwable)
-
getResourceBundleName
public String getResourceBundleName()
Description copied from interface:L10NMessageUse this method to chain this exception with another to get localized error messge use getL10NMessage method- Specified by:
getResourceBundleNamein interfaceL10NMessage- Returns:
- ResourceBundle Name associated with this error message.
- See Also:
ChainedException(String, String, Object[], Throwable),- to get localized error message.
-
getErrorCode
public String getErrorCode()
Description copied from interface:L10NMessageUse this method to chain this exception with another to get localized error messge use getL10NMessage method- Specified by:
getErrorCodein interfaceL10NMessage- Returns:
- Error code associated with this error message.
- See Also:
ChainedException(String, String, Object[], Throwable),- to get localized error message.
-
getMessageArgs
public Object[] getMessageArgs()
Description copied from interface:L10NMessageUse this method to chain this exception with another to get localized error messge use getL10NMessage method- Specified by:
getMessageArgsin interfaceL10NMessage- Returns:
- arguments for formatting this error message.
You need to use
MessageFormatclass to format the message It can be null. - See Also:
ChainedException(String, String, Object[], Throwable),- to get localized error message.
-
getMessage
public String getMessage()
Gets messages of the exceptions including the chained exceptions- Specified by:
getMessagein interfaceL10NMessage- Overrides:
getMessagein classThrowable- Returns:
- messages of the exceptions including chained exceptions. The returned string is formed by concatenating messages of all the exceptions, with a new line separator, starting from this exception, all the way to the root exception, by following the chained exceptions.
-
printStackTrace
public void printStackTrace()
Prints the stack trace of the root exception to standard error stream. Also prints the messages of all the exceptions starting from top exception to the root exception, at the top of stack trace- Overrides:
printStackTracein classThrowable
-
printStackTrace
public void printStackTrace(PrintWriter pw)
Prints the stack trace of the root exception to a PrintWriter Also prints the messages of all the exceptions starting from top exception to the root exception, at the top of stack trace- Overrides:
printStackTracein classThrowable- Parameters:
pw- PrintWriter to which to print the stack trace
-
printStackTrace
public void printStackTrace(PrintStream ps)
Prints the stack trace of the root exception to a PrintStream Also prints the messages of all the exceptions starting from top exception to the root exception, at the top of stack trace- Overrides:
printStackTracein classThrowable- Parameters:
ps- PrintStream to which to print the stack trace
-
getNestedException
public Throwable getNestedException()
-
-