ADSContextException.java revision 53c7e80ef538191e3492cc9324c600e166c57a92
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2008-2009 Sun Microsystems, Inc.
* Portions Copyright 2014-2015 ForgeRock AS
*/
/**
* This is the exception that is thrown in ADSContext.
* @see org.opends.admin.ads.ADSContext
*/
public class ADSContextException extends OpenDsException {
private static final long serialVersionUID = 1984039711031042813L;
/** The enumeration containing the different error types. */
public enum ErrorType
{
/** The host name is missing. */
/** The host name is not valid. */
/** The installation path is missing. */
/** The installation path is not valid. */
/** An access permission error. */
/** The entity is already registered. */
/** The installation is broken. */
/** The entity is not yet registered. */
/** The port is missing. */
/** The port is not valid. */
/** The name is missing. */
/** The administration UID is missing. */
/** The administrator password is missing. */
/** There is already a backend with the name of the ADS backend but not of the expected type. */
/** Error merging with another ADSContext. */
/** Unexpected error (potential bug). */
}
/**
* Creates an ADSContextException of the given error type.
* @param error the error type.
*/
{
}
/**
* Creates an ADSContextException of the given error type with the provided
* error cause.
* @param error the error type.
* @param x the throwable that generated this exception.
*/
{
}
/**
* Creates an ADSContextException of the given error type with the provided error cause and
* message.
*
* @param error
* the error type.
* @param msg
* the message describing the error.
* @param cause
* the throwable that generated this exception.
*/
{
toString = "ADSContextException: error type " + error + "." + (cause != null ? " Root cause: " + cause : "");
}
/**
* Returns the error type of this exception.
* @return the error type of this exception.
*/
{
return error;
}
/** {@inheritDoc} */
public void printStackTrace()
{
super.printStackTrace();
{
getCause().printStackTrace();
}
}
/** {@inheritDoc} */
{
return toString;
}
{
if (x instanceof OpenDsException)
{
((OpenDsException)x).getMessageObject());
} else if (x != null)
{
}
else
{
}
}
}