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.controls.syncrepl_impl;
021
022
023import org.apache.directory.api.asn1.ber.grammar.States;
024
025
026/**
027 * This class store the SyncRequestValueControl's grammar constants. It is also used for
028 * debugging purposes.
029 * 
030 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
031 */
032public enum SyncRequestValueStatesEnum implements States
033{
034    // ~ Static fields/initializers
035    // -----------------------------------------------------------------
036
037    /** The END_STATE */
038    END_STATE,
039
040    // =========================================================================
041    // SyncRequestValue control grammar states
042    // =========================================================================
043    /** Initial state */
044    START_STATE,
045
046    /** Sequence Value */
047    SYNC_REQUEST_VALUE_SEQUENCE_STATE,
048
049    /** mode Value */
050    MODE_STATE,
051
052    /** cookie Value */
053    COOKIE_STATE,
054
055    /** reloadHint Value */
056    RELOAD_HINT_STATE,
057
058    /** terminal state */
059    LAST_SYNC_REQUEST_VALUE_STATE;
060
061    /**
062     * Get the grammar name
063     * 
064     * @return The grammar name
065     */
066    public String getGrammarName()
067    {
068        return "SYNC_REQUEST_VALUE_GRAMMAR";
069    }
070
071
072    /**
073     * Get the string representing the state
074     * 
075     * @param state The state number
076     * @return The String representing the state
077     */
078    public String getState( int state )
079    {
080        return ( state == END_STATE.ordinal() ) ? "SYNC_REQUEST_VALUE_END_STATE" : this.name();
081    }
082
083
084    /**
085     * {@inheritDoc}
086     */
087    @Override
088    public boolean isEndState()
089    {
090        return this == END_STATE;
091    }
092
093
094    /**
095     * {@inheritDoc}
096     */
097    @Override
098    public SyncRequestValueStatesEnum getStartState()
099    {
100        return START_STATE;
101    }
102}