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 */
020package org.apache.directory.api.ldap.extras.extended.ads_impl.pwdModify;
021
022
023import org.apache.directory.api.asn1.ber.grammar.States;
024
025
026/**
027 * This class store the PasswordModifyRequest's grammar constants. It is also used
028 * for debugging purposes.
029 * 
030 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
031 */
032public enum PasswordModifyRequestStatesEnum implements States
033{
034
035    /** The END_STATE */
036    END_STATE,
037
038    /** start state*/
039    START_STATE,
040
041    /** sequence*/
042    PASSWORD_MODIFY_REQUEST_SEQUENCE_STATE,
043
044    /** the UserIdentity */
045    USER_IDENTITY_STATE,
046
047    /** the old password */
048    OLD_PASSWORD_STATE,
049
050    /** the new password*/
051    NEW_PASSWORD_STATE,
052
053    /** Last state */
054    LAST_PASSWORD_MODIFY_REQUEST_STATE;
055
056
057    /**
058     * Get the grammar name
059     * 
060     * @return The grammar name
061     */
062    public String getGrammarName()
063    {
064        return "PASSWORD_MODIFY_REQUEST_GRAMMER";
065    }
066
067
068    /**
069     * Get the string representing the state
070     * 
071     * @param state The state number
072     * @return The String representing the state
073     */
074    public String getState( int state )
075    {
076        return ( state == END_STATE.ordinal() ) ? "PASSWORD_MODIFY_REQUEST_GRAMMER" : name();
077    }
078
079
080    /**
081     * {@inheritDoc}
082     */
083    @Override
084    public boolean isEndState()
085    {
086        return this == END_STATE;
087    }
088
089
090    /**
091     * {@inheritDoc}
092     */
093    @Override
094    public PasswordModifyRequestStatesEnum getStartState()
095    {
096        return START_STATE;
097    }
098}