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