001/** 002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 003 * 004 * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved 005 * 006 * The contents of this file are subject to the terms 007 * of the Common Development and Distribution License 008 * (the License). You may not use this file except in 009 * compliance with the License. 010 * 011 * You can obtain a copy of the License at 012 * https://opensso.dev.java.net/public/CDDLv1.0.html or 013 * opensso/legal/CDDLv1.0.txt 014 * See the License for the specific language governing 015 * permission and limitations under the License. 016 * 017 * When distributing Covered Code, include this CDDL 018 * Header Notice in each file and include the License file 019 * at opensso/legal/CDDLv1.0.txt. 020 * If applicable, add the following below the CDDL Header, 021 * with the fields enclosed by brackets [] replaced by 022 * your own identifying information: 023 * "Portions Copyrighted [year] [name of copyright owner]" 024 * 025 * $Id: PolicyException.java,v 1.2 2008/06/25 05:43:44 qcheng Exp $ 026 * 027 */ 028 029 030package com.sun.identity.policy; 031 032/** 033 * The class <code>PolicyException</code> is the basic exception for the 034 * the policy component. All other exceptions in this package are derived 035 * from this exception. 036 * 037 * @supported.all.api 038 */ 039public class PolicyException extends ChainedException { 040 /** 041 * The constant variable specifies the exception is 042 * with respect to policy. 043 */ 044 public final static int POLICY = 1; 045 046 /** 047 * The constant variable specifies the exception is 048 * with respect to rule. 049 */ 050 public final static int RULE = 2; 051 052 /** 053 * The constant variable specifies the exception is 054 * with respect to services. 055 */ 056 public final static int SERVICE = 3; 057 058 /** 059 * The constant variable specifies the exception is 060 * with respect to organization, sub-organization or 061 * the container. 062 */ 063 public final static int ORGANIZATION = 4; 064 065 /** 066 * The constant variable specifies the exception is 067 * with respect to user collection. 068 */ 069 public final static int USER_COLLECTION = 5; 070 071 /** 072 * The constant variable specifies the exception is 073 * with respect to constraint collection. 074 */ 075 public final static int CONDITION_COLLECTION = 6; 076 077 /** 078 * The constant variable specifies the exception is 079 * with respect to response provider collection. 080 */ 081 public final static int RESPONSE_PROVIDER_COLLECTION = 7; 082 083 /** 084 * The constant variable specifies the exception is 085 * with respect to referral collection. 086 */ 087 public final static int REFERRAL_COLLECTION = 8; 088 089 /** 090 * The constant variable specifies the exception is 091 * with respect to Referral Type 092 */ 093 public final static int REFERRAL_TYPE = 9; 094 095 /** 096 * The constant variable specifies the exception is 097 * with respect to Subject Type 098 */ 099 public final static int SUBJECT_TYPE = 10; 100 101 /** 102 * Constructs an instance of the <code>PolicyException</code> class. 103 * @param message The message provided by the object that is throwing the 104 * exception. 105 */ 106 public PolicyException(String message) { 107 super(message); 108 //fillInStackTrace(); 109 } 110 111 /** 112 * Constructs an instance of the <code>PolicyException</code> class. 113 * @param nestedException the exception caught by the code block creating 114 * this exception 115 * 116 */ 117 public PolicyException(Throwable nestedException) { 118 super(nestedException); 119 } 120 121 /** 122 * Constructs an instance of the <code>PolicyException</code> class. 123 * @param message message of this exception 124 * @param nestedException the exception caught by the code block creating 125 * this exception 126 * 127 */ 128 public PolicyException(String message, Throwable nestedException) { 129 super(message, nestedException); 130 } 131 132 /** 133 * Constructs an instance of <code>PolicyException</code> to pass the 134 * localized error message 135 * At this level, the locale of the caller is not known and it is 136 * not possible to throw localized error message at this level. 137 * Instead this constructor provides Resource Bundle name and error code 138 * for correctly locating the error message. The default 139 * <code>getMessage()</code> will always return English messages only. This 140 * is in consistent with current JRE 141 * @param rbName Resource Bundle Name to be used for getting 142 * localized error message. 143 * @param errorCode Key to resource bundle. You can use 144 * <pre>ResourceBundle rb = ResourceBunde.getBundle (rbName,locale); 145 * String localizedStr = rb.getString(errorCode);</pre> 146 * @param args arguments to message. If it is not present pass the 147 * as null 148 * @param nestedException The root cause of this error 149 */ 150 public PolicyException(String rbName, String errorCode, Object[] args, 151 Throwable nestedException) { 152 super (rbName,errorCode,args,nestedException); 153 } 154}