AciException.java revision c9d44c649b67bea43e7549e2bf52870db9e770d0
6134N/A/*
6134N/A * CDDL HEADER START
6134N/A *
6134N/A * The contents of this file are subject to the terms of the
6134N/A * Common Development and Distribution License, Version 1.0 only
6134N/A * (the "License"). You may not use this file except in compliance
6134N/A * with the License.
6134N/A *
6134N/A * You can obtain a copy of the license at
6134N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
6134N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
6134N/A * See the License for the specific language governing permissions
6134N/A * and limitations under the License.
6134N/A *
6134N/A * When distributing Covered Code, include this CDDL HEADER in each
6134N/A * file and include the License file at
6134N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
6134N/A * add the following below this CDDL HEADER, with the fields enclosed
6134N/A * by brackets "[]" replaced with your own identifying * information:
6134N/A * Portions Copyright [yyyy] [name of copyright owner]
6134N/A *
6134N/A * CDDL HEADER END
6134N/A *
6134N/A *
6134N/A * Portions Copyright 2007 Sun Microsystems, Inc.
6134N/A */
6134N/Apackage org.opends.server.authorization.dseecompat;
6134N/A
6134N/Aimport static org.opends.server.loggers.Debug.debugConstructor;
6134N/Aimport static org.opends.server.loggers.Debug.debugEnter;
6134N/A
6134N/A/**
6134N/A * The AciException class defines an exception that may be thrown
6134N/A * either during ACI syntax verification of an "aci" attribute type value
6134N/A * or during evaluation of an LDAP operation using a set of applicable
6134N/A * ACIs.
6134N/A */
6134N/Apublic class AciException extends Exception {
6134N/A
6134N/A /**
6134N/A * The fully-qualified name of this class for debugging purposes.
6134N/A */
6134N/A private static final String CLASS_NAME =
6134N/A "org.opends.server.authorization.dseecompat.AciException";
6134N/A
6134N/A /**
6134N/A * The serial version identifier required to satisfy the compiler because this
6134N/A * class extends <CODE>java.lang.Exception</CODE>, which implements the
6134N/A * <CODE>java.io.Serializable</CODE> interface. This value was generated
6134N/A * using the <CODE>serialver</CODE> command-line utility included with the
6134N/A * Java SDK.
6134N/A */
6134N/A private static final long serialVersionUID = -2763328522960628853L;
6134N/A
6134N/A // The unique message ID for the associated message.
6134N/A private int messageID;
6134N/A
6134N/A /**
6134N/A * Constructs a new exception with <code>null</code> as its detail message.
6134N/A * The cause is not initialized. Used to break out of a recursive bind rule
6134N/A * decode and not print duplicate messages.
6134N/A */
6134N/A public AciException() {
6134N/A super();
6134N/A }
6134N/A
6134N/A /**
6134N/A * Creates a new ACI exception with the provided message.
6134N/A *
6134N/A * @param messageID The unique message ID for the provided message.
6134N/A * @param message The message to use for this ACI exception.
6134N/A */
6134N/A public AciException(int messageID, String message) {
6134N/A super(message);
6134N/A assert debugConstructor(CLASS_NAME, String.valueOf(messageID),
6134N/A String.valueOf(message));
6134N/A this.messageID = messageID;
6134N/A }
6134N/A
6134N/A /**
6134N/A * Creates a new ACI exception with the provided message and root
6134N/A * cause.
6134N/A *
6134N/A * @param messageID The unique identifier for the associated message.
6134N/A * @param message The message that explains the problem that occurred.
6134N/A * @param cause The exception that was caught to trigger this
6134N/A * exception.
6134N/A */
6134N/A public AciException(int messageID, String message, Throwable cause) {
6134N/A super(message, cause);
6134N/A
6134N/A assert debugConstructor(CLASS_NAME, String.valueOf(message),
6134N/A String.valueOf(cause));
6134N/A
6134N/A this.messageID = messageID;
6134N/A }
6134N/A
6134N/A /**
6134N/A * Retrieves the message ID for this exception.
6134N/A *
6134N/A * @return The message ID for this exception.
6134N/A */
6134N/A public int getMessageID() {
6134N/A assert debugEnter(CLASS_NAME, "getMessageID");
6134N/A return messageID;
6134N/A }
6134N/A}
6134N/A