001/*
002 *  Licensed to the Apache Software Foundation (ASF) under one
003 *  or more contributor license agreements.  See the NOTICE file
004 *  distributed with this work for additional information
005 *  regarding copyright ownership.  The ASF licenses this file
006 *  to you under the Apache License, Version 2.0 (the
007 *  "License"); you may not use this file except in compliance
008 *  with the License.  You may obtain a copy of the License at
009 *  
010 *    http://www.apache.org/licenses/LICENSE-2.0
011 *  
012 *  Unless required by applicable law or agreed to in writing,
013 *  software distributed under the License is distributed on an
014 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *  KIND, either express or implied.  See the License for the
016 *  specific language governing permissions and limitations
017 *  under the License. 
018 *  
019 */
020
021package org.apache.directory.server.kerberos.changepwd.exceptions;
022
023
024import org.apache.directory.shared.kerberos.exceptions.KerberosException;
025
026
027/**
028 * The root of the Change Password exception hierarchy.
029 *
030 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
031 */
032public class ChangePasswordException extends KerberosException
033{
034    private static final long serialVersionUID = 4880242751298831543L;
035
036
037    /**
038     * Creates a ChangePasswordException with an {@link ChangePasswdErrorType}.
039     *
040     * @param errorType The {@link ChangePasswdErrorType} associated with this ChangePasswordException.
041     */
042    public ChangePasswordException( ChangePasswdErrorType errorType )
043    {
044        super( errorType.getValue(), errorType.getMessage() );
045    }
046
047    
048    /**
049     * Creates a new instance of ChangePasswordException.
050     *
051     * @param errorType the error type
052     * @param message the message
053     */
054    public ChangePasswordException( ChangePasswdErrorType errorType, String message )
055    {
056        super( errorType.getValue(), message );
057    }
058
059    
060    /**
061     * Creates a ChangePasswordException with an {@link ChangePasswdErrorType} and an
062     * underlying throwable that caused this fault.
063     *
064     * @param errorType The {@link ChangePasswdErrorType} associated with this ChangePasswordException.
065     * @param cause The underlying failure, if any.
066     */
067    public ChangePasswordException( ChangePasswdErrorType errorType, Throwable cause )
068    {
069        super( errorType.getValue(), errorType.getMessage(), cause );
070    }
071
072
073    /**
074     * Creates a ChangePasswordException with an {@link ChangePasswdErrorType} and
075     * data helping to explain what caused this fault.
076     *
077     * @param errorType The {@link ChangePasswdErrorType} associated with this ChangePasswordException.
078     * @param explanatoryData Data helping to explain this fault, if any.
079     */
080    public ChangePasswordException( ChangePasswdErrorType errorType, byte[] explanatoryData )
081    {
082        super( errorType.getValue(), errorType.getMessage(), explanatoryData );
083    }
084
085
086    /**
087     * Creates a ChangePasswordException with an {@link ChangePasswdErrorType}, data helping to explain
088     * what caused this fault, and an underlying throwable that caused this fault.
089     *
090     * @param errorType The error type associated with this ChangePasswordException.
091     * @param explanatoryData Data helping to explain this fault, if any.
092     * @param cause The underlying failure, if any.
093     */
094    public ChangePasswordException( ChangePasswdErrorType errorType, byte[] explanatoryData, Throwable cause )
095    {
096        super( errorType.getValue(), errorType.getMessage(), explanatoryData, cause );
097    }
098}