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 * ASN.1 grammer constants of SyncDoneValueControl.
028 * 
029 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
030 */
031public enum SyncDoneValueStatesEnum implements States
032{
033
034    /** The END_STATE */
035    END_STATE,
036
037    /***/
038    START_STATE,
039
040    /** sequence start state */
041    SYNC_DONE_VALUE_SEQUENCE_STATE,
042
043    /** cookie value state */
044    COOKIE_STATE,
045
046    /** refreshDeletes value state */
047    REFRESH_DELETES_STATE,
048
049    /** terminal state */
050    LAST_SYNC_DONE_VALUE_STATE;
051
052    /**
053     * Get the grammar name
054     * 
055     * @return The grammar name
056     */
057    public String getGrammarName()
058    {
059        return "SYNC_DONE_VALUE_GRAMMAR";
060    }
061
062
063    /**
064     * Get the string representing the state
065     * 
066     * @param state The state number
067     * @return The String representing the state
068     */
069    public String getState( int state )
070    {
071        return ( state == END_STATE.ordinal() ) ? "SYNC_DONE_VALUE_GRAMMAR" : this.name();
072    }
073
074
075    /**
076     * {@inheritDoc}
077     */
078    @Override
079    public boolean isEndState()
080    {
081        return this == END_STATE;
082    }
083
084
085    /**
086     * {@inheritDoc}
087     */
088    @Override
089    public SyncDoneValueStatesEnum getStartState()
090    {
091        return START_STATE;
092    }
093}