public class PolicyException extends Exception
PolicyException
is the basic exception for the
the policy component. All other exceptions in this package are derived
from this exception.Modifier and Type | Field and Description |
---|---|
static int |
CONDITION_COLLECTION
The constant variable specifies the exception is
with respect to constraint collection.
|
static int |
ORGANIZATION
The constant variable specifies the exception is
with respect to organization, sub-organization or
the container.
|
static int |
POLICY
The constant variable specifies the exception is
with respect to policy.
|
static int |
REFERRAL_COLLECTION
The constant variable specifies the exception is
with respect to referral collection.
|
static int |
REFERRAL_TYPE
The constant variable specifies the exception is
with respect to Referral Type
|
static int |
RESPONSE_PROVIDER_COLLECTION
The constant variable specifies the exception is
with respect to response provider collection.
|
static int |
RULE
The constant variable specifies the exception is
with respect to rule.
|
static int |
SERVICE
The constant variable specifies the exception is
with respect to services.
|
static int |
SUBJECT_TYPE
The constant variable specifies the exception is
with respect to Subject Type
|
static int |
USER_COLLECTION
The constant variable specifies the exception is
with respect to user collection.
|
Constructor and Description |
---|
PolicyException(String message)
Constructs an instance of the
PolicyException class. |
PolicyException(String rbName,
String errorCode,
Object[] args,
Throwable nestedException)
Constructs an instance of
PolicyException 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. |
PolicyException(String message,
Throwable nestedException)
Constructs an instance of the
PolicyException class. |
PolicyException(Throwable nestedException)
Constructs an instance of the
PolicyException class. |
Modifier and Type | Method and Description |
---|---|
String |
getCompleteL10NMessage(Locale locale) |
String |
getErrorCode()
Use this method to chain this exception with another to get localized
error messge use getL10NMessage method
|
String |
getL10NMessage(Locale locale)
Use this method to get localized error message directly.
|
String |
getMessage()
Gets messages of the exceptions including the chained exceptions
|
Object[] |
getMessageArgs()
Use this method to chain this exception with another to get localized
error messge use getL10NMessage method
|
Throwable |
getNestedException() |
String |
getResourceBundleName()
Use this method to chain this exception with another to get localized
error messge use getL10NMessage method
|
void |
printStackTrace()
Prints the stack trace of the root exception to standard error
stream.
|
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
|
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
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
public static final int POLICY
public static final int RULE
public static final int SERVICE
public static final int ORGANIZATION
public static final int USER_COLLECTION
public static final int CONDITION_COLLECTION
public static final int RESPONSE_PROVIDER_COLLECTION
public static final int REFERRAL_COLLECTION
public static final int REFERRAL_TYPE
public static final int SUBJECT_TYPE
public PolicyException(String message)
PolicyException
class.message
- The message provided by the object that is throwing the
exception.public PolicyException(Throwable nestedException)
PolicyException
class.nestedException
- the exception caught by the code block creating
this exceptionpublic PolicyException(String message, Throwable nestedException)
PolicyException
class.message
- message of this exceptionnestedException
- the exception caught by the code block creating
this exceptionpublic PolicyException(String rbName, String errorCode, Object[] args, Throwable nestedException)
PolicyException
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 JRErbName
- 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 nullnestedException
- The root cause of this errorpublic String getL10NMessage(Locale locale)
L10NMessage
getL10NMessage
in interface L10NMessage
locale
- Locale
to be used.ChainedException(String, String, Object[], Throwable)
public String getCompleteL10NMessage(Locale locale)
locale
- Locale
to be used.ChainedException(String, String, Object[], Throwable)
public String getResourceBundleName()
L10NMessage
getResourceBundleName
in interface L10NMessage
ChainedException(String, String, Object[], Throwable)
,
- to get localized error message.
public String getErrorCode()
L10NMessage
getErrorCode
in interface L10NMessage
ChainedException(String, String, Object[], Throwable)
,
- to get localized error message.
public Object[] getMessageArgs()
L10NMessage
getMessageArgs
in interface L10NMessage
MessageFormat
class to format the message
It can be null.ChainedException(String, String, Object[], Throwable)
,
- to get localized error message.
public String getMessage()
getMessage
in interface L10NMessage
getMessage
in class Throwable
public void printStackTrace()
printStackTrace
in class Throwable
public void printStackTrace(PrintWriter pw)
printStackTrace
in class Throwable
pw
- PrintWriter to which to print the stack tracepublic void printStackTrace(PrintStream ps)
printStackTrace
in class Throwable
ps
- PrintStream to which to print the stack tracepublic Throwable getNestedException()
Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.