com.sun.identity.policy
Class PolicyException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--com.sun.identity.policy.ChainedException
                    |
                    +--com.sun.identity.policy.PolicyException
All Implemented Interfaces:
com.sun.identity.common.L10NMessage, java.io.Serializable
Direct Known Subclasses:
InvalidFormatException, InvalidNameException, LimitExceededException, NameAlreadyExistsException, NameNotFoundException, NoPermissionException, ObjectInUseException

public class PolicyException
extends com.sun.identity.policy.ChainedException

The class PolicyException is the basic exception for the the policy component. All other exceptions in this package are derived from this exception.

See Also:
Serialized Form

Field Summary
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 Summary
PolicyException(java.lang.String message)
          Constructs an instance of the PolicyException class.
PolicyException(java.lang.String rbName, java.lang.String errorCode, java.lang.Object[] args, java.lang.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(java.lang.String message, java.lang.Throwable nestedException)
          Constructs an instance of the PolicyException class.
PolicyException(java.lang.Throwable nestedException)
          Constructs an instance of the PolicyException class.
 
Method Summary
 java.lang.String getCompleteL10NMessage(java.util.Locale)
           
 java.lang.String getErrorCode()
           
 java.lang.String getL10NMessage(java.util.Locale)
           
 java.lang.String getMessage()
           
 java.lang.Object[] getMessageArgs()
           
 java.lang.Throwable getNestedException()
           
 java.lang.String getResourceBundleName()
           
 void printStackTrace()
           
 void printStackTrace(java.io.PrintStream)
           
 void printStackTrace(java.io.PrintWriter)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POLICY

public static final int POLICY
The constant variable specifies the exception is with respect to policy.

RULE

public static final int RULE
The constant variable specifies the exception is with respect to rule.

SERVICE

public static final int SERVICE
The constant variable specifies the exception is with respect to services.

ORGANIZATION

public static final int ORGANIZATION
The constant variable specifies the exception is with respect to organization, sub-organization or the container.

USER_COLLECTION

public static final int USER_COLLECTION
The constant variable specifies the exception is with respect to user collection.

CONDITION_COLLECTION

public static final int CONDITION_COLLECTION
The constant variable specifies the exception is with respect to constraint collection.

RESPONSE_PROVIDER_COLLECTION

public static final int RESPONSE_PROVIDER_COLLECTION
The constant variable specifies the exception is with respect to response provider collection.

REFERRAL_COLLECTION

public static final int REFERRAL_COLLECTION
The constant variable specifies the exception is with respect to referral collection.

REFERRAL_TYPE

public static final int REFERRAL_TYPE
The constant variable specifies the exception is with respect to Referral Type

SUBJECT_TYPE

public static final int SUBJECT_TYPE
The constant variable specifies the exception is with respect to Subject Type
Constructor Detail

PolicyException

public PolicyException(java.lang.String message)
Constructs an instance of the PolicyException class.
Parameters:
message - The message provided by the object that is throwing the exception.

PolicyException

public PolicyException(java.lang.Throwable nestedException)
Constructs an instance of the PolicyException class.
Parameters:
nestedException - the exception caught by the code block creating this exception

PolicyException

public PolicyException(java.lang.String message,
                       java.lang.Throwable nestedException)
Constructs an instance of the PolicyException class.
Parameters:
message - message of this exception
nestedException - the exception caught by the code block creating this exception

PolicyException

public PolicyException(java.lang.String rbName,
                       java.lang.String errorCode,
                       java.lang.Object[] args,
                       java.lang.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. 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 JRE
Parameters:
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
nestedException - The root cause of this error
Method Detail

getL10NMessage

public java.lang.String getL10NMessage(java.util.Locale)
Specified by:
getL10NMessage in interface com.sun.identity.common.L10NMessage

getCompleteL10NMessage

public java.lang.String getCompleteL10NMessage(java.util.Locale)

getResourceBundleName

public java.lang.String getResourceBundleName()
Specified by:
getResourceBundleName in interface com.sun.identity.common.L10NMessage

getErrorCode

public java.lang.String getErrorCode()
Specified by:
getErrorCode in interface com.sun.identity.common.L10NMessage

getMessageArgs

public java.lang.Object[] getMessageArgs()
Specified by:
getMessageArgs in interface com.sun.identity.common.L10NMessage

getMessage

public java.lang.String getMessage()
Specified by:
getMessage in interface com.sun.identity.common.L10NMessage
Overrides:
getMessage in class java.lang.Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter)
Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream)
Overrides:
printStackTrace in class java.lang.Throwable

getNestedException

public java.lang.Throwable getNestedException()


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.