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 * https://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 SyncStateValueControl'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 SyncStateValueStatesEnum implements States 033{ 034 /** The END_STATE */ 035 END_STATE, 036 037 // ========================================================================= 038 // SyncStateValue control grammar states 039 // ========================================================================= 040 /** Initial state */ 041 START_STATE, 042 043 /** Sequence Value */ 044 SYNC_STATE_VALUE_SEQUENCE_STATE, 045 046 /** sync state type Value */ 047 SYNC_TYPE_STATE, 048 049 /** syncUUID Value */ 050 SYNC_UUID_STATE, 051 052 /** cookie Value */ 053 COOKIE_STATE, 054 055 /** terminal state */ 056 LAST_SYNC_STATE_VALUE_STATE; 057 058 /** 059 * Get the grammar name 060 * 061 * @return The grammar name 062 */ 063 public String getGrammarName() 064 { 065 return "SYNC_REQUEST_VALUE_GRAMMAR"; 066 } 067 068 069 /** 070 * Get the string representing the state 071 * 072 * @param state The state number 073 * @return The String representing the state 074 */ 075 public String getState( int state ) 076 { 077 return ( state == END_STATE.ordinal() ) ? "SYNC_STATE_VALUE_END_STATE" : name(); 078 } 079 080 081 /** 082 * {@inheritDoc} 083 */ 084 @Override 085 public boolean isEndState() 086 { 087 return this == END_STATE; 088 } 089 090 091 /** 092 * {@inheritDoc} 093 */ 094 @Override 095 public SyncStateValueStatesEnum getStartState() 096 { 097 return START_STATE; 098 } 099}