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.codec;
021
022
023import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.BOOLEAN;
024import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.ENUMERATED;
025import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.INTEGER;
026import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.OCTET_STRING;
027import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.SEQUENCE;
028import static org.apache.directory.api.asn1.ber.tlv.UniversalTag.SET;
029
030import org.apache.directory.api.asn1.DecoderException;
031import org.apache.directory.api.asn1.actions.CheckNotNullLength;
032import org.apache.directory.api.asn1.ber.grammar.AbstractGrammar;
033import org.apache.directory.api.asn1.ber.grammar.Grammar;
034import org.apache.directory.api.asn1.ber.grammar.GrammarAction;
035import org.apache.directory.api.asn1.ber.grammar.GrammarTransition;
036import org.apache.directory.api.asn1.ber.tlv.TLV;
037import org.apache.directory.api.i18n.I18n;
038import org.apache.directory.api.ldap.codec.actions.AllowGrammarEnd;
039import org.apache.directory.api.ldap.codec.actions.CheckLengthNotNull;
040import org.apache.directory.api.ldap.codec.actions.abandonRequest.InitAbandonRequest;
041import org.apache.directory.api.ldap.codec.actions.addRequest.AddAddRequestAttributeType;
042import org.apache.directory.api.ldap.codec.actions.addRequest.AddAttributeValue;
043import org.apache.directory.api.ldap.codec.actions.addRequest.InitAddRequest;
044import org.apache.directory.api.ldap.codec.actions.addRequest.StoreAddRequestEntryName;
045import org.apache.directory.api.ldap.codec.actions.addResponse.InitAddResponse;
046import org.apache.directory.api.ldap.codec.actions.bindRequest.InitBindRequest;
047import org.apache.directory.api.ldap.codec.actions.bindRequest.InitSaslBind;
048import org.apache.directory.api.ldap.codec.actions.bindRequest.StoreName;
049import org.apache.directory.api.ldap.codec.actions.bindRequest.StoreSaslCredentials;
050import org.apache.directory.api.ldap.codec.actions.bindRequest.StoreSaslMechanism;
051import org.apache.directory.api.ldap.codec.actions.bindRequest.StoreSimpleAuth;
052import org.apache.directory.api.ldap.codec.actions.bindRequest.StoreVersion;
053import org.apache.directory.api.ldap.codec.actions.bindResponse.InitBindResponse;
054import org.apache.directory.api.ldap.codec.actions.bindResponse.StoreServerSASLCreds;
055import org.apache.directory.api.ldap.codec.actions.compareRequest.InitCompareRequest;
056import org.apache.directory.api.ldap.codec.actions.compareRequest.StoreCompareRequestAssertionValue;
057import org.apache.directory.api.ldap.codec.actions.compareRequest.StoreCompareRequestAttributeDesc;
058import org.apache.directory.api.ldap.codec.actions.compareRequest.StoreCompareRequestEntryName;
059import org.apache.directory.api.ldap.codec.actions.compareResponse.InitCompareResponse;
060import org.apache.directory.api.ldap.codec.actions.controls.AddControl;
061import org.apache.directory.api.ldap.codec.actions.controls.InitControls;
062import org.apache.directory.api.ldap.codec.actions.controls.StoreControlCriticality;
063import org.apache.directory.api.ldap.codec.actions.controls.StoreControlValue;
064import org.apache.directory.api.ldap.codec.actions.delRequest.InitDelRequest;
065import org.apache.directory.api.ldap.codec.actions.delResponse.InitDelResponse;
066import org.apache.directory.api.ldap.codec.actions.extendedRequest.InitExtendedRequest;
067import org.apache.directory.api.ldap.codec.actions.extendedRequest.StoreExtendedRequestName;
068import org.apache.directory.api.ldap.codec.actions.extendedRequest.StoreExtendedRequestValue;
069import org.apache.directory.api.ldap.codec.actions.extendedResponse.InitExtendedResponse;
070import org.apache.directory.api.ldap.codec.actions.extendedResponse.StoreExtendedResponseName;
071import org.apache.directory.api.ldap.codec.actions.extendedResponse.StoreExtendedResponseValue;
072import org.apache.directory.api.ldap.codec.actions.intermediateResponse.InitIntermediateResponse;
073import org.apache.directory.api.ldap.codec.actions.intermediateResponse.StoreIntermediateResponseName;
074import org.apache.directory.api.ldap.codec.actions.intermediateResponse.StoreIntermediateResponseValue;
075import org.apache.directory.api.ldap.codec.actions.ldapMessage.InitLdapMessage;
076import org.apache.directory.api.ldap.codec.actions.ldapMessage.StoreMessageId;
077import org.apache.directory.api.ldap.codec.actions.ldapResult.AddReferral;
078import org.apache.directory.api.ldap.codec.actions.ldapResult.InitReferrals;
079import org.apache.directory.api.ldap.codec.actions.ldapResult.StoreErrorMessage;
080import org.apache.directory.api.ldap.codec.actions.ldapResult.StoreMatchedDN;
081import org.apache.directory.api.ldap.codec.actions.ldapResult.StoreResultCode;
082import org.apache.directory.api.ldap.codec.actions.modifyDnRequest.InitModifyDnRequest;
083import org.apache.directory.api.ldap.codec.actions.modifyDnRequest.StoreModifyDnRequestDeleteOldRdn;
084import org.apache.directory.api.ldap.codec.actions.modifyDnRequest.StoreModifyDnRequestEntryName;
085import org.apache.directory.api.ldap.codec.actions.modifyDnRequest.StoreModifyDnRequestNewRdn;
086import org.apache.directory.api.ldap.codec.actions.modifyDnRequest.StoreModifyDnRequestNewSuperior;
087import org.apache.directory.api.ldap.codec.actions.modifyDnResponse.InitModifyDnResponse;
088import org.apache.directory.api.ldap.codec.actions.modifyRequest.AddModifyRequestAttribute;
089import org.apache.directory.api.ldap.codec.actions.modifyRequest.InitAttributeVals;
090import org.apache.directory.api.ldap.codec.actions.modifyRequest.InitModifyRequest;
091import org.apache.directory.api.ldap.codec.actions.modifyRequest.StoreModifyRequestAttributeValue;
092import org.apache.directory.api.ldap.codec.actions.modifyRequest.StoreModifyRequestObjectName;
093import org.apache.directory.api.ldap.codec.actions.modifyRequest.StoreOperationType;
094import org.apache.directory.api.ldap.codec.actions.modifyResponse.InitModifyResponse;
095import org.apache.directory.api.ldap.codec.actions.searchRequest.InitSearchRequest;
096import org.apache.directory.api.ldap.codec.actions.searchRequest.InitSearchRequestAttributeDescList;
097import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestAttributeDesc;
098import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestBaseObject;
099import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestDerefAlias;
100import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestScope;
101import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestSizeLimit;
102import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestTimeLimit;
103import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreSearchRequestTypesOnly;
104import org.apache.directory.api.ldap.codec.actions.searchRequest.StoreTypeMatchingRule;
105import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitAndFilter;
106import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitApproxMatchFilter;
107import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitAssertionValueFilter;
108import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitAttributeDescFilter;
109import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitEqualityMatchFilter;
110import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitExtensibleMatchFilter;
111import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitGreaterOrEqualFilter;
112import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitLessOrEqualFilter;
113import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitNotFilter;
114import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitOrFilter;
115import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitPresentFilter;
116import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.InitSubstringsFilter;
117import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreAny;
118import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreFinal;
119import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreInitial;
120import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreMatchValue;
121import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreMatchingRuleDnAttributes;
122import org.apache.directory.api.ldap.codec.actions.searchRequest.filter.StoreSubstringFilterType;
123import org.apache.directory.api.ldap.codec.actions.searchResultDone.InitSearchResultDone;
124import org.apache.directory.api.ldap.codec.actions.searchResultEntry.AddAttributeType;
125import org.apache.directory.api.ldap.codec.actions.searchResultEntry.InitSearchResultEntry;
126import org.apache.directory.api.ldap.codec.actions.searchResultEntry.StoreSearchResultAttributeValue;
127import org.apache.directory.api.ldap.codec.actions.searchResultEntry.StoreSearchResultEntryObjectName;
128import org.apache.directory.api.ldap.codec.actions.searchResultReference.InitSearchResultReference;
129import org.apache.directory.api.ldap.codec.actions.searchResultReference.StoreReference;
130import org.apache.directory.api.ldap.codec.actions.unbindRequest.InitUnbindRequest;
131import org.apache.directory.api.ldap.codec.api.LdapCodecConstants;
132import org.apache.directory.api.ldap.codec.api.LdapMessageContainer;
133import org.apache.directory.api.ldap.codec.api.MessageDecorator;
134import org.apache.directory.api.ldap.codec.decorators.SearchRequestDecorator;
135import org.apache.directory.api.ldap.codec.search.ExtensibleMatchFilter;
136import org.apache.directory.api.ldap.model.message.Message;
137import org.apache.directory.api.util.Strings;
138import org.slf4j.Logger;
139import org.slf4j.LoggerFactory;
140
141
142/**
143 * This class implements the LdapMessage message. All the actions are declared
144 * in this class. As it is a singleton, these declaration are only done once. If
145 * an action is to be added or modified, this is where the work is to be done !
146 *
147 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
148 */
149public final class LdapMessageGrammar extends
150    AbstractGrammar<LdapMessageContainer<MessageDecorator<? extends Message>>>
151{
152    /** The logger */
153    static final Logger LOG = LoggerFactory.getLogger( LdapMessageGrammar.class );
154
155    /** A speedup for logger */
156    static final boolean IS_DEBUG = LOG.isDebugEnabled();
157
158    /** The instance of grammar. LdapMessageGrammar is a singleton */
159    private static Grammar<LdapMessageContainer<MessageDecorator<? extends Message>>> instance =
160        new LdapMessageGrammar();
161
162
163    /**
164     * Creates a new LdapMessageGrammar object.
165     */
166    @SuppressWarnings(
167        { "unchecked", "rawtypes" })
168    private LdapMessageGrammar()
169    {
170
171        setName( LdapMessageGrammar.class.getName() );
172
173        // Create the transitions table
174        super.transitions = new GrammarTransition[LdapStatesEnum.LAST_LDAP_STATE.ordinal()][256];
175
176        // ============================================================================================
177        // Transition from START to LdapMessage
178        // ============================================================================================
179        // This is the starting state :
180        // LDAPMessage --> SEQUENCE { ...
181        //
182        // We have a LDAPMessage, and the tag must be 0x30.
183        //
184        // The next state will be LDAP_MESSAGE_STATE
185        //
186        // We will just check that the length is not null
187        super.transitions[LdapStatesEnum.START_STATE.ordinal()][SEQUENCE.getValue()] =
188            new GrammarTransition<LdapMessageContainer<MessageDecorator<? extends Message>>>(
189                LdapStatesEnum.START_STATE,
190                LdapStatesEnum.LDAP_MESSAGE_STATE,
191                SEQUENCE,
192                new InitLdapMessage() );
193
194        // --------------------------------------------------------------------------------------------
195        // Transition from LdapMessage to Message ID
196        // --------------------------------------------------------------------------------------------
197        // LDAPMessage --> ... MessageId ...
198        //
199        // Checks that MessageId is in [0 .. 2147483647] and store the value in
200        // the LdapMessage Object
201        //
202        // (2147483647 = Integer.MAX_VALUE)
203        // The next state will be MESSAGE_ID_STATE
204        //
205        // The message ID will be temporarily stored in the container, because we can't store it
206        // into an object.
207        super.transitions[LdapStatesEnum.LDAP_MESSAGE_STATE.ordinal()][INTEGER.getValue()] =
208            new GrammarTransition<LdapMessageContainer<MessageDecorator<? extends Message>>>(
209                LdapStatesEnum.LDAP_MESSAGE_STATE,
210                LdapStatesEnum.MESSAGE_ID_STATE,
211                INTEGER,
212                new StoreMessageId() );
213
214        // ********************************************************************************************
215        // We have a ProtocolOp :
216        // If the Tag is 0x42, then it's an UnBindRequest.
217        // If the Tag is 0x4A, then it's a DelRequest.
218        // If the Tag is 0x50, then it's an AbandonRequest.
219        // If the Tag is 0x60, then it's a BindRequest.
220        // If the Tag is 0x61, then it's a BindResponse.
221        // If the Tag is 0x63, then it's a SearchRequest.
222        // If the Tag is 0x64, then it's a SearchResultEntry.
223        // If the Tag is 0x65, then it's a SearchResultDone
224        // If the Tag is 0x66, then it's a ModifyRequest
225        // If the Tag is 0x67, then it's a ModifyResponse.
226        // If the Tag is 0x68, then it's an AddRequest.
227        // If the Tag is 0x69, then it's an AddResponse.
228        // If the Tag is 0x6B, then it's a DelResponse.
229        // If the Tag is 0x6C, then it's a ModifyDNRequest.
230        // If the Tag is 0x6D, then it's a ModifyDNResponse.
231        // If the Tag is 0x6E, then it's a CompareRequest
232        // If the Tag is 0x6F, then it's a CompareResponse.
233        // If the Tag is 0x73, then it's a SearchResultReference.
234        // If the Tag is 0x77, then it's an ExtendedRequest.
235        // If the Tag is 0x78, then it's an ExtendedResponse.
236        //
237        // We create the associated object in this transition, and store it into the container.
238        // ********************************************************************************************
239
240        // --------------------------------------------------------------------------------------------
241        // Transition from Message ID to UnBindRequest Message.
242        // --------------------------------------------------------------------------------------------
243        // LdapMessage ::= ... UnBindRequest ...
244        // unbindRequest ::= [APPLICATION 2] NULL
245        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.UNBIND_REQUEST_TAG] =
246            new GrammarTransition(
247                LdapStatesEnum.MESSAGE_ID_STATE,
248                LdapStatesEnum.UNBIND_REQUEST_STATE,
249                LdapCodecConstants.UNBIND_REQUEST_TAG,
250                new InitUnbindRequest() );
251
252        // --------------------------------------------------------------------------------------------
253        // transition from UnBindRequest Message to Controls.
254        // --------------------------------------------------------------------------------------------
255        //         unbindRequest   UnbindRequest,
256        //         ... },
257        //     controls       [0] Controls OPTIONAL }
258        //
259        super.transitions[LdapStatesEnum.UNBIND_REQUEST_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
260            new GrammarTransition(
261                LdapStatesEnum.UNBIND_REQUEST_STATE,
262                LdapStatesEnum.CONTROLS_STATE,
263                LdapCodecConstants.CONTROLS_TAG,
264                new InitControls() );
265
266        // --------------------------------------------------------------------------------------------
267        // Transition from Message ID to DelRequest Message.
268        // --------------------------------------------------------------------------------------------
269        // LdapMessage ::= ... DelRequest ...
270        // delRequest ::= [APPLICATION 10] LDAPDN
271        //
272        // We store the Dn to bve deleted into the DelRequest object
273        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.DEL_REQUEST_TAG] =
274            new GrammarTransition(
275                LdapStatesEnum.MESSAGE_ID_STATE,
276                LdapStatesEnum.DEL_REQUEST_STATE,
277                LdapCodecConstants.DEL_REQUEST_TAG,
278                new InitDelRequest() );
279
280        // --------------------------------------------------------------------------------------------
281        // transition from DelRequest Message to Controls.
282        // --------------------------------------------------------------------------------------------
283        //         delRequest   DelRequest,
284        //         ... },
285        //     controls       [0] Controls OPTIONAL }
286        //
287        super.transitions[LdapStatesEnum.DEL_REQUEST_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
288            new GrammarTransition(
289                LdapStatesEnum.DEL_REQUEST_STATE,
290                LdapStatesEnum.CONTROLS_STATE,
291                LdapCodecConstants.CONTROLS_TAG,
292                new InitControls() );
293
294        // --------------------------------------------------------------------------------------------
295        // Transition from Message ID to AbandonRequest Message.
296        // --------------------------------------------------------------------------------------------
297        // LdapMessage ::= ... AbandonRequest ...
298        // AbandonRequest ::= [APPLICATION 16] MessageID
299        //
300        // Create the AbandonRequest object, and store the ID in it
301        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.ABANDON_REQUEST_TAG] =
302            new GrammarTransition(
303                LdapStatesEnum.MESSAGE_ID_STATE,
304                LdapStatesEnum.ABANDON_REQUEST_STATE,
305                LdapCodecConstants.ABANDON_REQUEST_TAG,
306                new InitAbandonRequest() );
307
308        // --------------------------------------------------------------------------------------------
309        // transition from AbandonRequest Message to Controls.
310        // --------------------------------------------------------------------------------------------
311        //         abandonRequest   AbandonRequest,
312        //         ... },
313        //     controls       [0] Controls OPTIONAL }
314        //
315        super.transitions[LdapStatesEnum.ABANDON_REQUEST_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
316            new GrammarTransition(
317                LdapStatesEnum.ABANDON_REQUEST_STATE,
318                LdapStatesEnum.CONTROLS_STATE,
319                LdapCodecConstants.CONTROLS_TAG,
320                new InitControls() );
321
322        // --------------------------------------------------------------------------------------------
323        // Transition from Message ID to BindRequest Message.
324        // --------------------------------------------------------------------------------------------
325        // LdapMessage ::= ... BindRequest ...
326        // BindRequest ::= [APPLICATION 0] SEQUENCE { ...
327        //
328        // We have to allocate a BindRequest
329        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.BIND_REQUEST_TAG] =
330            new GrammarTransition(
331                LdapStatesEnum.MESSAGE_ID_STATE,
332                LdapStatesEnum.BIND_REQUEST_STATE,
333                LdapCodecConstants.BIND_REQUEST_TAG,
334                new InitBindRequest() );
335
336        // --------------------------------------------------------------------------------------------
337        // Transition from BindRequest to version
338        // --------------------------------------------------------------------------------------------
339        // BindRequest ::= [APPLICATION 0] SEQUENCE {
340        //     version                 INTEGER (1 ..  127),
341        //     ....
342        //
343        // The Ldap version is parsed and stored into the BindRequest object
344        super.transitions[LdapStatesEnum.BIND_REQUEST_STATE.ordinal()][INTEGER.getValue()] =
345            new GrammarTransition(
346                LdapStatesEnum.BIND_REQUEST_STATE,
347                LdapStatesEnum.VERSION_STATE,
348                INTEGER,
349                new StoreVersion() );
350
351        // --------------------------------------------------------------------------------------------
352        // Transition from version to name
353        // --------------------------------------------------------------------------------------------
354        // BindRequest ::= [APPLICATION 0] SEQUENCE {
355        //     ....
356        //     name                    LDAPDN,
357        //     ....
358        //
359        // The Ldap name is stored into the BindRequest object
360        super.transitions[LdapStatesEnum.VERSION_STATE.ordinal()][OCTET_STRING.getValue()] =
361            new GrammarTransition(
362                LdapStatesEnum.VERSION_STATE,
363                LdapStatesEnum.NAME_STATE,
364                OCTET_STRING,
365                new StoreName() );
366
367        // --------------------------------------------------------------------------------------------
368        // Transition from name to Simple Authentication
369        // --------------------------------------------------------------------------------------------
370        // BindRequest ::= [APPLICATION 0] SEQUENCE {
371        //     ....
372        //     authentication          AuthenticationChoice }
373        //
374        // AuthenticationChoice ::= CHOICE {
375        //     simple                  [0] OCTET STRING,
376        //     ...
377        //
378        // We have to create an Authentication Object to store the credentials.
379        super.transitions[LdapStatesEnum.NAME_STATE.ordinal()][LdapCodecConstants.BIND_REQUEST_SIMPLE_TAG] =
380            new GrammarTransition(
381                LdapStatesEnum.NAME_STATE,
382                LdapStatesEnum.SIMPLE_STATE,
383                LdapCodecConstants.BIND_REQUEST_SIMPLE_TAG,
384                new StoreSimpleAuth() );
385
386        // --------------------------------------------------------------------------------------------
387        // transition from Simple Authentication to Controls.
388        // --------------------------------------------------------------------------------------------
389        //         bindRequest   BindRequest,
390        //         ... },
391        //     controls       [0] Controls OPTIONAL }
392        //
393        super.transitions[LdapStatesEnum.SIMPLE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
394            new GrammarTransition(
395                LdapStatesEnum.SIMPLE_STATE,
396                LdapStatesEnum.CONTROLS_STATE,
397                LdapCodecConstants.CONTROLS_TAG,
398                new InitControls() );
399
400        // --------------------------------------------------------------------------------------------
401        // Transition from name to SASL Authentication
402        // --------------------------------------------------------------------------------------------
403        // BindRequest ::= [APPLICATION 0] SEQUENCE {
404        //     ....
405        //     authentication          AuthenticationChoice }
406        //
407        // AuthenticationChoice ::= CHOICE {
408        //     ...
409        //     sasl                  [3] SaslCredentials }
410        //     ...
411        //
412        // We have to create an Authentication Object to store the credentials.
413        super.transitions[LdapStatesEnum.NAME_STATE.ordinal()][LdapCodecConstants.BIND_REQUEST_SASL_TAG] =
414            new GrammarTransition(
415                LdapStatesEnum.NAME_STATE,
416                LdapStatesEnum.SASL_STATE,
417                LdapCodecConstants.BIND_REQUEST_SASL_TAG,
418                new InitSaslBind() );
419
420        // --------------------------------------------------------------------------------------------
421        // Transition from SASL Authentication to Mechanism
422        // --------------------------------------------------------------------------------------------
423        // SaslCredentials ::= SEQUENCE {
424        //     mechanism   LDAPSTRING,
425        //     ...
426        //
427        // We have to store the mechanism.
428        super.transitions[LdapStatesEnum.SASL_STATE.ordinal()][OCTET_STRING.getValue()] =
429            new GrammarTransition(
430                LdapStatesEnum.SASL_STATE,
431                LdapStatesEnum.MECHANISM_STATE,
432                OCTET_STRING,
433                new StoreSaslMechanism() );
434
435        // --------------------------------------------------------------------------------------------
436        // Transition from Mechanism to Credentials
437        // --------------------------------------------------------------------------------------------
438        // SaslCredentials ::= SEQUENCE {
439        //     ...
440        //     credentials OCTET STRING OPTIONAL }
441        //
442        // We have to store the mechanism.
443        super.transitions[LdapStatesEnum.MECHANISM_STATE.ordinal()][OCTET_STRING.getValue()] =
444            new GrammarTransition(
445                LdapStatesEnum.MECHANISM_STATE,
446                LdapStatesEnum.CREDENTIALS_STATE,
447                OCTET_STRING,
448                new StoreSaslCredentials() );
449
450        // --------------------------------------------------------------------------------------------
451        // transition from from Mechanism to Controls.
452        // --------------------------------------------------------------------------------------------
453        //         bindRequest   BindRequest,
454        //         ... },
455        //     controls       [0] Controls OPTIONAL }
456        //
457        super.transitions[LdapStatesEnum.MECHANISM_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
458            new GrammarTransition(
459                LdapStatesEnum.MECHANISM_STATE,
460                LdapStatesEnum.CONTROLS_STATE,
461                LdapCodecConstants.CONTROLS_TAG,
462                new InitControls() );
463
464        // --------------------------------------------------------------------------------------------
465        // transition from credentials to Controls.
466        // --------------------------------------------------------------------------------------------
467        //         bindRequest   BindRequest,
468        //         ... },
469        //     controls       [0] Controls OPTIONAL }
470        //
471        super.transitions[LdapStatesEnum.CREDENTIALS_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
472            new GrammarTransition(
473                LdapStatesEnum.CREDENTIALS_STATE,
474                LdapStatesEnum.CONTROLS_STATE,
475                LdapCodecConstants.CONTROLS_TAG,
476                new InitControls() );
477
478        // --------------------------------------------------------------------------------------------
479        // Transition from MessageId to BindResponse message
480        // --------------------------------------------------------------------------------------------
481        // LdapMessage ::= ... BindResponse ...
482        // BindResponse ::= [APPLICATION 1] SEQUENCE { ...
483        // We have to switch to the BindResponse grammar
484        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.BIND_RESPONSE_TAG] =
485            new GrammarTransition(
486                LdapStatesEnum.MESSAGE_ID_STATE,
487                LdapStatesEnum.BIND_RESPONSE_STATE,
488                LdapCodecConstants.BIND_RESPONSE_TAG,
489                new InitBindResponse() );
490
491        // --------------------------------------------------------------------------------------------
492        // Transition from BindResponse message to Result Code BR
493        // --------------------------------------------------------------------------------------------
494        // BindResponse ::= [APPLICATION 1] SEQUENCE {
495        //     COMPONENTS OF LDAPResult,
496        //     ...
497        //
498        // LDAPResult ::= SEQUENCE {
499        //     resultCode ENUMERATED {
500        //         ...
501        //
502        // Stores the result code into the Bind Response object
503        super.transitions[LdapStatesEnum.BIND_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
504            new GrammarTransition(
505                LdapStatesEnum.BIND_RESPONSE_STATE,
506                LdapStatesEnum.RESULT_CODE_BR_STATE,
507                ENUMERATED,
508                new StoreResultCode() );
509
510        // --------------------------------------------------------------------------------------------
511        // Transition from Result Code BR to Matched Dn BR
512        // --------------------------------------------------------------------------------------------
513        // LDAPResult ::= SEQUENCE {
514        //     ...
515        //     matchedDN LDAPDN,
516        //     ...
517        //
518        // Stores the matched Dn
519        super.transitions[LdapStatesEnum.RESULT_CODE_BR_STATE.ordinal()][OCTET_STRING.getValue()] =
520            new GrammarTransition(
521                LdapStatesEnum.RESULT_CODE_BR_STATE,
522                LdapStatesEnum.MATCHED_DN_BR_STATE,
523                OCTET_STRING,
524                new StoreMatchedDN() );
525
526        // --------------------------------------------------------------------------------------------
527        // Transition from Matched Dn BR to Error Message BR
528        // --------------------------------------------------------------------------------------------
529        // LDAPResult ::= SEQUENCE {
530        //     ...
531        //     errorMessage LDAPString,
532        //     ...
533        //
534        // Stores the error message
535        super.transitions[LdapStatesEnum.MATCHED_DN_BR_STATE.ordinal()][OCTET_STRING.getValue()] =
536            new GrammarTransition(
537                LdapStatesEnum.MATCHED_DN_BR_STATE,
538                LdapStatesEnum.ERROR_MESSAGE_BR_STATE,
539                OCTET_STRING,
540                new StoreErrorMessage() );
541
542        // --------------------------------------------------------------------------------------------
543        // Transition from Error Message BR to Server SASL credentials
544        // --------------------------------------------------------------------------------------------
545        // BindResponse ::= APPLICATION 1] SEQUENCE {
546        //     ...
547        //     serverSaslCreds [7] OCTET STRING OPTIONAL }
548        //
549        // Stores the sasl credentials
550        super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE.ordinal()][LdapCodecConstants.SERVER_SASL_CREDENTIAL_TAG] =
551            new GrammarTransition(
552                LdapStatesEnum.ERROR_MESSAGE_BR_STATE,
553                LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE,
554                LdapCodecConstants.SERVER_SASL_CREDENTIAL_TAG,
555                new StoreServerSASLCreds() );
556
557        // --------------------------------------------------------------------------------------------
558        // Transition from Error Message BR to Referrals BR
559        // --------------------------------------------------------------------------------------------
560        // LDAPResult ::= SEQUENCE {
561        //     ...
562        //     referral   [3] Referral OPTIONNAL }
563        //
564        // Initialiaze the referrals list
565        super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE.ordinal()][LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] =
566            new GrammarTransition(
567                LdapStatesEnum.ERROR_MESSAGE_BR_STATE,
568                LdapStatesEnum.REFERRALS_BR_STATE,
569                LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
570                new InitReferrals() );
571
572        // --------------------------------------------------------------------------------------------
573        // Transition from Referrals BR to Referral BR
574        // --------------------------------------------------------------------------------------------
575        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
576        // URI ::= LDAPString
577        //
578        // Add a first Referral
579        super.transitions[LdapStatesEnum.REFERRALS_BR_STATE.ordinal()][OCTET_STRING.getValue()] =
580            new GrammarTransition(
581                LdapStatesEnum.REFERRALS_BR_STATE,
582                LdapStatesEnum.REFERRAL_BR_STATE,
583                OCTET_STRING,
584                new AddReferral() );
585
586        // --------------------------------------------------------------------------------------------
587        // Transition from Referral BR to Referral BR
588        // --------------------------------------------------------------------------------------------
589        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
590        // URI ::= LDAPString
591        //
592        // Adda new Referral
593        super.transitions[LdapStatesEnum.REFERRAL_BR_STATE.ordinal()][OCTET_STRING.getValue()] =
594            new GrammarTransition(
595                LdapStatesEnum.REFERRAL_BR_STATE,
596                LdapStatesEnum.REFERRAL_BR_STATE,
597                OCTET_STRING,
598                new AddReferral() );
599
600        // --------------------------------------------------------------------------------------------
601        // Transition from Referral BR to Server SASL Credentials
602        // --------------------------------------------------------------------------------------------
603        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
604        // URI ::= LDAPString
605        //
606        // Adda new Referral
607        super.transitions[LdapStatesEnum.REFERRAL_BR_STATE.ordinal()][LdapCodecConstants.SERVER_SASL_CREDENTIAL_TAG] =
608            new GrammarTransition(
609                LdapStatesEnum.REFERRAL_BR_STATE,
610                LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE,
611                LdapCodecConstants.SERVER_SASL_CREDENTIAL_TAG,
612                new StoreServerSASLCreds() );
613
614        // --------------------------------------------------------------------------------------------
615        // Transition from Referral BR to Controls
616        // --------------------------------------------------------------------------------------------
617        //         bindResponse   BindResponse,
618        //         ... },
619        //     controls       [0] Controls OPTIONAL }
620        //
621        // Adda new Referral
622        super.transitions[LdapStatesEnum.REFERRAL_BR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
623            new GrammarTransition(
624                LdapStatesEnum.REFERRAL_BR_STATE,
625                LdapStatesEnum.CONTROLS_STATE,
626                LdapCodecConstants.CONTROLS_TAG,
627                new InitControls() );
628
629        // --------------------------------------------------------------------------------------------
630        // Transition from Error Message BR to controls
631        // --------------------------------------------------------------------------------------------
632        //         bindResponse   BindResponse,
633        //         ... },
634        //     controls       [0] Controls OPTIONAL }
635        //
636        //
637        super.transitions[LdapStatesEnum.ERROR_MESSAGE_BR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
638            new GrammarTransition(
639                LdapStatesEnum.ERROR_MESSAGE_BR_STATE,
640                LdapStatesEnum.CONTROLS_STATE,
641                LdapCodecConstants.CONTROLS_TAG,
642                new InitControls() );
643
644        // --------------------------------------------------------------------------------------------
645        // Transition from Server SASL credentials to Controls
646        // --------------------------------------------------------------------------------------------
647        //         bindResponse   BindResponse,
648        //         ... },
649        //     controls       [0] Controls OPTIONAL }
650        //
651        super.transitions[LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
652            new GrammarTransition(
653                LdapStatesEnum.SERVER_SASL_CREDENTIALS_STATE,
654                LdapStatesEnum.CONTROLS_STATE,
655                LdapCodecConstants.CONTROLS_TAG,
656                new InitControls() );
657
658        // --------------------------------------------------------------------------------------------
659        // Transition from Result Code to Matched Dn
660        // --------------------------------------------------------------------------------------------
661        // LDAPResult ::= SEQUENCE {
662        //     ...
663        //     matchedDN LDAPDN,
664        //     ...
665        //
666        // Stores the matched Dn
667        super.transitions[LdapStatesEnum.RESULT_CODE_STATE.ordinal()][OCTET_STRING.getValue()] =
668            new GrammarTransition(
669                LdapStatesEnum.RESULT_CODE_STATE,
670                LdapStatesEnum.MATCHED_DN_STATE,
671                OCTET_STRING,
672                new StoreMatchedDN() );
673
674        // --------------------------------------------------------------------------------------------
675        // Transition from Matched Dn to Error Message
676        // --------------------------------------------------------------------------------------------
677        // LDAPResult ::= SEQUENCE {
678        //     ...
679        //     errorMessage LDAPString,
680        //     ...
681        //
682        // Stores the error message
683        super.transitions[LdapStatesEnum.MATCHED_DN_STATE.ordinal()][OCTET_STRING.getValue()] =
684            new GrammarTransition(
685                LdapStatesEnum.MATCHED_DN_STATE,
686                LdapStatesEnum.ERROR_MESSAGE_STATE,
687                OCTET_STRING,
688                new StoreErrorMessage() );
689
690        // --------------------------------------------------------------------------------------------
691        // Transition from Error Message to Referrals
692        // --------------------------------------------------------------------------------------------
693        // LDAPResult ::= SEQUENCE {
694        //     ...
695        //     referral   [3] Referral OPTIONNAL }
696        //
697        // Initialize the referrals list
698        super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE.ordinal()][LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] =
699            new GrammarTransition(
700                LdapStatesEnum.ERROR_MESSAGE_STATE,
701                LdapStatesEnum.REFERRALS_STATE,
702                LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
703                new InitReferrals() );
704
705        // --------------------------------------------------------------------------------------------
706        // Transition from Referrals to Referral
707        // --------------------------------------------------------------------------------------------
708        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
709        // URI ::= LDAPString
710        //
711        // Add a first Referral
712        super.transitions[LdapStatesEnum.REFERRALS_STATE.ordinal()][OCTET_STRING.getValue()] =
713            new GrammarTransition(
714                LdapStatesEnum.REFERRALS_STATE,
715                LdapStatesEnum.REFERRAL_STATE,
716                OCTET_STRING,
717                new AddReferral() );
718
719        // --------------------------------------------------------------------------------------------
720        // Transition from Referral to Referral
721        // --------------------------------------------------------------------------------------------
722        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
723        // URI ::= LDAPString
724        //
725        // Adda new Referral
726        super.transitions[LdapStatesEnum.REFERRAL_STATE.ordinal()][OCTET_STRING.getValue()] =
727            new GrammarTransition(
728                LdapStatesEnum.REFERRAL_STATE,
729                LdapStatesEnum.REFERRAL_STATE,
730                OCTET_STRING,
731                new AddReferral() );
732
733        // --------------------------------------------------------------------------------------------
734        // Transition from Referral to Controls
735        // --------------------------------------------------------------------------------------------
736        //         xxxResponse   xxxResponse,
737        //         ... },
738        //     controls       [0] Controls OPTIONAL }
739        //
740        // Adda new Referral
741        super.transitions[LdapStatesEnum.REFERRAL_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
742            new GrammarTransition(
743                LdapStatesEnum.REFERRAL_STATE,
744                LdapStatesEnum.CONTROLS_STATE,
745                LdapCodecConstants.CONTROLS_TAG,
746                new InitControls() );
747
748        // --------------------------------------------------------------------------------------------
749        // Transition from Error Message to controls
750        // --------------------------------------------------------------------------------------------
751        //         xxxResponse   xxxResponse,
752        //         ... },
753        //     controls       [0] Controls OPTIONAL }
754        //
755        //
756        super.transitions[LdapStatesEnum.ERROR_MESSAGE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
757            new GrammarTransition(
758                LdapStatesEnum.ERROR_MESSAGE_STATE,
759                LdapStatesEnum.CONTROLS_STATE,
760                LdapCodecConstants.CONTROLS_TAG,
761                new InitControls() );
762
763        // --------------------------------------------------------------------------------------------
764        // Transition from MessageId to SearchResultEntry Message.
765        // --------------------------------------------------------------------------------------------
766        // LdapMessage ::= ... SearchResultEntry ...
767        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
768        //
769        // Initialize the searchResultEntry object
770        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.SEARCH_RESULT_ENTRY_TAG] =
771            new GrammarTransition(
772                LdapStatesEnum.MESSAGE_ID_STATE,
773                LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE,
774                LdapCodecConstants.SEARCH_RESULT_ENTRY_TAG,
775                new InitSearchResultEntry() );
776
777        // --------------------------------------------------------------------------------------------
778        // Transition from SearchResultEntry Message to ObjectName
779        // --------------------------------------------------------------------------------------------
780        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
781        // objectName LDAPDN,
782        // ...
783        //
784        // Store the object name.
785        super.transitions[LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE.ordinal()][OCTET_STRING.getValue()] =
786            new GrammarTransition(
787                LdapStatesEnum.SEARCH_RESULT_ENTRY_STATE,
788                LdapStatesEnum.OBJECT_NAME_STATE,
789                OCTET_STRING,
790                new StoreSearchResultEntryObjectName() );
791
792        // --------------------------------------------------------------------------------------------
793        // Transition from ObjectName to AttributesSR
794        // --------------------------------------------------------------------------------------------
795        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
796        // ...
797        // attributes PartialAttributeList }
798        //
799        // PartialAttributeList ::= *SEQUENCE* OF SEQUENCE {
800        // ...
801        //
802        // We may have no attributes. Just allows the grammar to end
803        super.transitions[LdapStatesEnum.OBJECT_NAME_STATE.ordinal()][SEQUENCE.getValue()] =
804            new GrammarTransition(
805                LdapStatesEnum.OBJECT_NAME_STATE,
806                LdapStatesEnum.ATTRIBUTES_SR_STATE,
807                SEQUENCE,
808                new AllowGrammarEnd() );
809
810        // --------------------------------------------------------------------------------------------
811        // Transition from AttributesSR to PartialAttributesList
812        // --------------------------------------------------------------------------------------------
813        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
814        // ...
815        // attributes PartialAttributeList }
816        //
817        // PartialAttributeList ::= SEQUENCE OF *SEQUENCE* {
818        // ...
819        //
820        // nothing to do
821        super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE.ordinal()][SEQUENCE.getValue()] =
822            new GrammarTransition(
823                LdapStatesEnum.ATTRIBUTES_SR_STATE,
824                LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
825                SEQUENCE,
826                null );
827
828        // --------------------------------------------------------------------------------------------
829        // Transition from AttributesSR to Controls
830        // --------------------------------------------------------------------------------------------
831        //     searchResultEntry SearchResultEntry,
832        //     ... },
833        // controls   [0] Controls OPTIONAL }
834        //
835        // Initialize the controls
836        super.transitions[LdapStatesEnum.ATTRIBUTES_SR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
837            new GrammarTransition(
838                LdapStatesEnum.ATTRIBUTES_SR_STATE,
839                LdapStatesEnum.CONTROLS_STATE,
840                LdapCodecConstants.CONTROLS_TAG,
841                new InitControls() );
842
843        // --------------------------------------------------------------------------------------------
844        // Transition from PartialAttributesList to typeSR
845        // --------------------------------------------------------------------------------------------
846        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
847        // ...
848        // attributes PartialAttributeList }
849        //
850        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
851        //     type  AttributeDescription,
852        //     ...
853        //
854        // Store the attribute's name.
855        super.transitions[LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE.ordinal()][OCTET_STRING.getValue()] =
856            new GrammarTransition(
857                LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
858                LdapStatesEnum.TYPE_SR_STATE,
859                OCTET_STRING,
860                new AddAttributeType() );
861
862        // --------------------------------------------------------------------------------------------
863        // Transition from typeSR to ValsSR
864        // --------------------------------------------------------------------------------------------
865        // SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
866        // ...
867        // attributes PartialAttributeList }
868        //
869        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
870        //     ...
871        //     vals SET OF AttributeValue }
872        //
873        // We may have no value. Just allows the grammar to end
874        super.transitions[LdapStatesEnum.TYPE_SR_STATE.ordinal()][SET.getValue()] =
875            new GrammarTransition(
876                LdapStatesEnum.TYPE_SR_STATE,
877                LdapStatesEnum.VALS_SR_STATE,
878                SET,
879                new AllowGrammarEnd() );
880
881        // --------------------------------------------------------------------------------------------
882        // Transition from ValsSR to AttributeValueSR
883        // --------------------------------------------------------------------------------------------
884        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
885        //     ...
886        //     vals SET OF AttributeValue }
887        //
888        // AttributeValue ::= OCTET STRING
889        //
890        // Store the attribute value
891        super.transitions[LdapStatesEnum.VALS_SR_STATE.ordinal()][OCTET_STRING.getValue()] =
892            new GrammarTransition(
893                LdapStatesEnum.VALS_SR_STATE,
894                LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
895                OCTET_STRING,
896                new StoreSearchResultAttributeValue() );
897
898        // --------------------------------------------------------------------------------------------
899        // Transition from ValsSR to PartialAttributesList
900        // --------------------------------------------------------------------------------------------
901        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
902        //     ...
903        //     vals SET OF AttributeValue }
904        //
905        // Loop when we don't have any attribute value. Nothing to do
906        super.transitions[LdapStatesEnum.VALS_SR_STATE.ordinal()][SEQUENCE.getValue()] =
907            new GrammarTransition(
908                LdapStatesEnum.VALS_SR_STATE,
909                LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
910                SEQUENCE );
911
912        // --------------------------------------------------------------------------------------------
913        // Transition from ValsSR to Controls
914        // --------------------------------------------------------------------------------------------
915        //     searchResultEntry SearchResultEntry,
916        //     ... },
917        // controls   [0] Controls OPTIONAL }
918        //
919        // Initialize the controls
920        super.transitions[LdapStatesEnum.VALS_SR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
921            new GrammarTransition(
922                LdapStatesEnum.VALS_SR_STATE,
923                LdapStatesEnum.CONTROLS_STATE,
924                LdapCodecConstants.CONTROLS_TAG,
925                new InitControls() );
926
927        // --------------------------------------------------------------------------------------------
928        // Transition from AttributeValueSR to AttributeValueSR
929        // --------------------------------------------------------------------------------------------
930        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
931        //     ...
932        //     vals SET OF AttributeValue }
933        //
934        // AttributeValue ::= OCTET STRING
935        //
936        // Store the attribute value
937        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE.ordinal()][OCTET_STRING.getValue()] =
938            new GrammarTransition(
939                LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
940                LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
941                OCTET_STRING,
942                new StoreSearchResultAttributeValue() );
943
944        // --------------------------------------------------------------------------------------------
945        // Transition from AttributeValueSR to PartialAttributesList
946        // --------------------------------------------------------------------------------------------
947        // PartialAttributeList ::= SEQUENCE OF SEQUENCE {
948        //     ...
949        //     vals SET OF AttributeValue }
950        //
951        // Loop when we don't have any attribute value. Nothing to do
952        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE.ordinal()][SEQUENCE.getValue()] =
953            new GrammarTransition(
954                LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
955                LdapStatesEnum.PARTIAL_ATTRIBUTES_LIST_STATE,
956                SEQUENCE );
957
958        // --------------------------------------------------------------------------------------------
959        // Transition from AttributeValueSR to Controls
960        // --------------------------------------------------------------------------------------------
961        //     searchResultEntry SearchResultEntry,
962        //     ... },
963        // controls   [0] Controls OPTIONAL }
964        //
965        // Initialize the controls
966        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
967            new GrammarTransition(
968                LdapStatesEnum.ATTRIBUTE_VALUE_SR_STATE,
969                LdapStatesEnum.CONTROLS_STATE,
970                LdapCodecConstants.CONTROLS_TAG,
971                new InitControls() );
972
973        // --------------------------------------------------------------------------------------------
974        // SearchResultDone Message.
975        // --------------------------------------------------------------------------------------------
976        // LdapMessage ::= ... SearchResultDone ...
977        // SearchResultDone ::= [APPLICATION 5] SEQUENCE { ...
978        //
979        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.SEARCH_RESULT_DONE_TAG] =
980            new GrammarTransition(
981                LdapStatesEnum.MESSAGE_ID_STATE,
982                LdapStatesEnum.SEARCH_RESULT_DONE_STATE,
983                LdapCodecConstants.SEARCH_RESULT_DONE_TAG,
984                new InitSearchResultDone() );
985
986        // --------------------------------------------------------------------------------------------
987        // SearchResultDone Message.
988        // --------------------------------------------------------------------------------------------
989        // LdapMessage ::= ... SearchResultDone ...
990        // SearchResultDone ::= [APPLICATION 5] LDAPResult
991        //
992        // LDAPResult ::= SEQUENCE {
993        //     resultCode    ENUMERATED {
994        //         ...
995        //
996        // Stores the result code
997        super.transitions[LdapStatesEnum.SEARCH_RESULT_DONE_STATE.ordinal()][ENUMERATED.getValue()] =
998            new GrammarTransition(
999                LdapStatesEnum.SEARCH_RESULT_DONE_STATE,
1000                LdapStatesEnum.RESULT_CODE_STATE,
1001                ENUMERATED,
1002                new StoreResultCode() );
1003
1004        // --------------------------------------------------------------------------------------------
1005        // Transition from Message ID to ModifyRequest Message
1006        // --------------------------------------------------------------------------------------------
1007        // LdapMessage ::= ... ModifyRequest ...
1008        // ModifyRequest ::= [APPLICATION 6] SEQUENCE { ...
1009        //
1010        // Creates the Modify Request object
1011        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.MODIFY_REQUEST_TAG] =
1012            new GrammarTransition(
1013                LdapStatesEnum.MESSAGE_ID_STATE,
1014                LdapStatesEnum.MODIFY_REQUEST_STATE,
1015                LdapCodecConstants.MODIFY_REQUEST_TAG,
1016                new InitModifyRequest() );
1017
1018        // --------------------------------------------------------------------------------------------
1019        // Transition from ModifyRequest Message to Object
1020        // --------------------------------------------------------------------------------------------
1021        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1022        //     object    LDAPDN,
1023        //     ...
1024        //
1025        // Stores the object Dn
1026        super.transitions[LdapStatesEnum.MODIFY_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
1027            new GrammarTransition(
1028                LdapStatesEnum.MODIFY_REQUEST_STATE,
1029                LdapStatesEnum.OBJECT_STATE,
1030                OCTET_STRING,
1031                new StoreModifyRequestObjectName() );
1032
1033        // --------------------------------------------------------------------------------------------
1034        // Transition from Object to modifications
1035        // --------------------------------------------------------------------------------------------
1036        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1037        //     ...
1038        //     modification *SEQUENCE OF* SEQUENCE {
1039        //     ...
1040        //
1041        // Initialize the modifications list
1042        super.transitions[LdapStatesEnum.OBJECT_STATE.ordinal()][SEQUENCE.getValue()] =
1043            new GrammarTransition(
1044                LdapStatesEnum.OBJECT_STATE,
1045                LdapStatesEnum.MODIFICATIONS_STATE,
1046                SEQUENCE );
1047
1048        // --------------------------------------------------------------------------------------------
1049        // Transition from modifications to modification sequence
1050        // --------------------------------------------------------------------------------------------
1051        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1052        //     ...
1053        //     modification SEQUENCE OF *SEQUENCE* {
1054        //     ...
1055        //
1056        // Nothing to do
1057        super.transitions[LdapStatesEnum.MODIFICATIONS_STATE.ordinal()][SEQUENCE.getValue()] =
1058            new GrammarTransition(
1059                LdapStatesEnum.MODIFICATIONS_STATE,
1060                LdapStatesEnum.MODIFICATIONS_SEQ_STATE,
1061                SEQUENCE );
1062
1063        // --------------------------------------------------------------------------------------------
1064        // Transition from modification sequence to operation
1065        // --------------------------------------------------------------------------------------------
1066        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1067        //     ...
1068        //     modification SEQUENCE OF SEQUENCE {
1069        //         operation  ENUMERATED {
1070        //             ...
1071        //
1072        // Store operation type
1073        super.transitions[LdapStatesEnum.MODIFICATIONS_SEQ_STATE.ordinal()][ENUMERATED.getValue()] =
1074            new GrammarTransition(
1075                LdapStatesEnum.MODIFICATIONS_SEQ_STATE,
1076                LdapStatesEnum.OPERATION_STATE,
1077                ENUMERATED,
1078                new StoreOperationType() );
1079
1080        // --------------------------------------------------------------------------------------------
1081        // Transition from operation to modification
1082        // --------------------------------------------------------------------------------------------
1083        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1084        //     ...
1085        //     modification SEQUENCE OF SEQUENCE {
1086        //             ...
1087        //         modification   AttributeTypeAndValues }
1088        //
1089        // AttributeTypeAndValues ::= SEQUENCE {
1090        //     ...
1091        //
1092        // Nothing to do
1093        super.transitions[LdapStatesEnum.OPERATION_STATE.ordinal()][SEQUENCE.getValue()] =
1094            new GrammarTransition(
1095                LdapStatesEnum.OPERATION_STATE,
1096                LdapStatesEnum.MODIFICATION_STATE,
1097                SEQUENCE );
1098
1099        // --------------------------------------------------------------------------------------------
1100        // Transition from modification to TypeMod
1101        // --------------------------------------------------------------------------------------------
1102        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1103        //     ...
1104        //     modification SEQUENCE OF SEQUENCE {
1105        //             ...
1106        //         modification   AttributeTypeAndValues }
1107        //
1108        // AttributeTypeAndValues ::= SEQUENCE {
1109        //     type AttributeDescription,
1110        //     ...
1111        //
1112        // Stores the type
1113        super.transitions[LdapStatesEnum.MODIFICATION_STATE.ordinal()][OCTET_STRING.getValue()] =
1114            new GrammarTransition(
1115                LdapStatesEnum.MODIFICATION_STATE,
1116                LdapStatesEnum.TYPE_MOD_STATE,
1117                OCTET_STRING,
1118                new AddModifyRequestAttribute() );
1119
1120        // --------------------------------------------------------------------------------------------
1121        // Transition from TypeMod to vals
1122        // --------------------------------------------------------------------------------------------
1123        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1124        //     ...
1125        //     modification SEQUENCE OF SEQUENCE {
1126        //             ...
1127        //         modification   AttributeTypeAndValues }
1128        //
1129        // AttributeTypeAndValues ::= SEQUENCE {
1130        //     ...
1131        //     vals SET OF AttributeValue }
1132        //
1133        // Initialize the list of values
1134        super.transitions[LdapStatesEnum.TYPE_MOD_STATE.ordinal()][SET.getValue()] =
1135            new GrammarTransition(
1136                LdapStatesEnum.TYPE_MOD_STATE,
1137                LdapStatesEnum.VALS_STATE,
1138                SET,
1139                new InitAttributeVals() );
1140
1141        // --------------------------------------------------------------------------------------------
1142        // Transition from vals to Attribute Value
1143        // --------------------------------------------------------------------------------------------
1144        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1145        //     ...
1146        //     modification SEQUENCE OF SEQUENCE {
1147        //             ...
1148        //         modification   AttributeTypeAndValues }
1149        //
1150        // AttributeTypeAndValues ::= SEQUENCE {
1151        //     ...
1152        //     vals SET OF AttributeValue }
1153        //
1154        // AttributeValue ::= OCTET STRING
1155        //
1156        // Stores a value
1157        super.transitions[LdapStatesEnum.VALS_STATE.ordinal()][OCTET_STRING.getValue()] =
1158            new GrammarTransition(
1159                LdapStatesEnum.VALS_STATE,
1160                LdapStatesEnum.ATTRIBUTE_VALUE_STATE,
1161                OCTET_STRING,
1162                new StoreModifyRequestAttributeValue() );
1163
1164        // --------------------------------------------------------------------------------------------
1165        // Transition from vals to ModificationsSeq
1166        // --------------------------------------------------------------------------------------------
1167        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1168        //     ...
1169        //     modification SEQUENCE OF *SEQUENCE* {
1170        //             ...
1171        //         modification   AttributeTypeAndValues }
1172        //
1173        // AttributeTypeAndValues ::= SEQUENCE {
1174        //     ...
1175        //     vals SET OF AttributeValue }
1176        //
1177        // AttributeValue ::= OCTET STRING
1178        //
1179        // Nothing to do
1180        super.transitions[LdapStatesEnum.VALS_STATE.ordinal()][SEQUENCE.getValue()] =
1181            new GrammarTransition(
1182                LdapStatesEnum.VALS_STATE,
1183                LdapStatesEnum.MODIFICATIONS_SEQ_STATE,
1184                SEQUENCE );
1185
1186        // --------------------------------------------------------------------------------------------
1187        // Transition from vals to Controls
1188        // --------------------------------------------------------------------------------------------
1189        //     modifyRequest ModifyRequest,
1190        //     ... },
1191        // controls   [0] Controls OPTIONAL }
1192        //
1193        // Nothing to do
1194        super.transitions[LdapStatesEnum.VALS_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1195            new GrammarTransition(
1196                LdapStatesEnum.VALS_STATE,
1197                LdapStatesEnum.CONTROLS_STATE,
1198                LdapCodecConstants.CONTROLS_TAG,
1199                new InitControls() );
1200
1201        // --------------------------------------------------------------------------------------------
1202        // Transition from Attribute Value to Attribute Value
1203        // --------------------------------------------------------------------------------------------
1204        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1205        //     ...
1206        //     modification SEQUENCE OF SEQUENCE {
1207        //             ...
1208        //         modification   AttributeTypeAndValues }
1209        //
1210        // AttributeTypeAndValues ::= SEQUENCE {
1211        //     ...
1212        //     vals SET OF AttributeValue }
1213        //
1214        // AttributeValue ::= OCTET STRING
1215        //
1216        // Stores a value
1217        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE.ordinal()][OCTET_STRING.getValue()] =
1218            new GrammarTransition(
1219                LdapStatesEnum.ATTRIBUTE_VALUE_STATE,
1220                LdapStatesEnum.ATTRIBUTE_VALUE_STATE,
1221                OCTET_STRING,
1222                new StoreModifyRequestAttributeValue() );
1223
1224        // --------------------------------------------------------------------------------------------
1225        // Transition from Attribute Value to ModificationsSeq
1226        // --------------------------------------------------------------------------------------------
1227        // ModifyRequest ::= [APPLICATION 6] SEQUENCE {
1228        //     ...
1229        //     modification SEQUENCE OF *SEQUENCE* {
1230        //             ...
1231        //         modification   AttributeTypeAndValues }
1232        //
1233        // AttributeTypeAndValues ::= SEQUENCE {
1234        //     ...
1235        //     vals SET OF AttributeValue }
1236        //
1237        // AttributeValue ::= OCTET STRING
1238        //
1239        // Nothing to do
1240        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE.ordinal()][SEQUENCE.getValue()] =
1241            new GrammarTransition(
1242                LdapStatesEnum.ATTRIBUTE_VALUE_STATE,
1243                LdapStatesEnum.MODIFICATIONS_SEQ_STATE,
1244                SEQUENCE );
1245
1246        // --------------------------------------------------------------------------------------------
1247        // Transition from Attribute Value to Controls
1248        // --------------------------------------------------------------------------------------------
1249        //     modifyRequest ModifyRequest,
1250        //     ... },
1251        // controls   [0] Controls OPTIONAL }
1252        //
1253        // Nothing to do
1254        super.transitions[LdapStatesEnum.ATTRIBUTE_VALUE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1255            new GrammarTransition(
1256                LdapStatesEnum.ATTRIBUTE_VALUE_STATE,
1257                LdapStatesEnum.CONTROLS_STATE,
1258                LdapCodecConstants.CONTROLS_TAG,
1259                new InitControls() );
1260
1261        // --------------------------------------------------------------------------------------------
1262        // ModifyResponse Message.
1263        // --------------------------------------------------------------------------------------------
1264        // LdapMessage ::= ... ModifyResponse ...
1265        // ModifyResponse ::= [APPLICATION 7] SEQUENCE { ...
1266        // We have to switch to the ModifyResponse grammar
1267        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.MODIFY_RESPONSE_TAG] =
1268            new GrammarTransition(
1269                LdapStatesEnum.MESSAGE_ID_STATE,
1270                LdapStatesEnum.MODIFY_RESPONSE_STATE,
1271                LdapCodecConstants.MODIFY_RESPONSE_TAG,
1272                new InitModifyResponse() );
1273
1274        // --------------------------------------------------------------------------------------------
1275        // ModifyResponse Message.
1276        // --------------------------------------------------------------------------------------------
1277        // LdapMessage ::= ... ModifyResponse ...
1278        // ModifyResponse ::= [APPLICATION 7] LDAPResult
1279        //
1280        // LDAPResult ::= SEQUENCE {
1281        //     resultCode    ENUMERATED {
1282        //         ...
1283        //
1284        // Stores the result code
1285        super.transitions[LdapStatesEnum.MODIFY_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1286            new GrammarTransition(
1287                LdapStatesEnum.MODIFY_RESPONSE_STATE,
1288                LdapStatesEnum.RESULT_CODE_STATE,
1289                ENUMERATED,
1290                new StoreResultCode() );
1291
1292        // --------------------------------------------------------------------------------------------
1293        // AddRequest Message.
1294        // --------------------------------------------------------------------------------------------
1295        // LdapMessage ::= ... AddRequest ...
1296        // AddRequest ::= [APPLICATION 8] SEQUENCE { ...
1297        //
1298        // Initialize the AddRequest object
1299        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.ADD_REQUEST_TAG] =
1300            new GrammarTransition(
1301                LdapStatesEnum.MESSAGE_ID_STATE,
1302                LdapStatesEnum.ADD_REQUEST_STATE,
1303                LdapCodecConstants.ADD_REQUEST_TAG,
1304                new InitAddRequest() );
1305
1306        // --------------------------------------------------------------------------------------------
1307        // Transition from Add Request to Entry
1308        // --------------------------------------------------------------------------------------------
1309        // AddRequest ::= [APPLICATION 8] SEQUENCE {
1310        //     entry           LDAPDN,
1311        //     ...
1312        //
1313        // Stores the Dn
1314        super.transitions[LdapStatesEnum.ADD_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
1315            new GrammarTransition(
1316                LdapStatesEnum.ADD_REQUEST_STATE,
1317                LdapStatesEnum.ENTRY_STATE,
1318                OCTET_STRING,
1319                new StoreAddRequestEntryName() );
1320
1321        // --------------------------------------------------------------------------------------------
1322        // Transition from Entry to Attributes
1323        // --------------------------------------------------------------------------------------------
1324        // AddRequest ::= [APPLICATION 8] SEQUENCE {
1325        //     ...
1326        //    attributes AttributeList }
1327        //
1328        // AttributeList ::= SEQUENCE OF ...
1329        //
1330        // Initialize the attribute list
1331        super.transitions[LdapStatesEnum.ENTRY_STATE.ordinal()][SEQUENCE.getValue()] =
1332            new GrammarTransition(
1333                LdapStatesEnum.ENTRY_STATE,
1334                LdapStatesEnum.ATTRIBUTES_STATE,
1335                SEQUENCE );
1336
1337        // --------------------------------------------------------------------------------------------
1338        // Transition from Attributes to Attribute
1339        // --------------------------------------------------------------------------------------------
1340        // AttributeList ::= SEQUENCE OF SEQUENCE {
1341        //
1342        // We don't do anything in this transition. The attribute will be created when we met the type
1343        super.transitions[LdapStatesEnum.ATTRIBUTES_STATE.ordinal()][SEQUENCE.getValue()] =
1344            new GrammarTransition(
1345                LdapStatesEnum.ATTRIBUTES_STATE,
1346                LdapStatesEnum.ATTRIBUTE_STATE,
1347                SEQUENCE );
1348
1349        // --------------------------------------------------------------------------------------------
1350        // Transition from Attribute to type
1351        // --------------------------------------------------------------------------------------------
1352        // AttributeList ::= SEQUENCE OF SEQUENCE {
1353        //     type    AttributeDescription,
1354        //     ...
1355        //
1356        // AttributeDescription LDAPString
1357        //
1358        // We store the type in the current attribute
1359        super.transitions[LdapStatesEnum.ATTRIBUTE_STATE.ordinal()][OCTET_STRING.getValue()] =
1360            new GrammarTransition(
1361                LdapStatesEnum.ATTRIBUTE_STATE,
1362                LdapStatesEnum.TYPE_STATE,
1363                OCTET_STRING,
1364                new AddAddRequestAttributeType() );
1365
1366        // --------------------------------------------------------------------------------------------
1367        // Transition from type to vals
1368        // --------------------------------------------------------------------------------------------
1369        // AttributeList ::= SEQUENCE OF SEQUENCE {
1370        //     ...
1371        //     vals SET OF AttributeValue }
1372        //
1373        // Nothing to do here.
1374        super.transitions[LdapStatesEnum.TYPE_STATE.ordinal()][SET.getValue()] =
1375            new GrammarTransition(
1376                LdapStatesEnum.TYPE_STATE,
1377                LdapStatesEnum.VALUES_STATE,
1378                SET );
1379
1380        // --------------------------------------------------------------------------------------------
1381        // Transition from vals to Value
1382        // --------------------------------------------------------------------------------------------
1383        // AttributeList ::= SEQUENCE OF SEQUENCE {
1384        //     ...
1385        //     vals SET OF AttributeValue }
1386        //
1387        // AttributeValue OCTET STRING
1388        //
1389        // Store the value into the current attribute
1390        super.transitions[LdapStatesEnum.VALUES_STATE.ordinal()][OCTET_STRING.getValue()] =
1391            new GrammarTransition(
1392                LdapStatesEnum.VALUES_STATE,
1393                LdapStatesEnum.VALUE_STATE,
1394                OCTET_STRING,
1395                new AddAttributeValue() );
1396
1397        // --------------------------------------------------------------------------------------------
1398        // Transition from Value to Value
1399        // --------------------------------------------------------------------------------------------
1400        // AttributeList ::= SEQUENCE OF SEQUENCE {
1401        //     ...
1402        //     vals SET OF AttributeValue }
1403        //
1404        // AttributeValue OCTET STRING
1405        //
1406        // Store the value into the current attribute
1407        super.transitions[LdapStatesEnum.VALUE_STATE.ordinal()][OCTET_STRING.getValue()] =
1408            new GrammarTransition(
1409                LdapStatesEnum.VALUE_STATE,
1410                LdapStatesEnum.VALUE_STATE,
1411                OCTET_STRING,
1412                new AddAttributeValue() );
1413
1414        // --------------------------------------------------------------------------------------------
1415        // Transition from Value to Attribute
1416        // --------------------------------------------------------------------------------------------
1417        // AttributeList ::= SEQUENCE OF SEQUENCE {
1418        //
1419        // Nothing to do here.
1420        super.transitions[LdapStatesEnum.VALUE_STATE.ordinal()][SEQUENCE.getValue()] =
1421            new GrammarTransition(
1422                LdapStatesEnum.VALUE_STATE,
1423                LdapStatesEnum.ATTRIBUTE_STATE,
1424                SEQUENCE );
1425
1426        // --------------------------------------------------------------------------------------------
1427        // Transition from Value to Controls
1428        // --------------------------------------------------------------------------------------------
1429        // AttributeList ::= SEQUENCE OF SEQUENCE {
1430        //
1431        // Initialize the controls
1432        super.transitions[LdapStatesEnum.VALUE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1433            new GrammarTransition(
1434                LdapStatesEnum.VALUE_STATE,
1435                LdapStatesEnum.CONTROLS_STATE,
1436                LdapCodecConstants.CONTROLS_TAG,
1437                new InitControls() );
1438
1439        // --------------------------------------------------------------------------------------------
1440        // AddResponse Message.
1441        // --------------------------------------------------------------------------------------------
1442        // LdapMessage ::= ... AddResponse ...
1443        // AddResponse ::= [APPLICATION 9] LDAPResult
1444        //
1445        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.ADD_RESPONSE_TAG] =
1446            new GrammarTransition(
1447                LdapStatesEnum.MESSAGE_ID_STATE,
1448                LdapStatesEnum.ADD_RESPONSE_STATE,
1449                LdapCodecConstants.ADD_RESPONSE_TAG,
1450                new InitAddResponse() );
1451
1452        // --------------------------------------------------------------------------------------------
1453        // AddResponse Message.
1454        // --------------------------------------------------------------------------------------------
1455        // LdapMessage ::= ... AddResponse ...
1456        // AddResponse ::= [APPLICATION 9] LDAPResult
1457        //
1458        // LDAPResult ::= SEQUENCE {
1459        //     resultCode    ENUMERATED {
1460        //         ...
1461        //
1462        // Stores the result code
1463        super.transitions[LdapStatesEnum.ADD_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1464            new GrammarTransition(
1465                LdapStatesEnum.ADD_RESPONSE_STATE,
1466                LdapStatesEnum.RESULT_CODE_STATE,
1467                ENUMERATED,
1468                new StoreResultCode() );
1469
1470        // --------------------------------------------------------------------------------------------
1471        // DelResponse Message.
1472        // --------------------------------------------------------------------------------------------
1473        // LdapMessage ::= ... DelResponse ...
1474        // DelResponse ::= [APPLICATION 11] LDAPResult
1475        // We have to switch to the DelResponse grammar
1476        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.DEL_RESPONSE_TAG] =
1477            new GrammarTransition(
1478                LdapStatesEnum.MESSAGE_ID_STATE,
1479                LdapStatesEnum.DEL_RESPONSE_STATE,
1480                LdapCodecConstants.DEL_RESPONSE_TAG,
1481                new InitDelResponse() );
1482
1483        // --------------------------------------------------------------------------------------------
1484        // DelResponse Message.
1485        // --------------------------------------------------------------------------------------------
1486        // LdapMessage ::= ... DelResponse ...
1487        // DelResponse ::= [APPLICATION 11] LDAPResult
1488        //
1489        // LDAPResult ::= SEQUENCE {
1490        //     resultCode    ENUMERATED {
1491        //         ...
1492        //
1493        // Stores the result code
1494        super.transitions[LdapStatesEnum.DEL_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1495            new GrammarTransition(
1496                LdapStatesEnum.DEL_RESPONSE_STATE,
1497                LdapStatesEnum.RESULT_CODE_STATE,
1498                ENUMERATED,
1499                new StoreResultCode() );
1500
1501        // --------------------------------------------------------------------------------------------
1502        // Transition from MessageID to ModifydDNRequest Message.
1503        // --------------------------------------------------------------------------------------------
1504        // LdapMessage ::= ... ModifyDNRequest ...
1505        // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
1506        //
1507        // Create the ModifyDNRequest Object
1508        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.MODIFY_DN_REQUEST_TAG] =
1509            new GrammarTransition(
1510                LdapStatesEnum.MESSAGE_ID_STATE,
1511                LdapStatesEnum.MODIFY_DN_REQUEST_STATE,
1512                LdapCodecConstants.MODIFY_DN_REQUEST_TAG,
1513                new InitModifyDnRequest() );
1514
1515        // --------------------------------------------------------------------------------------------
1516        // Transition from ModifydDNRequest Message to EntryModDN
1517        // --------------------------------------------------------------------------------------------
1518        // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
1519        //     entry LDAPDN,
1520        //     ...
1521        //
1522        // Stores the entry Dn
1523        super.transitions[LdapStatesEnum.MODIFY_DN_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
1524            new GrammarTransition(
1525                LdapStatesEnum.MODIFY_DN_REQUEST_STATE,
1526                LdapStatesEnum.ENTRY_MOD_DN_STATE,
1527                OCTET_STRING,
1528                new StoreModifyDnRequestEntryName() );
1529
1530        // --------------------------------------------------------------------------------------------
1531        // Transition from EntryModDN to NewRDN
1532        // --------------------------------------------------------------------------------------------
1533        // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
1534        //     ...
1535        //     newrdn  RelativeRDN,
1536        //     ...
1537        //
1538        // RelativeRDN :: LDAPString
1539        //
1540        // Stores the new Rdn
1541        super.transitions[LdapStatesEnum.ENTRY_MOD_DN_STATE.ordinal()][OCTET_STRING.getValue()] =
1542            new GrammarTransition(
1543                LdapStatesEnum.ENTRY_MOD_DN_STATE,
1544                LdapStatesEnum.NEW_RDN_STATE,
1545                OCTET_STRING,
1546                new StoreModifyDnRequestNewRdn() );
1547
1548        // --------------------------------------------------------------------------------------------
1549        // Transition from NewRDN to DeleteOldRDN
1550        // --------------------------------------------------------------------------------------------
1551        // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
1552        //     ...
1553        //     deleteoldrdn BOOLEAN,
1554        //     ...
1555        //
1556        // Stores the deleteOldRDN flag
1557        super.transitions[LdapStatesEnum.NEW_RDN_STATE.ordinal()][BOOLEAN.getValue()] =
1558            new GrammarTransition(
1559                LdapStatesEnum.NEW_RDN_STATE,
1560                LdapStatesEnum.DELETE_OLD_RDN_STATE,
1561                BOOLEAN,
1562                new StoreModifyDnRequestDeleteOldRdn() );
1563
1564        // --------------------------------------------------------------------------------------------
1565        // Transition from DeleteOldRDN to NewSuperior
1566        // --------------------------------------------------------------------------------------------
1567        // ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
1568        //     ...
1569        //     newSuperior [0] LDAPDN OPTIONAL }
1570        //
1571        // Stores the new superior
1572        super.transitions[LdapStatesEnum.DELETE_OLD_RDN_STATE.ordinal()][LdapCodecConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG] =
1573            new GrammarTransition(
1574                LdapStatesEnum.DELETE_OLD_RDN_STATE,
1575                LdapStatesEnum.NEW_SUPERIOR_STATE,
1576                LdapCodecConstants.MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG,
1577                new StoreModifyDnRequestNewSuperior() );
1578
1579        // --------------------------------------------------------------------------------------------
1580        // Transition from DeleteOldRDN to Controls
1581        // --------------------------------------------------------------------------------------------
1582        //     modifyDNRequest ModifyDNRequest,
1583        //     ... },
1584        // controls   [0] Controls OPTIONAL }
1585        //
1586        // Stores the new superior
1587        super.transitions[LdapStatesEnum.DELETE_OLD_RDN_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1588            new GrammarTransition(
1589                LdapStatesEnum.DELETE_OLD_RDN_STATE,
1590                LdapStatesEnum.CONTROLS_STATE,
1591                LdapCodecConstants.CONTROLS_TAG,
1592                new InitControls() );
1593
1594        // --------------------------------------------------------------------------------------------
1595        // Transition from DeleteOldRDN to Controls
1596        // --------------------------------------------------------------------------------------------
1597        //     modifyDNRequest ModifyDNRequest,
1598        //     ... },
1599        // controls   [0] Controls OPTIONAL }
1600        //
1601        // Stores the new superior
1602        super.transitions[LdapStatesEnum.NEW_SUPERIOR_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1603            new GrammarTransition(
1604                LdapStatesEnum.NEW_SUPERIOR_STATE,
1605                LdapStatesEnum.CONTROLS_STATE,
1606                LdapCodecConstants.CONTROLS_TAG,
1607                new InitControls() );
1608
1609        // --------------------------------------------------------------------------------------------
1610        // Transition from MessageID to ModifyDNResponse Message.
1611        // --------------------------------------------------------------------------------------------
1612        // ModifyDNResponse ::= [APPLICATION 13] SEQUENCE {
1613        //     ...
1614        //
1615        // Creates the ModifyDNResponse
1616        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.MODIFY_DN_RESPONSE_TAG] =
1617            new GrammarTransition(
1618                LdapStatesEnum.MESSAGE_ID_STATE,
1619                LdapStatesEnum.MODIFY_DN_RESPONSE_STATE,
1620                LdapCodecConstants.MODIFY_DN_RESPONSE_TAG,
1621                new InitModifyDnResponse() );
1622
1623        // --------------------------------------------------------------------------------------------
1624        // Transition from ModifyDNResponse Message to Result Code
1625        // --------------------------------------------------------------------------------------------
1626        // LdapMessage ::= ... ModifyDNResponse ...
1627        // ModifyDNResponse ::= [APPLICATION 13] LDAPResult
1628        //
1629        // LDAPResult ::= SEQUENCE {
1630        //     resultCode    ENUMERATED {
1631        //         ...
1632        //
1633        // Stores the result co        //     modifyDNRequest ModifyDNRequest,
1634        //     ... },
1635        // controls   [0] Controls OPTIONAL }
1636        super.transitions[LdapStatesEnum.MODIFY_DN_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1637            new GrammarTransition(
1638                LdapStatesEnum.MODIFY_DN_RESPONSE_STATE,
1639                LdapStatesEnum.RESULT_CODE_STATE,
1640                ENUMERATED,
1641                new StoreResultCode() );
1642
1643        // --------------------------------------------------------------------------------------------
1644        // Transition from Message ID to CompareResquest
1645        // --------------------------------------------------------------------------------------------
1646        // LdapMessage ::= ... CompareRequest ...
1647        //
1648        // CompareRequest ::= [APPLICATION 14] SEQUENCE {
1649        // ...
1650        //
1651        // Initialize the Compare Request object
1652        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.COMPARE_REQUEST_TAG] =
1653            new GrammarTransition(
1654                LdapStatesEnum.MESSAGE_ID_STATE,
1655                LdapStatesEnum.COMPARE_REQUEST_STATE,
1656                LdapCodecConstants.COMPARE_REQUEST_TAG,
1657                new InitCompareRequest() );
1658
1659        // --------------------------------------------------------------------------------------------
1660        // Transition from CompareResquest to entryComp
1661        // --------------------------------------------------------------------------------------------
1662        // CompareRequest ::= [APPLICATION 14] SEQUENCE {
1663        //     entry    LDAPDN,
1664        //     ...
1665        //
1666        // Stores the compared Dn
1667        super.transitions[LdapStatesEnum.COMPARE_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
1668            new GrammarTransition(
1669                LdapStatesEnum.COMPARE_REQUEST_STATE,
1670                LdapStatesEnum.ENTRY_COMP_STATE,
1671                OCTET_STRING,
1672                new StoreCompareRequestEntryName() );
1673
1674        // --------------------------------------------------------------------------------------------
1675        // Transition from entryComp to ava
1676        // --------------------------------------------------------------------------------------------
1677        // CompareRequest ::= [APPLICATION 14] SEQUENCE {
1678        //     ...
1679        //     ava AttributeValueAssertion }
1680        //
1681        // AttributeValueAssertion ::= SEQUENCE {
1682        //
1683        // Nothing to do
1684        super.transitions[LdapStatesEnum.ENTRY_COMP_STATE.ordinal()][SEQUENCE.getValue()] =
1685            new GrammarTransition(
1686                LdapStatesEnum.ENTRY_COMP_STATE,
1687                LdapStatesEnum.AVA_STATE,
1688                SEQUENCE );
1689
1690        // --------------------------------------------------------------------------------------------
1691        // Transition from ava to AttributeDesc
1692        // --------------------------------------------------------------------------------------------
1693        // AttributeValueAssertion ::= SEQUENCE {
1694        //     attributeDesc AttributeDescription,
1695        //     ...
1696        //
1697        // AttributeDescription LDAPString
1698        //
1699        // Stores the attribute description
1700        super.transitions[LdapStatesEnum.AVA_STATE.ordinal()][OCTET_STRING.getValue()] =
1701            new GrammarTransition(
1702                LdapStatesEnum.AVA_STATE,
1703                LdapStatesEnum.ATTRIBUTE_DESC_STATE,
1704                OCTET_STRING,
1705                new StoreCompareRequestAttributeDesc() );
1706
1707        // --------------------------------------------------------------------------------------------
1708        // Transition from AttributeDesc to Assertion Value
1709        // --------------------------------------------------------------------------------------------
1710        // AttributeValueAssertion ::= SEQUENCE {
1711        //     ...
1712        //     assertionValue AssertionValue }
1713        //
1714        // AssertionValue OCTET STRING
1715        //
1716        // Stores the attribute value
1717        super.transitions[LdapStatesEnum.ATTRIBUTE_DESC_STATE.ordinal()][OCTET_STRING.getValue()] =
1718            new GrammarTransition(
1719                LdapStatesEnum.ATTRIBUTE_DESC_STATE,
1720                LdapStatesEnum.ASSERTION_VALUE_STATE,
1721                OCTET_STRING,
1722                new StoreCompareRequestAssertionValue() );
1723
1724        // --------------------------------------------------------------------------------------------
1725        // Transition from Assertion Value to Controls
1726        // --------------------------------------------------------------------------------------------
1727        // AttributeValueAssertion ::= SEQUENCE {
1728        //     ...
1729        //     assertionValue AssertionValue }
1730        //
1731        // AssertionValue OCTET STRING
1732        //
1733        // Stores the attribute value
1734        super.transitions[LdapStatesEnum.ASSERTION_VALUE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1735            new GrammarTransition(
1736                LdapStatesEnum.ASSERTION_VALUE_STATE,
1737                LdapStatesEnum.CONTROLS_STATE,
1738                LdapCodecConstants.CONTROLS_TAG,
1739                new InitControls() );
1740
1741        // --------------------------------------------------------------------------------------------
1742        // CompareResponse Message.
1743        // --------------------------------------------------------------------------------------------
1744        // LdapMessage ::= ... CompareResponse ...
1745        // CompareResponse ::= [APPLICATION 15] LDAPResult
1746        // We have to switch to the CompareResponse grammar
1747        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.COMPARE_RESPONSE_TAG] =
1748            new GrammarTransition(
1749                LdapStatesEnum.MESSAGE_ID_STATE,
1750                LdapStatesEnum.COMPARE_RESPONSE_STATE,
1751                LdapCodecConstants.COMPARE_RESPONSE_TAG,
1752                new InitCompareResponse() );
1753
1754        // --------------------------------------------------------------------------------------------
1755        // CompareResponse Message.
1756        // --------------------------------------------------------------------------------------------
1757        // LdapMessage ::= ... CompareResponse ...
1758        // CompareResponse ::= [APPLICATION 15] LDAPResult
1759        //
1760        // LDAPResult ::= SEQUENCE {
1761        //     resultCode    ENUMERATED {
1762        //         ...
1763        //
1764        // Stores the result code
1765        super.transitions[LdapStatesEnum.COMPARE_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1766            new GrammarTransition(
1767                LdapStatesEnum.COMPARE_RESPONSE_STATE,
1768                LdapStatesEnum.RESULT_CODE_STATE,
1769                ENUMERATED,
1770                new StoreResultCode() );
1771
1772        // --------------------------------------------------------------------------------------------
1773        // Transition from MessageID to SearchResultReference Message.
1774        // --------------------------------------------------------------------------------------------
1775        // LdapMessage ::= ... SearchResultReference ...
1776        // SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL
1777        //
1778        // Initialization of SearchResultReference object
1779        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.SEARCH_RESULT_REFERENCE_TAG] =
1780            new GrammarTransition(
1781                LdapStatesEnum.MESSAGE_ID_STATE,
1782                LdapStatesEnum.SEARCH_RESULT_REFERENCE_STATE,
1783                LdapCodecConstants.SEARCH_RESULT_REFERENCE_TAG,
1784                new InitSearchResultReference() );
1785
1786        // --------------------------------------------------------------------------------------------
1787        // Transition from SearchResultReference Message to Reference
1788        // --------------------------------------------------------------------------------------------
1789        // LdapMessage ::= ... SearchResultReference ...
1790        // SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL
1791        //
1792        // Initialization of SearchResultReference object
1793        super.transitions[LdapStatesEnum.SEARCH_RESULT_REFERENCE_STATE.ordinal()][OCTET_STRING.getValue()] =
1794            new GrammarTransition(
1795                LdapStatesEnum.SEARCH_RESULT_REFERENCE_STATE,
1796                LdapStatesEnum.REFERENCE_STATE,
1797                OCTET_STRING,
1798                new StoreReference() );
1799
1800        // --------------------------------------------------------------------------------------------
1801        // Transition from Reference to Reference
1802        // --------------------------------------------------------------------------------------------
1803        // LdapMessage ::= ... SearchResultReference ...
1804        // SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL
1805        //
1806        // Initialization of SearchResultReference object
1807        super.transitions[LdapStatesEnum.REFERENCE_STATE.ordinal()][OCTET_STRING.getValue()] =
1808            new GrammarTransition(
1809                LdapStatesEnum.REFERENCE_STATE,
1810                LdapStatesEnum.REFERENCE_STATE,
1811                OCTET_STRING,
1812                new StoreReference() );
1813
1814        // --------------------------------------------------------------------------------------------
1815        // Transition from Reference to Controls
1816        // --------------------------------------------------------------------------------------------
1817        //     searchResultReference SearchResultReference,
1818        //     ... },
1819        // controls   [0] Controls OPTIONAL }
1820        //
1821        // Initialization the controls
1822        super.transitions[LdapStatesEnum.REFERENCE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1823            new GrammarTransition(
1824                LdapStatesEnum.REFERENCE_STATE,
1825                LdapStatesEnum.CONTROLS_STATE,
1826                LdapCodecConstants.CONTROLS_TAG,
1827                new InitControls() );
1828
1829        // --------------------------------------------------------------------------------------------
1830        // Transition from Message Id to ExtendedRequest Message
1831        // --------------------------------------------------------------------------------------------
1832        // LdapMessage ::= ... ExtendedRequest ...
1833        // ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
1834        //
1835        // Creates the ExtendedRequest object
1836        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.EXTENDED_REQUEST_TAG] =
1837            new GrammarTransition(
1838                LdapStatesEnum.MESSAGE_ID_STATE,
1839                LdapStatesEnum.EXTENDED_REQUEST_STATE,
1840                LdapCodecConstants.EXTENDED_REQUEST_TAG,
1841                new InitExtendedRequest() );
1842
1843        // --------------------------------------------------------------------------------------------
1844        // Transition from ExtendedRequest Message to RequestName
1845        // --------------------------------------------------------------------------------------------
1846        // ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
1847        //     requestName [0] LDAPOID,
1848        //     ...
1849        //
1850        // Stores the name
1851        super.transitions[LdapStatesEnum.EXTENDED_REQUEST_STATE.ordinal()][LdapCodecConstants.EXTENDED_REQUEST_NAME_TAG] =
1852            new GrammarTransition(
1853                LdapStatesEnum.EXTENDED_REQUEST_STATE,
1854                LdapStatesEnum.REQUEST_NAME_STATE,
1855                LdapCodecConstants.EXTENDED_REQUEST_NAME_TAG,
1856                new StoreExtendedRequestName() );
1857
1858        // --------------------------------------------------------------------------------------------
1859        // Transition from RequestName to RequestValue
1860        // --------------------------------------------------------------------------------------------
1861        // ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
1862        //     ...
1863        //     requestValue  [1] OCTET STRING OPTIONAL }
1864        //
1865        // Stores the value
1866        super.transitions[LdapStatesEnum.REQUEST_NAME_STATE.ordinal()][LdapCodecConstants.EXTENDED_REQUEST_VALUE_TAG] =
1867            new GrammarTransition(
1868                LdapStatesEnum.REQUEST_NAME_STATE,
1869                LdapStatesEnum.REQUEST_VALUE_STATE,
1870                LdapCodecConstants.EXTENDED_REQUEST_VALUE_TAG,
1871                new StoreExtendedRequestValue() );
1872
1873        // --------------------------------------------------------------------------------------------
1874        // Transition from RequestName to Controls
1875        // --------------------------------------------------------------------------------------------
1876        //         extendedRequest   EtendedRequest,
1877        //         ... },
1878        //     controls       [0] Controls OPTIONAL }
1879        //
1880        // Stores the value
1881        super.transitions[LdapStatesEnum.REQUEST_NAME_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1882            new GrammarTransition(
1883                LdapStatesEnum.REQUEST_NAME_STATE,
1884                LdapStatesEnum.CONTROLS_STATE,
1885                LdapCodecConstants.CONTROLS_TAG,
1886                new InitControls() );
1887
1888        // --------------------------------------------------------------------------------------------
1889        // Transition from RequestValue to Controls
1890        // --------------------------------------------------------------------------------------------
1891        //         extendedRequest   EtendedRequest,
1892        //         ... },
1893        //     controls       [0] Controls OPTIONAL }
1894        //
1895        // Stores the value
1896        super.transitions[LdapStatesEnum.REQUEST_VALUE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
1897            new GrammarTransition(
1898                LdapStatesEnum.REQUEST_VALUE_STATE,
1899                LdapStatesEnum.CONTROLS_STATE,
1900                LdapCodecConstants.CONTROLS_TAG,
1901                new InitControls() );
1902
1903        // --------------------------------------------------------------------------------------------
1904        // Transition from MessageId to ExtendedResponse Message.
1905        // --------------------------------------------------------------------------------------------
1906        // LdapMessage ::= ... ExtendedResponse ...
1907        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1908        //
1909        // Creates the ExtendeResponse object
1910        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_TAG] =
1911            new GrammarTransition(
1912                LdapStatesEnum.MESSAGE_ID_STATE,
1913                LdapStatesEnum.EXTENDED_RESPONSE_STATE,
1914                LdapCodecConstants.EXTENDED_RESPONSE_TAG,
1915                new InitExtendedResponse() );
1916
1917        // --------------------------------------------------------------------------------------------
1918        // Transition from ExtendedResponse Message to Result Code ER
1919        // --------------------------------------------------------------------------------------------
1920        // LdapMessage ::= ... ExtendedResponse ...
1921        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1922        //     COMPONENTS OF LDAPResult,
1923        //     ...
1924        //
1925        // Stores the result code
1926        super.transitions[LdapStatesEnum.EXTENDED_RESPONSE_STATE.ordinal()][ENUMERATED.getValue()] =
1927            new GrammarTransition(
1928                LdapStatesEnum.EXTENDED_RESPONSE_STATE,
1929                LdapStatesEnum.RESULT_CODE_ER_STATE,
1930                ENUMERATED,
1931                new StoreResultCode() );
1932
1933        // --------------------------------------------------------------------------------------------
1934        // Transition from Result Code ER to Matched Dn ER
1935        // --------------------------------------------------------------------------------------------
1936        // LdapMessage ::= ... ExtendedResponse ...
1937        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1938        //     COMPONENTS OF LDAPResult,
1939        //     ...
1940        //
1941        //
1942        super.transitions[LdapStatesEnum.RESULT_CODE_ER_STATE.ordinal()][OCTET_STRING.getValue()] =
1943            new GrammarTransition(
1944                LdapStatesEnum.RESULT_CODE_ER_STATE,
1945                LdapStatesEnum.MATCHED_DN_ER_STATE,
1946                OCTET_STRING,
1947                new StoreMatchedDN() );
1948
1949        // --------------------------------------------------------------------------------------------
1950        // Transition from Matched Dn ER to Error Message ER
1951        // --------------------------------------------------------------------------------------------
1952        // LdapMessage ::= ... ExtendedResponse ...
1953        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1954        //     COMPONENTS OF LDAPResult,
1955        //     ...
1956        //
1957        //
1958        super.transitions[LdapStatesEnum.MATCHED_DN_ER_STATE.ordinal()][OCTET_STRING.getValue()] =
1959            new GrammarTransition(
1960                LdapStatesEnum.MATCHED_DN_ER_STATE,
1961                LdapStatesEnum.ERROR_MESSAGE_ER_STATE,
1962                OCTET_STRING,
1963                new StoreErrorMessage() );
1964
1965        // --------------------------------------------------------------------------------------------
1966        // Transition from Error Message ER to Referrals ER
1967        // --------------------------------------------------------------------------------------------
1968        // LdapMessage ::= ... ExtendedResponse ...
1969        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
1970        //     COMPONENTS OF LDAPResult,
1971        //     ...
1972        //
1973        //
1974        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE.ordinal()][LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG] =
1975            new GrammarTransition(
1976                LdapStatesEnum.ERROR_MESSAGE_ER_STATE,
1977                LdapStatesEnum.REFERRALS_ER_STATE,
1978                LdapCodecConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
1979                new InitReferrals() );
1980
1981        // --------------------------------------------------------------------------------------------
1982        // Transition from Referrals ER to Referral ER
1983        // --------------------------------------------------------------------------------------------
1984        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
1985        // URI ::= LDAPString
1986        //
1987        // Add a first Referral
1988        super.transitions[LdapStatesEnum.REFERRALS_ER_STATE.ordinal()][OCTET_STRING.getValue()] =
1989            new GrammarTransition(
1990                LdapStatesEnum.REFERRALS_ER_STATE,
1991                LdapStatesEnum.REFERRAL_ER_STATE,
1992                OCTET_STRING,
1993                new AddReferral() );
1994
1995        // --------------------------------------------------------------------------------------------
1996        // Transition from Referral ER to Referral ER
1997        // --------------------------------------------------------------------------------------------
1998        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
1999        // URI ::= LDAPString
2000        //
2001        // Adda new Referral
2002        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE.ordinal()][OCTET_STRING.getValue()] =
2003            new GrammarTransition(
2004                LdapStatesEnum.REFERRAL_ER_STATE,
2005                LdapStatesEnum.REFERRAL_ER_STATE,
2006                OCTET_STRING,
2007                new AddReferral() );
2008
2009        // --------------------------------------------------------------------------------------------
2010        // Transition from Referral ER to ResponseName
2011        // --------------------------------------------------------------------------------------------
2012        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
2013        // URI ::= LDAPString
2014        //
2015        // Adda new Referral
2016        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] =
2017            new GrammarTransition(
2018                LdapStatesEnum.REFERRAL_ER_STATE,
2019                LdapStatesEnum.RESPONSE_NAME_STATE,
2020                LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG,
2021                new StoreExtendedResponseName() );
2022
2023        // --------------------------------------------------------------------------------------------
2024        // Transition from Referral ER to Response
2025        // --------------------------------------------------------------------------------------------
2026        // Referral ::= SEQUENCE SIZE (1..MAX) OF uri URI (RFC 4511)
2027        // URI ::= LDAPString
2028        //
2029        // Add a new Referral
2030        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG] =
2031            new GrammarTransition(
2032                LdapStatesEnum.REFERRAL_ER_STATE,
2033                LdapStatesEnum.RESPONSE_STATE,
2034                LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG,
2035                new StoreExtendedResponseValue() );
2036
2037        // --------------------------------------------------------------------------------------------
2038        // Transition from Referral ER to Controls
2039        // --------------------------------------------------------------------------------------------
2040        //         extendedResponse   ExtendedResponse,
2041        //         ... },
2042        //     controls       [0] Controls OPTIONAL }
2043        //
2044        // Adda new Referral
2045        super.transitions[LdapStatesEnum.REFERRAL_ER_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2046            new GrammarTransition(
2047                LdapStatesEnum.REFERRAL_ER_STATE,
2048                LdapStatesEnum.CONTROLS_STATE,
2049                LdapCodecConstants.CONTROLS_TAG,
2050                new InitControls() );
2051
2052        // --------------------------------------------------------------------------------------------
2053        // Transition from Error Message ER to Controls
2054        // --------------------------------------------------------------------------------------------
2055        // LdapMessage ::= ... ExtendedResponse ...
2056        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
2057        //     COMPONENTS OF LDAPResult,
2058        //     ...
2059        //
2060        //
2061        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2062            new GrammarTransition(
2063                LdapStatesEnum.ERROR_MESSAGE_ER_STATE,
2064                LdapStatesEnum.CONTROLS_STATE,
2065                LdapCodecConstants.CONTROLS_TAG,
2066                new InitControls() );
2067
2068        // --------------------------------------------------------------------------------------------
2069        // Transition from Error Message ER to ResponseName
2070        // --------------------------------------------------------------------------------------------
2071        // LdapMessage ::= ... ExtendedResponse ...
2072        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
2073        //     COMPONENTS OF LDAPResult,
2074        //     responseName   [10] LDAPOID OPTIONAL,
2075        //     ...
2076        //
2077        // Stores the response name
2078        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG] =
2079            new GrammarTransition(
2080                LdapStatesEnum.ERROR_MESSAGE_ER_STATE,
2081                LdapStatesEnum.RESPONSE_NAME_STATE,
2082                LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_NAME_TAG,
2083                new StoreExtendedResponseName() );
2084
2085        // --------------------------------------------------------------------------------------------
2086        // Transition from Response Name to Response
2087        // --------------------------------------------------------------------------------------------
2088        // LdapMessage ::= ... ExtendedResponse ...
2089        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
2090        //     ...
2091        //     responseName   [10] LDAPOID OPTIONAL,
2092        //     response       [11] OCTET STRING OPTIONAL}
2093        //
2094        // Stores the response
2095        super.transitions[LdapStatesEnum.RESPONSE_NAME_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG] =
2096            new GrammarTransition(
2097                LdapStatesEnum.RESPONSE_NAME_STATE,
2098                LdapStatesEnum.RESPONSE_STATE,
2099                LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG,
2100                new StoreExtendedResponseValue() );
2101
2102        // --------------------------------------------------------------------------------------------
2103        // Transition from ResponseName to Controls
2104        // --------------------------------------------------------------------------------------------
2105        //         extendedRequest   EtendedRequest,
2106        //         ... },
2107        //     controls       [0] Controls OPTIONAL }
2108        //
2109        // Init the controls
2110        super.transitions[LdapStatesEnum.RESPONSE_NAME_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2111            new GrammarTransition(
2112                LdapStatesEnum.RESPONSE_NAME_STATE,
2113                LdapStatesEnum.CONTROLS_STATE,
2114                LdapCodecConstants.CONTROLS_TAG,
2115                new InitControls() );
2116
2117        // --------------------------------------------------------------------------------------------
2118        // Transition from Error Message ER to Response
2119        // --------------------------------------------------------------------------------------------
2120        // LdapMessage ::= ... ExtendedResponse ...
2121        // ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
2122        //     COMPONENTS OF LDAPResult,
2123        //     ...
2124        //     response       [11] OCTET STRING OPTIONAL}
2125        //
2126        // Stores the response
2127        super.transitions[LdapStatesEnum.ERROR_MESSAGE_ER_STATE.ordinal()][LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG] =
2128            new GrammarTransition(
2129                LdapStatesEnum.ERROR_MESSAGE_ER_STATE,
2130                LdapStatesEnum.RESPONSE_STATE,
2131                LdapCodecConstants.EXTENDED_RESPONSE_RESPONSE_TAG,
2132                new StoreExtendedResponseValue() );
2133
2134        // --------------------------------------------------------------------------------------------
2135        // Transition from Response to Controls
2136        // --------------------------------------------------------------------------------------------
2137        //         extendedRequest   EtendedRequest,
2138        //         ... },
2139        //     controls       [0] Controls OPTIONAL }
2140        //
2141        // Init the controls
2142        super.transitions[LdapStatesEnum.RESPONSE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2143            new GrammarTransition(
2144                LdapStatesEnum.RESPONSE_STATE,
2145                LdapStatesEnum.CONTROLS_STATE,
2146                LdapCodecConstants.CONTROLS_TAG,
2147                new InitControls() );
2148
2149        // --------------------------------------------------------------------------------------------
2150        // Transition from Message Id to IntermediateResponse Message
2151        // --------------------------------------------------------------------------------------------
2152        // LdapMessage ::= ... IntermediateResponse ...
2153        // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
2154        //
2155        // Creates the IntermediateResponse object
2156        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.INTERMEDIATE_RESPONSE_TAG] =
2157            new GrammarTransition(
2158                LdapStatesEnum.MESSAGE_ID_STATE,
2159                LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE,
2160                LdapCodecConstants.INTERMEDIATE_RESPONSE_TAG,
2161                new InitIntermediateResponse() );
2162
2163        // --------------------------------------------------------------------------------------------
2164        // Transition from IntermediateResponse Message to ResponseName
2165        // --------------------------------------------------------------------------------------------
2166        // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
2167        //     responseName [0] LDAPOID OPTIONAL,
2168        //     ...
2169        //
2170        // Stores the name
2171        super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE.ordinal()][LdapCodecConstants.INTERMEDIATE_RESPONSE_NAME_TAG] =
2172            new GrammarTransition(
2173                LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE,
2174                LdapStatesEnum.INTERMEDIATE_RESPONSE_NAME_STATE,
2175                LdapCodecConstants.INTERMEDIATE_RESPONSE_NAME_TAG,
2176                new StoreIntermediateResponseName() );
2177
2178        // --------------------------------------------------------------------------------------------
2179        // Transition from IntermediateResponse Message to ResponseValue (ResponseName is null)
2180        // --------------------------------------------------------------------------------------------
2181        // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
2182        //     ...
2183        //     responseValue [1] OCTET STRING OPTIONAL
2184        //     }
2185        //
2186        // Stores the value
2187        super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE.ordinal()][LdapCodecConstants.INTERMEDIATE_RESPONSE_VALUE_TAG] =
2188            new GrammarTransition(
2189                LdapStatesEnum.INTERMEDIATE_RESPONSE_STATE,
2190                LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE,
2191                LdapCodecConstants.INTERMEDIATE_RESPONSE_VALUE_TAG,
2192                new StoreIntermediateResponseValue() );
2193
2194        // --------------------------------------------------------------------------------------------
2195        // Transition from ResponseName to ResponseValue
2196        // --------------------------------------------------------------------------------------------
2197        // IntermediateResponse ::= [APPLICATION 25] SEQUENCE {
2198        //     ...
2199        //     responseValue  [1] OCTET STRING OPTIONAL }
2200        //
2201        // Stores the value
2202        super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_NAME_STATE.ordinal()][LdapCodecConstants.INTERMEDIATE_RESPONSE_VALUE_TAG] =
2203            new GrammarTransition(
2204                LdapStatesEnum.INTERMEDIATE_RESPONSE_NAME_STATE,
2205                LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE,
2206                LdapCodecConstants.INTERMEDIATE_RESPONSE_VALUE_TAG,
2207                new StoreIntermediateResponseValue() );
2208
2209        // --------------------------------------------------------------------------------------------
2210        // Transition from ResponseName to Controls
2211        // --------------------------------------------------------------------------------------------
2212        //         intermediateResponse   IntermediateResponse,
2213        //         ... },
2214        //     controls       [0] Controls OPTIONAL }
2215        //
2216        // Stores the value
2217        super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_NAME_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2218            new GrammarTransition(
2219                LdapStatesEnum.INTERMEDIATE_RESPONSE_NAME_STATE,
2220                LdapStatesEnum.CONTROLS_STATE,
2221                LdapCodecConstants.CONTROLS_TAG,
2222                new InitControls() );
2223
2224        // --------------------------------------------------------------------------------------------
2225        // Transition from ResponseValue to Controls
2226        // --------------------------------------------------------------------------------------------
2227        //         intermediateResponse   IntermediateResponse,
2228        //         ... },
2229        //     controls       [0] Controls OPTIONAL }
2230        //
2231        // Stores the value
2232        super.transitions[LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
2233            new GrammarTransition(
2234                LdapStatesEnum.INTERMEDIATE_RESPONSE_VALUE_STATE,
2235                LdapStatesEnum.CONTROLS_STATE,
2236                LdapCodecConstants.CONTROLS_TAG,
2237                new InitControls() );
2238
2239        // ============================================================================================
2240        // Transition from Controls to Control
2241        // ============================================================================================
2242        // ...
2243        // Controls ::= SEQUENCE OF Control
2244        //  ...
2245        //
2246        // Initialize the controls
2247        super.transitions[LdapStatesEnum.CONTROLS_STATE.ordinal()][SEQUENCE.getValue()] =
2248            new GrammarTransition(
2249                LdapStatesEnum.CONTROLS_STATE,
2250                LdapStatesEnum.CONTROL_STATE,
2251                SEQUENCE,
2252                new CheckLengthNotNull() );
2253
2254        // ============================================================================================
2255        // Transition from Control to ControlType
2256        // ============================================================================================
2257        // Control ::= SEQUENCE {
2258        //     ...
2259        //
2260        // Create a new Control object, and store it in the message Container
2261        super.transitions[LdapStatesEnum.CONTROL_STATE.ordinal()][OCTET_STRING.getValue()] =
2262            new GrammarTransition(
2263                LdapStatesEnum.CONTROL_STATE,
2264                LdapStatesEnum.CONTROL_TYPE_STATE,
2265                OCTET_STRING,
2266                new AddControl() );
2267
2268        // ============================================================================================
2269        // Transition from ControlType to Control Criticality
2270        // ============================================================================================
2271        // Control ::= SEQUENCE {
2272        //     ...
2273        //     criticality BOOLEAN DEFAULT FALSE,
2274        //     ...
2275        //
2276        // Store the value in the control object created before
2277        super.transitions[LdapStatesEnum.CONTROL_TYPE_STATE.ordinal()][BOOLEAN.getValue()] =
2278            new GrammarTransition(
2279                LdapStatesEnum.CONTROL_TYPE_STATE,
2280                LdapStatesEnum.CRITICALITY_STATE,
2281                OCTET_STRING,
2282                new StoreControlCriticality() );
2283
2284        // ============================================================================================
2285        // Transition from Control Criticality to Control Value
2286        // ============================================================================================
2287        // Control ::= SEQUENCE {
2288        //     ...
2289        //     controlValue OCTET STRING OPTIONAL }
2290        //
2291        // Store the value in the control object created before
2292        super.transitions[LdapStatesEnum.CRITICALITY_STATE.ordinal()][OCTET_STRING.getValue()] =
2293            new GrammarTransition(
2294                LdapStatesEnum.CRITICALITY_STATE,
2295                LdapStatesEnum.CONTROL_VALUE_STATE,
2296                OCTET_STRING,
2297                new StoreControlValue() );
2298
2299        // ============================================================================================
2300        // Transition from Control Type to Control Value
2301        // ============================================================================================
2302        // Control ::= SEQUENCE {
2303        //     ...
2304        //     controlValue OCTET STRING OPTIONAL }
2305        //
2306        // Store the value in the control object created before
2307        super.transitions[LdapStatesEnum.CONTROL_TYPE_STATE.ordinal()][OCTET_STRING.getValue()] =
2308            new GrammarTransition(
2309                LdapStatesEnum.CONTROL_TYPE_STATE,
2310                LdapStatesEnum.CONTROL_VALUE_STATE,
2311                OCTET_STRING,
2312                new StoreControlValue() );
2313
2314        // ============================================================================================
2315        // Transition from Control Type to Control
2316        // ============================================================================================
2317        // Control ::= SEQUENCE {
2318        //     ...
2319        //     controlValue OCTET STRING OPTIONAL }
2320        //
2321        // Store the value in the control object created before
2322        super.transitions[LdapStatesEnum.CONTROL_TYPE_STATE.ordinal()][SEQUENCE.getValue()] =
2323            new GrammarTransition(
2324                LdapStatesEnum.CONTROL_TYPE_STATE,
2325                LdapStatesEnum.CONTROL_STATE,
2326                SEQUENCE,
2327                new CheckLengthNotNull() );
2328
2329        // ============================================================================================
2330        // Transition from Control Criticality to Control
2331        // ============================================================================================
2332        // Control ::= SEQUENCE {
2333        //     ...
2334        //     controlValue OCTET STRING OPTIONAL }
2335        //
2336        // Store the value in the control object created before
2337        super.transitions[LdapStatesEnum.CRITICALITY_STATE.ordinal()][SEQUENCE.getValue()] =
2338            new GrammarTransition(
2339                LdapStatesEnum.CRITICALITY_STATE,
2340                LdapStatesEnum.CONTROL_STATE,
2341                SEQUENCE,
2342                new CheckLengthNotNull() );
2343
2344        // ============================================================================================
2345        // Transition from Control Value to Control
2346        // ============================================================================================
2347        // Control ::= SEQUENCE {
2348        //     ...
2349        //     controlValue OCTET STRING OPTIONAL }
2350        //
2351        // Store the value in the control object created before
2352        super.transitions[LdapStatesEnum.CONTROL_VALUE_STATE.ordinal()][SEQUENCE.getValue()] =
2353            new GrammarTransition(
2354                LdapStatesEnum.CONTROL_VALUE_STATE,
2355                LdapStatesEnum.CONTROL_STATE,
2356                SEQUENCE,
2357                new CheckLengthNotNull() );
2358
2359        // --------------------------------------------------------------------------------------------
2360        // Transition from message ID to SearchRequest Message
2361        // --------------------------------------------------------------------------------------------
2362        // LdapMessage ::= ... SearchRequest ...
2363        // SearchRequest ::= [APPLICATION 3] SEQUENCE { ...
2364        //
2365        // Initialize the searchRequest object
2366        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapCodecConstants.SEARCH_REQUEST_TAG] =
2367            new GrammarTransition(
2368                LdapStatesEnum.MESSAGE_ID_STATE,
2369                LdapStatesEnum.SEARCH_REQUEST_STATE,
2370                LdapCodecConstants.SEARCH_REQUEST_TAG,
2371                new InitSearchRequest() );
2372
2373        // --------------------------------------------------------------------------------------------
2374        // Transition from SearchRequest Message to BaseObject
2375        // --------------------------------------------------------------------------------------------
2376        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2377        //     baseObject LDAPDN,
2378        //     ...
2379        //
2380        // We have a value for the base object, we will store it in the message
2381        super.transitions[LdapStatesEnum.SEARCH_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
2382            new GrammarTransition(
2383                LdapStatesEnum.SEARCH_REQUEST_STATE,
2384                LdapStatesEnum.BASE_OBJECT_STATE,
2385                OCTET_STRING,
2386                new StoreSearchRequestBaseObject() );
2387
2388        // --------------------------------------------------------------------------------------------
2389        // Transition from BaseObject to Scope
2390        // --------------------------------------------------------------------------------------------
2391        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2392        //     ...
2393        //     scope ENUMERATED {
2394        //         baseObject   (0),
2395        //         singleLevel  (1),
2396        //         wholeSubtree (2) },
2397        //     ...
2398        //
2399        // We have a value for the scope, we will store it in the message
2400        super.transitions[LdapStatesEnum.BASE_OBJECT_STATE.ordinal()][ENUMERATED.getValue()] =
2401            new GrammarTransition(
2402                LdapStatesEnum.BASE_OBJECT_STATE,
2403                LdapStatesEnum.SCOPE_STATE,
2404                ENUMERATED,
2405                new StoreSearchRequestScope() );
2406
2407        // --------------------------------------------------------------------------------------------
2408        // Transition from Scope to DerefAlias
2409        // --------------------------------------------------------------------------------------------
2410        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2411        //     ...
2412        //     derefAliases ENUMERATED {
2413        //         neverDerefAliases   (0),
2414        //         derefInSearching    (1),
2415        //         derefFindingBaseObj (2),
2416        //         derefAlways         (3) },
2417        //     ...
2418        //
2419        // We have a value for the derefAliases, we will store it in the message
2420        super.transitions[LdapStatesEnum.SCOPE_STATE.ordinal()][ENUMERATED.getValue()] =
2421            new GrammarTransition(
2422                LdapStatesEnum.SCOPE_STATE,
2423                LdapStatesEnum.DEREF_ALIAS_STATE,
2424                ENUMERATED,
2425                new StoreSearchRequestDerefAlias() );
2426
2427        // --------------------------------------------------------------------------------------------
2428        // Transition from DerefAlias to SizeLimit
2429        // --------------------------------------------------------------------------------------------
2430        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2431        //     ...
2432        //     sizeLimit INTEGER (0 .. maxInt),
2433        //     ...
2434        //
2435        // We have a value for the sizeLimit, we will store it in the message
2436        super.transitions[LdapStatesEnum.DEREF_ALIAS_STATE.ordinal()][INTEGER.getValue()] = new
2437            GrammarTransition(
2438                LdapStatesEnum.DEREF_ALIAS_STATE,
2439                LdapStatesEnum.SIZE_LIMIT_STATE,
2440                INTEGER,
2441                new StoreSearchRequestSizeLimit() );
2442
2443        // --------------------------------------------------------------------------------------------
2444        // Transition from SizeLimit to TimeLimit
2445        // --------------------------------------------------------------------------------------------
2446        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2447        //     ...
2448        //     timeLimit INTEGER (0 .. maxInt),
2449        //     ...
2450        //
2451        // We have a value for the timeLimit, we will store it in the message
2452        super.transitions[LdapStatesEnum.SIZE_LIMIT_STATE.ordinal()][INTEGER.getValue()] =
2453            new GrammarTransition(
2454                LdapStatesEnum.SIZE_LIMIT_STATE,
2455                LdapStatesEnum.TIME_LIMIT_STATE,
2456                INTEGER,
2457                new StoreSearchRequestTimeLimit() );
2458
2459        // --------------------------------------------------------------------------------------------
2460        // Transition from TimeLimit to TypesOnly
2461        // --------------------------------------------------------------------------------------------
2462        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2463        //     ...
2464        //     typesOnly BOOLEAN,
2465        //     ...
2466        //
2467        // We have a value for the typesOnly, we will store it in the message.
2468        super.transitions[LdapStatesEnum.TIME_LIMIT_STATE.ordinal()][BOOLEAN.getValue()] =
2469            new GrammarTransition(
2470                LdapStatesEnum.TIME_LIMIT_STATE,
2471                LdapStatesEnum.TYPES_ONLY_STATE,
2472                BOOLEAN,
2473                new StoreSearchRequestTypesOnly() );
2474
2475        //============================================================================================
2476        // Search Request And Filter
2477        // This is quite complicated, because we have a tree structure to build,
2478        // and we may have many elements on each node. For instance, considering the
2479        // search filter :
2480        // (& (| (a = b) (c = d)) (! (e = f)) (attr =* h))
2481        // We will have to create an And filter with three children :
2482        //  - an Or child,
2483        //  - a Not child
2484        //  - and a Present child.
2485        // The Or child will also have two children.
2486        //
2487        // We know when we have a children while decoding the PDU, because the length
2488        // of its parent has not yet reached its expected length.
2489        //
2490        // This search filter :
2491        // (&(|(objectclass=top)(ou=contacts))(!(objectclass=ttt))(objectclass=*top))
2492        // is encoded like this :
2493        //                              +----------------+---------------+
2494        //                              | ExpectedLength | CurrentLength |
2495        //+-----------------------------+----------------+---------------+
2496        //|A0 52                        | 82             | 0             | new level 1
2497        //|   A1 24                     | 82 36          | 0 0           | new level 2
2498        //|      A3 12                  | 82 36 18       | 0 0 0         | new level 3
2499        //|         04 0B 'objectclass' | 82 36 18       | 0 0 13        |
2500        //|         04 03 'top'         | 82 36 18       | 0 20 18       |
2501        //|                             |       ^               ^        |
2502        //|                             |       |               |        |
2503        //|                             |       +---------------+        |
2504        //+-----------------------------* end level 3 -------------------*
2505        //|      A3 0E                  | 82 36 14       | 0 0 0         | new level 3
2506        //|         04 02 'ou'          | 82 36 14       | 0 0 4         |
2507        //|         04 08 'contacts'    | 82 36 14       | 38 36 14      |
2508        //|                             |    ^  ^             ^  ^       |
2509        //|                             |    |  |             |  |       |
2510        //|                             |    |  +-------------|--+       |
2511        //|                             |    +----------------+          |
2512        //+-----------------------------* end level 3, end level 2 ------*
2513        //|   A2 14                     | 82 20          | 38 0          | new level 2
2514        //|      A3 12                  | 82 20 18       | 38 0 0        | new level 3
2515        //|         04 0B 'objectclass' | 82 20 18       | 38 0 13       |
2516        //|         04 03 'ttt'         | 82 20 18       | 60 20 18      |
2517        //|                             |    ^  ^             ^  ^       |
2518        //|                             |    |  |             |  |       |
2519        //|                             |    |  +-------------|--+       |
2520        //|                             |    +----------------+          |
2521        //+-----------------------------* end level 3, end level 2 ------*
2522        //|   A4 14                     | 82 20          | 60 0          | new level 2
2523        //|      04 0B 'objectclass'    | 82 20          | 60 13         |
2524        //|      30 05                  | 82 20          | 60 13         |
2525        //|         82 03 'top'         | 82 20          | 82 20         |
2526        //|                             | ^  ^             ^  ^          |
2527        //|                             | |  |             |  |          |
2528        //|                             | |  +-------------|--+          |
2529        //|                             | +----------------+             |
2530        //+-----------------------------* end level 2, end level 1 ------*
2531        //+-----------------------------+----------------+---------------+
2532        //
2533        // When the current length equals the expected length of the parent PDU,
2534        // then we are able to 'close' the parent : it has all its children. This
2535        // is propagated through all the tree, until either there are no more
2536        // parents, or the expected length of the parent is different from the
2537        // current length.
2538
2539        // --------------------------------------------------------------------------------------------
2540        // Transition from TypesOnly to AND filter
2541        // --------------------------------------------------------------------------------------------
2542        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2543        //     ...
2544        //     filter Filter,
2545        //     ...
2546        //
2547        // Filter ::= CHOICE {
2548        //     and             [0] SET OF Filter,
2549        //     ...
2550        //
2551        // Init AND filter
2552        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
2553            new GrammarTransition(
2554                LdapStatesEnum.TYPES_ONLY_STATE,
2555                LdapStatesEnum.AND_STATE,
2556                LdapCodecConstants.AND_FILTER_TAG,
2557                new InitAndFilter() );
2558
2559        // --------------------------------------------------------------------------------------------
2560        // Transition from TypesOnly to OR filter
2561        // --------------------------------------------------------------------------------------------
2562        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2563        //     ...
2564        //     filter Filter,
2565        //     ...
2566        //
2567        // Filter ::= CHOICE {
2568        //     ...
2569        //     or              [1] SET OF Filter,
2570        //     ...
2571        //
2572        // Init OR filter
2573        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
2574            new GrammarTransition(
2575                LdapStatesEnum.TYPES_ONLY_STATE,
2576                LdapStatesEnum.OR_STATE,
2577                LdapCodecConstants.OR_FILTER_TAG,
2578                new InitOrFilter() );
2579
2580        // --------------------------------------------------------------------------------------------
2581        // Transition from TypesOnly to NOT filter
2582        // --------------------------------------------------------------------------------------------
2583        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2584        //     ...
2585        //     filter Filter,
2586        //     ...
2587        //
2588        // Filter ::= CHOICE {
2589        //     ...
2590        //     not             [2] SET OF Filter,
2591        //     ...
2592        //
2593        // Init NOT filter
2594        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
2595            new GrammarTransition(
2596                LdapStatesEnum.TYPES_ONLY_STATE,
2597                LdapStatesEnum.NOT_STATE,
2598                LdapCodecConstants.NOT_FILTER_TAG,
2599                new InitNotFilter() );
2600
2601        // --------------------------------------------------------------------------------------------
2602        // Transition from TypesOnly to Equality Match filter
2603        // --------------------------------------------------------------------------------------------
2604        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2605        //     ...
2606        //     filter Filter,
2607        //     ...
2608        //
2609        // Filter ::= CHOICE {
2610        //     ...
2611        //     equalityMatch   [3] AttributeValueAssertion,
2612        //     ...
2613        //
2614        // Init Equality filter
2615        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
2616            new GrammarTransition(
2617                LdapStatesEnum.TYPES_ONLY_STATE,
2618                LdapStatesEnum.EQUALITY_MATCH_STATE,
2619                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
2620                new InitEqualityMatchFilter() );
2621
2622        // --------------------------------------------------------------------------------------------
2623        // Transition from TypesOnly to Substrings filter
2624        // --------------------------------------------------------------------------------------------
2625        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2626        //     ...
2627        //     filter Filter,
2628        //     ...
2629        //
2630        // Filter ::= CHOICE {
2631        //     ...
2632        //     substrings     [4] SubstringFilter,
2633        //     ...
2634        //
2635        // Init Substrings filter
2636        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
2637            new GrammarTransition(
2638                LdapStatesEnum.TYPES_ONLY_STATE,
2639                LdapStatesEnum.SUBSTRING_FILTER_STATE,
2640                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
2641                new InitSubstringsFilter() );
2642
2643        // --------------------------------------------------------------------------------------------
2644        // Transition from TypesOnly to GreaterOrEqual filter
2645        // --------------------------------------------------------------------------------------------
2646        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2647        //     ...
2648        //     filter Filter,
2649        //     ...
2650        //
2651        // Filter ::= CHOICE {
2652        //     ...
2653        //     greaterOrEqual  [5] AttributeValueAssertion,
2654        //     ...
2655        //
2656        // Init Greater Or Equal filter
2657        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
2658            new GrammarTransition(
2659                LdapStatesEnum.TYPES_ONLY_STATE,
2660                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
2661                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
2662                new InitGreaterOrEqualFilter() );
2663
2664        // --------------------------------------------------------------------------------------------
2665        // Transition from TypesOnly to LessOrEqual filter
2666        // --------------------------------------------------------------------------------------------
2667        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2668        //     ...
2669        //     filter Filter,
2670        //     ...
2671        //
2672        // Filter ::= CHOICE {
2673        //     ...
2674        //     LessOrEqual    [6] AttributeValueAssertion,
2675        //     ...
2676        //
2677        // Init Less Or Equal filter
2678        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
2679            new GrammarTransition(
2680                LdapStatesEnum.TYPES_ONLY_STATE,
2681                LdapStatesEnum.LESS_OR_EQUAL_STATE,
2682                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
2683                new InitLessOrEqualFilter() );
2684
2685        // --------------------------------------------------------------------------------------------
2686        // Transition from TypesOnly to Present filter
2687        // --------------------------------------------------------------------------------------------
2688        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2689        //     ...
2690        //     filter Filter,
2691        //     ...
2692        //
2693        // Filter ::= CHOICE {
2694        //     ...
2695        //     present        [7] AttributeDescription,
2696        //     ...
2697        //
2698        // Init Present Match filter
2699        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
2700            new GrammarTransition(
2701                LdapStatesEnum.TYPES_ONLY_STATE,
2702                LdapStatesEnum.PRESENT_STATE,
2703                LdapCodecConstants.PRESENT_FILTER_TAG,
2704                new InitPresentFilter() );
2705
2706        // --------------------------------------------------------------------------------------------
2707        // Transition from TypesOnly to Approx Match filter
2708        // --------------------------------------------------------------------------------------------
2709        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2710        //     ...
2711        //     filter Filter,
2712        //     ...
2713        //
2714        // Filter ::= CHOICE {
2715        //     ...
2716        //     approxMatch     [8] AttributeValueAssertion,
2717        //     ...
2718        //
2719        // Init Approx Match filter
2720        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
2721            new GrammarTransition(
2722                LdapStatesEnum.TYPES_ONLY_STATE,
2723                LdapStatesEnum.APPROX_MATCH_STATE,
2724                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
2725                new InitApproxMatchFilter() );
2726
2727        // --------------------------------------------------------------------------------------------
2728        // Transition from TypesOnly to Extensible Match filter
2729        // --------------------------------------------------------------------------------------------
2730        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2731        //     ...
2732        //     filter Filter,
2733        //     ...
2734        //
2735        // Filter ::= CHOICE {
2736        //     ...
2737        //     extensibleMatch  [9] MatchingRuleAssertion,
2738        //     ...
2739        //
2740        // Init Extensible Match filter
2741        super.transitions[LdapStatesEnum.TYPES_ONLY_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
2742            new GrammarTransition(
2743                LdapStatesEnum.TYPES_ONLY_STATE,
2744                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
2745                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
2746                new InitExtensibleMatchFilter() );
2747
2748        // --------------------------------------------------------------------------------------------
2749        // Transition from AND to AND filter
2750        // --------------------------------------------------------------------------------------------
2751        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2752        //     ...
2753        //     filter Filter,
2754        //     ...
2755        //
2756        // Filter ::= CHOICE {
2757        //     and             [0] SET OF Filter,
2758        //     ...
2759        //
2760        // Init AND filter
2761        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
2762            new GrammarTransition(
2763                LdapStatesEnum.AND_STATE,
2764                LdapStatesEnum.AND_STATE,
2765                LdapCodecConstants.AND_FILTER_TAG,
2766                new InitAndFilter() );
2767
2768        // --------------------------------------------------------------------------------------------
2769        // Transition from AND to OR filter
2770        // --------------------------------------------------------------------------------------------
2771        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2772        //     ...
2773        //     filter Filter,
2774        //     ...
2775        //
2776        // Filter ::= CHOICE {
2777        //     ...
2778        //     or              [1] SET OF Filter,
2779        //     ...
2780        //
2781        // Init OR filter
2782        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
2783            new GrammarTransition(
2784                LdapStatesEnum.AND_STATE,
2785                LdapStatesEnum.OR_STATE,
2786                LdapCodecConstants.OR_FILTER_TAG,
2787                new InitOrFilter() );
2788
2789        // --------------------------------------------------------------------------------------------
2790        // Transition from AND to NOT filter
2791        // --------------------------------------------------------------------------------------------
2792        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2793        //     ...
2794        //     filter Filter,
2795        //     ...
2796        //
2797        // Filter ::= CHOICE {
2798        //     ...
2799        //     not             [2] SET OF Filter,
2800        //     ...
2801        //
2802        // Init NOT filter
2803        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
2804            new GrammarTransition(
2805                LdapStatesEnum.AND_STATE,
2806                LdapStatesEnum.NOT_STATE,
2807                LdapCodecConstants.NOT_FILTER_TAG,
2808                new InitNotFilter() );
2809
2810        // --------------------------------------------------------------------------------------------
2811        // Transition from AND to Equality Match filter
2812        // --------------------------------------------------------------------------------------------
2813        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2814        //     ...
2815        //     filter Filter,
2816        //     ...
2817        //
2818        // Filter ::= CHOICE {
2819        //     ...
2820        //     equalityMatch   [3] AttributeValueAssertion,
2821        //     ...
2822        //
2823        // Init NOT filter
2824        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
2825            new GrammarTransition(
2826                LdapStatesEnum.AND_STATE,
2827                LdapStatesEnum.EQUALITY_MATCH_STATE,
2828                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
2829                new InitEqualityMatchFilter() );
2830
2831        // --------------------------------------------------------------------------------------------
2832        // Transition from AND to Substrings filter
2833        // --------------------------------------------------------------------------------------------
2834        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2835        //     ...
2836        //     filter Filter,
2837        //     ...
2838        //
2839        // Filter ::= CHOICE {
2840        //     ...
2841        //     substrings     [4] SubstringFilter,
2842        //     ...
2843        //
2844        // Init Substrings filter
2845        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
2846            new GrammarTransition(
2847                LdapStatesEnum.AND_STATE,
2848                LdapStatesEnum.SUBSTRING_FILTER_STATE,
2849                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
2850                new InitSubstringsFilter() );
2851
2852        // --------------------------------------------------------------------------------------------
2853        // Transition from AND to GreaterOrEqual filter
2854        // --------------------------------------------------------------------------------------------
2855        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2856        //     ...
2857        //     filter Filter,
2858        //     ...
2859        //
2860        // Filter ::= CHOICE {
2861        //     ...
2862        //     greaterOrEqual  [5] AttributeValueAssertion,
2863        //     ...
2864        //
2865        // Init Greater Or Equal filter
2866        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
2867            new GrammarTransition(
2868                LdapStatesEnum.AND_STATE,
2869                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
2870                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
2871                new InitGreaterOrEqualFilter() );
2872
2873        // --------------------------------------------------------------------------------------------
2874        // Transition from AND to LessOrEqual filter
2875        // --------------------------------------------------------------------------------------------
2876        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2877        //     ...
2878        //     filter Filter,
2879        //     ...
2880        //
2881        // Filter ::= CHOICE {
2882        //     ...
2883        //     LessOrEqual    [6] AttributeValueAssertion,
2884        //     ...
2885        //
2886        // Init Less Or Equal filter
2887        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
2888            new GrammarTransition(
2889                LdapStatesEnum.AND_STATE,
2890                LdapStatesEnum.LESS_OR_EQUAL_STATE,
2891                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
2892                new InitLessOrEqualFilter() );
2893
2894        // --------------------------------------------------------------------------------------------
2895        // Transition from AND to Present filter
2896        // --------------------------------------------------------------------------------------------
2897        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2898        //     ...
2899        //     filter Filter,
2900        //     ...
2901        //
2902        // Filter ::= CHOICE {
2903        //     ...
2904        //     present        [7] AttributeDescription,
2905        //     ...
2906        //
2907        // Init Approx Match filter
2908        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
2909            new GrammarTransition(
2910                LdapStatesEnum.AND_STATE,
2911                LdapStatesEnum.PRESENT_STATE,
2912                LdapCodecConstants.PRESENT_FILTER_TAG,
2913                new InitPresentFilter() );
2914
2915        // --------------------------------------------------------------------------------------------
2916        // Transition from AND to Approx Match filter
2917        // --------------------------------------------------------------------------------------------
2918        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2919        //     ...
2920        //     filter Filter,
2921        //     ...
2922        //
2923        // Filter ::= CHOICE {
2924        //     ...
2925        //     approxMatch     [8] AttributeValueAssertion,
2926        //     ...
2927        //
2928        // Init Approx Match filter
2929        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
2930            new GrammarTransition(
2931                LdapStatesEnum.AND_STATE,
2932                LdapStatesEnum.APPROX_MATCH_STATE,
2933                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
2934                new InitApproxMatchFilter() );
2935
2936        // --------------------------------------------------------------------------------------------
2937        // Transition from AND to Extensible Match filter
2938        // --------------------------------------------------------------------------------------------
2939        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2940        //     ...
2941        //     filter Filter,
2942        //     ...
2943        //
2944        // Filter ::= CHOICE {
2945        //     ...
2946        //     extensibleMatch  [9] MatchingRuleAssertion,
2947        //     ...
2948        //
2949        // Init Approx Match filter
2950        super.transitions[LdapStatesEnum.AND_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
2951            new GrammarTransition(
2952                LdapStatesEnum.AND_STATE,
2953                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
2954                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
2955                new InitExtensibleMatchFilter() );
2956
2957        // --------------------------------------------------------------------------------------------
2958        // Transition from OR to AND filter
2959        // --------------------------------------------------------------------------------------------
2960        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2961        //     ...
2962        //     filter Filter,
2963        //     ...
2964        //
2965        // Filter ::= CHOICE {
2966        //     and             [0] SET OF Filter,
2967        //     ...
2968        //
2969        // Init AND filter
2970        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
2971            new GrammarTransition(
2972                LdapStatesEnum.OR_STATE,
2973                LdapStatesEnum.AND_STATE,
2974                LdapCodecConstants.AND_FILTER_TAG,
2975                new InitAndFilter() );
2976
2977        // --------------------------------------------------------------------------------------------
2978        // Transition from OR to OR filter
2979        // --------------------------------------------------------------------------------------------
2980        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
2981        //     ...
2982        //     filter Filter,
2983        //     ...
2984        //
2985        // Filter ::= CHOICE {
2986        //     ...
2987        //     or              [1] SET OF Filter,
2988        //     ...
2989        //
2990        // Init OR filter
2991        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
2992            new GrammarTransition(
2993                LdapStatesEnum.OR_STATE,
2994                LdapStatesEnum.OR_STATE,
2995                LdapCodecConstants.OR_FILTER_TAG,
2996                new InitOrFilter() );
2997
2998        // --------------------------------------------------------------------------------------------
2999        // Transition from OR to NOT filter
3000        // --------------------------------------------------------------------------------------------
3001        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3002        //     ...
3003        //     filter Filter,
3004        //     ...
3005        //
3006        // Filter ::= CHOICE {
3007        //     ...
3008        //     not             [2] SET OF Filter,
3009        //     ...
3010        //
3011        // Init NOT filter
3012        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
3013            new GrammarTransition(
3014                LdapStatesEnum.OR_STATE,
3015                LdapStatesEnum.NOT_STATE,
3016                LdapCodecConstants.NOT_FILTER_TAG,
3017                new InitNotFilter() );
3018
3019        // --------------------------------------------------------------------------------------------
3020        // Transition from OR to Equality Match filter
3021        // --------------------------------------------------------------------------------------------
3022        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3023        //     ...
3024        //     filter Filter,
3025        //     ...
3026        //
3027        // Filter ::= CHOICE {
3028        //     ...
3029        //     equalityMatch   [3] AttributeValueAssertion,
3030        //     ...
3031        //
3032        // Init NOT filter
3033        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
3034            new GrammarTransition(
3035                LdapStatesEnum.OR_STATE,
3036                LdapStatesEnum.EQUALITY_MATCH_STATE,
3037                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
3038                new InitEqualityMatchFilter() );
3039
3040        // --------------------------------------------------------------------------------------------
3041        // Transition from OR to Substrings filter
3042        // --------------------------------------------------------------------------------------------
3043        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3044        //     ...
3045        //     filter Filter,
3046        //     ...
3047        //
3048        // Filter ::= CHOICE {
3049        //     ...
3050        //     substrings     [4] SubstringFilter,
3051        //     ...
3052        //
3053        // Init Substrings filter
3054        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
3055            new GrammarTransition(
3056                LdapStatesEnum.OR_STATE,
3057                LdapStatesEnum.SUBSTRING_FILTER_STATE,
3058                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
3059                new InitSubstringsFilter() );
3060
3061        // --------------------------------------------------------------------------------------------
3062        // Transition from OR to GreaterOrEqual filter
3063        // --------------------------------------------------------------------------------------------
3064        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3065        //     ...
3066        //     filter Filter,
3067        //     ...
3068        //
3069        // Filter ::= CHOICE {
3070        //     ...
3071        //     greaterOrEqual  [5] AttributeValueAssertion,
3072        //     ...
3073        //
3074        // Init Greater Or Equal filter
3075        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
3076            new GrammarTransition(
3077                LdapStatesEnum.OR_STATE,
3078                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
3079                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
3080                new InitGreaterOrEqualFilter() );
3081
3082        // --------------------------------------------------------------------------------------------
3083        // Transition from OR to LessOrEqual filter
3084        // --------------------------------------------------------------------------------------------
3085        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3086        //     ...
3087        //     filter Filter,
3088        //     ...
3089        //
3090        // Filter ::= CHOICE {
3091        //     ...
3092        //     LessOrEqual    [6] AttributeValueAssertion,
3093        //     ...
3094        //
3095        // Init Less Or Equal filter
3096        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
3097            new GrammarTransition(
3098                LdapStatesEnum.OR_STATE,
3099                LdapStatesEnum.LESS_OR_EQUAL_STATE,
3100                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
3101                new InitLessOrEqualFilter() );
3102
3103        // --------------------------------------------------------------------------------------------
3104        // Transition from OR to Present filter
3105        // --------------------------------------------------------------------------------------------
3106        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3107        //     ...
3108        //     filter Filter,
3109        //     ...
3110        //
3111        // Filter ::= CHOICE {
3112        //     ...
3113        //     present        [7] AttributeDescription,
3114        //     ...
3115        //
3116        // Init Approx Match filter
3117        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
3118            new GrammarTransition(
3119                LdapStatesEnum.OR_STATE,
3120                LdapStatesEnum.PRESENT_STATE,
3121                LdapCodecConstants.PRESENT_FILTER_TAG,
3122                new InitPresentFilter() );
3123
3124        // --------------------------------------------------------------------------------------------
3125        // Transition from OR to Approx Match filter
3126        // --------------------------------------------------------------------------------------------
3127        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3128        //     ...
3129        //     filter Filter,
3130        //     ...
3131        //
3132        // Filter ::= CHOICE {
3133        //     ...
3134        //     approxMatch     [8] AttributeValueAssertion,
3135        //     ...
3136        //
3137        // Init Approx Match filter
3138        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
3139            new GrammarTransition(
3140                LdapStatesEnum.OR_STATE,
3141                LdapStatesEnum.APPROX_MATCH_STATE,
3142                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
3143                new InitApproxMatchFilter() );
3144
3145        // --------------------------------------------------------------------------------------------
3146        // Transition from OR to Extensible Match filter
3147        // --------------------------------------------------------------------------------------------
3148        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3149        //     ...
3150        //     filter Filter,
3151        //     ...
3152        //
3153        // Filter ::= CHOICE {
3154        //     ...
3155        //     extensibleMatch  [9] MatchingRuleAssertion,
3156        //     ...
3157        //
3158        // Init Approx Match filter
3159        super.transitions[LdapStatesEnum.OR_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
3160            new GrammarTransition(
3161                LdapStatesEnum.OR_STATE,
3162                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
3163                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
3164                new InitExtensibleMatchFilter() );
3165
3166        // --------------------------------------------------------------------------------------------
3167        // Transition from NOT to AND filter
3168        // --------------------------------------------------------------------------------------------
3169        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3170        //     ...
3171        //     filter Filter,
3172        //     ...
3173        //
3174        // Filter ::= CHOICE {
3175        //     and             [0] SET OF Filter,
3176        //     ...
3177        //
3178        // Init AND filter
3179        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
3180            new GrammarTransition(
3181                LdapStatesEnum.NOT_STATE,
3182                LdapStatesEnum.AND_STATE,
3183                LdapCodecConstants.AND_FILTER_TAG,
3184                new InitAndFilter() );
3185
3186        // --------------------------------------------------------------------------------------------
3187        // Transition from NOT to OR filter
3188        // --------------------------------------------------------------------------------------------
3189        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3190        //     ...
3191        //     filter Filter,
3192        //     ...
3193        //
3194        // Filter ::= CHOICE {
3195        //     ...
3196        //     or              [1] SET OF Filter,
3197        //     ...
3198        //
3199        // Init OR filter
3200        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
3201            new GrammarTransition(
3202                LdapStatesEnum.NOT_STATE,
3203                LdapStatesEnum.OR_STATE,
3204                LdapCodecConstants.OR_FILTER_TAG,
3205                new InitOrFilter() );
3206
3207        // --------------------------------------------------------------------------------------------
3208        // Transition from NOT to NOT filter
3209        // --------------------------------------------------------------------------------------------
3210        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3211        //     ...
3212        //     filter Filter,
3213        //     ...
3214        //
3215        // Filter ::= CHOICE {
3216        //     ...
3217        //     not             [2] SET OF Filter,
3218        //     ...
3219        //
3220        // Init NOT filter
3221        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
3222            new GrammarTransition(
3223                LdapStatesEnum.NOT_STATE,
3224                LdapStatesEnum.NOT_STATE,
3225                LdapCodecConstants.NOT_FILTER_TAG,
3226                new InitNotFilter() );
3227
3228        // --------------------------------------------------------------------------------------------
3229        // Transition from NOT to Equality Match filter
3230        // --------------------------------------------------------------------------------------------
3231        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3232        //     ...
3233        //     filter Filter,
3234        //     ...
3235        //
3236        // Filter ::= CHOICE {
3237        //     ...
3238        //     equalityMatch   [3] AttributeValueAssertion,
3239        //     ...
3240        //
3241        // Init NOT filter
3242        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
3243            new GrammarTransition(
3244                LdapStatesEnum.NOT_STATE,
3245                LdapStatesEnum.EQUALITY_MATCH_STATE,
3246                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
3247                new InitEqualityMatchFilter() );
3248
3249        // --------------------------------------------------------------------------------------------
3250        // Transition from NOT to Substrings filter
3251        // --------------------------------------------------------------------------------------------
3252        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3253        //     ...
3254        //     filter Filter,
3255        //     ...
3256        //
3257        // Filter ::= CHOICE {
3258        //     ...
3259        //     substrings     [4] SubstringFilter,
3260        //     ...
3261        //
3262        // Init Substrings filter
3263        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
3264            new GrammarTransition(
3265                LdapStatesEnum.NOT_STATE,
3266                LdapStatesEnum.SUBSTRING_FILTER_STATE,
3267                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
3268                new InitSubstringsFilter() );
3269
3270        // --------------------------------------------------------------------------------------------
3271        // Transition from NOT to GreaterOrEqual filter
3272        // --------------------------------------------------------------------------------------------
3273        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3274        //     ...
3275        //     filter Filter,
3276        //     ...
3277        //
3278        // Filter ::= CHOICE {
3279        //     ...
3280        //     greaterOrEqual  [5] AttributeValueAssertion,
3281        //     ...
3282        //
3283        // Init Greater Or Equal filter
3284        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
3285            new GrammarTransition(
3286                LdapStatesEnum.NOT_STATE,
3287                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
3288                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
3289                new InitGreaterOrEqualFilter() );
3290
3291        // --------------------------------------------------------------------------------------------
3292        // Transition from NOT to LessOrEqual filter
3293        // --------------------------------------------------------------------------------------------
3294        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3295        //     ...
3296        //     filter Filter,
3297        //     ...
3298        //
3299        // Filter ::= CHOICE {
3300        //     ...
3301        //     LessOrEqual    [6] AttributeValueAssertion,
3302        //     ...
3303        //
3304        // Init Less Or Equal filter
3305        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
3306            new GrammarTransition(
3307                LdapStatesEnum.NOT_STATE,
3308                LdapStatesEnum.LESS_OR_EQUAL_STATE,
3309                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
3310                new InitLessOrEqualFilter() );
3311
3312        // --------------------------------------------------------------------------------------------
3313        // Transition from NOT to Present filter
3314        // --------------------------------------------------------------------------------------------
3315        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3316        //     ...
3317        //     filter Filter,
3318        //     ...
3319        //
3320        // Filter ::= CHOICE {
3321        //     ...
3322        //     present        [7] AttributeDescription,
3323        //     ...
3324        //
3325        // Init present filter
3326        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
3327            new GrammarTransition(
3328                LdapStatesEnum.NOT_STATE,
3329                LdapStatesEnum.PRESENT_STATE,
3330                LdapCodecConstants.PRESENT_FILTER_TAG,
3331                new InitPresentFilter() );
3332
3333        // --------------------------------------------------------------------------------------------
3334        // Transition from NOT to Approx Match filter
3335        // --------------------------------------------------------------------------------------------
3336        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3337        //     ...
3338        //     filter Filter,
3339        //     ...
3340        //
3341        // Filter ::= CHOICE {
3342        //     ...
3343        //     approxMatch     [8] AttributeValueAssertion,
3344        //     ...
3345        //
3346        // Init Approx Match filter
3347        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
3348            new GrammarTransition(
3349                LdapStatesEnum.NOT_STATE,
3350                LdapStatesEnum.APPROX_MATCH_STATE,
3351                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
3352                new InitApproxMatchFilter() );
3353
3354        // --------------------------------------------------------------------------------------------
3355        // Transition from NOT to Extensible Match filter
3356        // --------------------------------------------------------------------------------------------
3357        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3358        //     ...
3359        //     filter Filter,
3360        //     ...
3361        //
3362        // Filter ::= CHOICE {
3363        //     ...
3364        //     extensibleMatch  [9] MatchingRuleAssertion,
3365        //     ...
3366        //
3367        // Init extensible match filter
3368        super.transitions[LdapStatesEnum.NOT_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
3369            new GrammarTransition(
3370                LdapStatesEnum.NOT_STATE,
3371                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
3372                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
3373                new InitExtensibleMatchFilter() );
3374
3375        // --------------------------------------------------------------------------------------------
3376        // Transition from Equality match to Attribute Desc Filter
3377        // --------------------------------------------------------------------------------------------
3378        // Filter ::= CHOICE {
3379        //     ...
3380        //     equalityMatch  [3] AttributeValueAssertion,
3381        //     ...
3382        //
3383        // AttributeValueAssertion ::= SEQUENCE {
3384        //     attributeDesc   AttributeDescription,
3385        //     ...
3386        //
3387        // Init Attribute Desc filter
3388        super.transitions[LdapStatesEnum.EQUALITY_MATCH_STATE.ordinal()][OCTET_STRING.getValue()] =
3389            new GrammarTransition(
3390                LdapStatesEnum.EQUALITY_MATCH_STATE,
3391                LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE,
3392                OCTET_STRING,
3393                new InitAttributeDescFilter() );
3394
3395        // --------------------------------------------------------------------------------------------
3396        // Transition from Attribute Desc Filter to Assertion Value Filter
3397        // --------------------------------------------------------------------------------------------
3398        // Filter ::= CHOICE {
3399        //     ...
3400        //     equalityMatch  [3] AttributeValueAssertion,
3401        //     ...
3402        //
3403        // AttributeValueAssertion ::= SEQUENCE {
3404        //     ...
3405        //     assertionValue   AssertionValue }
3406        //
3407        // Init Assertion Value filter
3408        super.transitions[LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE.ordinal()][OCTET_STRING.getValue()] =
3409            new GrammarTransition(
3410                LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE,
3411                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3412                OCTET_STRING,
3413                new InitAssertionValueFilter() );
3414
3415        // --------------------------------------------------------------------------------------------
3416        // Transition from Assertion Value Filter to AND filter
3417        // --------------------------------------------------------------------------------------------
3418        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3419        //     ...
3420        //     filter Filter,
3421        //     ...
3422        //
3423        // Filter ::= CHOICE {
3424        //     and             [0] SET OF Filter,
3425        //     ...
3426        //
3427        // Init AND filter
3428        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
3429            new GrammarTransition(
3430                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3431                LdapStatesEnum.AND_STATE,
3432                LdapCodecConstants.AND_FILTER_TAG,
3433                new InitAndFilter() );
3434
3435        // --------------------------------------------------------------------------------------------
3436        // Transition from Assertion Value Filter to OR filter
3437        // --------------------------------------------------------------------------------------------
3438        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3439        //     ...
3440        //     filter Filter,
3441        //     ...
3442        //
3443        // Filter ::= CHOICE {
3444        //     ...
3445        //     or              [1] SET OF Filter,
3446        //     ...
3447        //
3448        // Init OR filter
3449        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
3450            new GrammarTransition(
3451                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3452                LdapStatesEnum.OR_STATE,
3453                LdapCodecConstants.OR_FILTER_TAG,
3454                new InitOrFilter() );
3455
3456        // --------------------------------------------------------------------------------------------
3457        // Transition from Assertion Value Filter to NOT filter
3458        // --------------------------------------------------------------------------------------------
3459        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3460        //     ...
3461        //     filter Filter,
3462        //     ...
3463        //
3464        // Filter ::= CHOICE {
3465        //     ...
3466        //     not             [2] SET OF Filter,
3467        //     ...
3468        //
3469        // Init NOT filter
3470        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
3471            new GrammarTransition(
3472                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3473                LdapStatesEnum.NOT_STATE,
3474                LdapCodecConstants.NOT_FILTER_TAG,
3475                new InitNotFilter() );
3476
3477        // --------------------------------------------------------------------------------------------
3478        // Transition from Assertion Value Filter to Equality Match filter
3479        // --------------------------------------------------------------------------------------------
3480        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3481        //     ...
3482        //     filter Filter,
3483        //     ...
3484        //
3485        // Filter ::= CHOICE {
3486        //     ...
3487        //     equalityMatch   [3] AttributeValueAssertion,
3488        //     ...
3489        //
3490        // Init NOT filter
3491        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
3492            new GrammarTransition(
3493                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3494                LdapStatesEnum.EQUALITY_MATCH_STATE,
3495                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
3496                new InitEqualityMatchFilter() );
3497
3498        // --------------------------------------------------------------------------------------------
3499        // Transition from Assertion Value Filter to Substrings filter
3500        // --------------------------------------------------------------------------------------------
3501        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3502        //     ...
3503        //     filter Filter,
3504        //     ...
3505        //
3506        // Filter ::= CHOICE {
3507        //     ...
3508        //     substrings     [4] SubstringFilter,
3509        //     ...
3510        //
3511        // Init Substrings filter
3512        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
3513            new GrammarTransition(
3514                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3515                LdapStatesEnum.SUBSTRING_FILTER_STATE,
3516                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
3517                new InitSubstringsFilter() );
3518
3519        // --------------------------------------------------------------------------------------------
3520        // Transition from Assertion Value Filter to GreaterOrEqual filter
3521        // --------------------------------------------------------------------------------------------
3522        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3523        //     ...
3524        //     filter Filter,
3525        //     ...
3526        //
3527        // Filter ::= CHOICE {
3528        //     ...
3529        //     greaterOrEqual  [5] AttributeValueAssertion,
3530        //     ...
3531        //
3532        // Init Greater Or Equal filter
3533        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
3534            new GrammarTransition(
3535                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3536                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
3537                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
3538                new InitGreaterOrEqualFilter() );
3539
3540        // --------------------------------------------------------------------------------------------
3541        // Transition from Assertion Value Filter to LessOrEqual filter
3542        // --------------------------------------------------------------------------------------------
3543        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3544        //     ...
3545        //     filter Filter,
3546        //     ...
3547        //
3548        // Filter ::= CHOICE {
3549        //     ...
3550        //     LessOrEqual    [6] AttributeValueAssertion,
3551        //     ...
3552        //
3553        // Init Less Or Equal filter
3554        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
3555            new GrammarTransition(
3556                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3557                LdapStatesEnum.LESS_OR_EQUAL_STATE,
3558                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
3559                new InitLessOrEqualFilter() );
3560
3561        // --------------------------------------------------------------------------------------------
3562        // Transition from Assertion Value Filter to Present filter
3563        // --------------------------------------------------------------------------------------------
3564        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3565        //     ...
3566        //     filter Filter,
3567        //     ...
3568        //
3569        // Filter ::= CHOICE {
3570        //     ...
3571        //     present        [7] AttributeDescription,
3572        //     ...
3573        //
3574        // Init present filter
3575        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
3576            new GrammarTransition(
3577                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3578                LdapStatesEnum.PRESENT_STATE,
3579                LdapCodecConstants.PRESENT_FILTER_TAG,
3580                new InitPresentFilter() );
3581
3582        // --------------------------------------------------------------------------------------------
3583        // Transition from Assertion Value Filter to Approx Match filter
3584        // --------------------------------------------------------------------------------------------
3585        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3586        //     ...
3587        //     filter Filter,
3588        //     ...
3589        //
3590        // Filter ::= CHOICE {
3591        //     ...
3592        //     approxMatch     [8] AttributeValueAssertion,
3593        //     ...
3594        //
3595        // Init Approx Match filter
3596        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
3597            new GrammarTransition(
3598                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3599                LdapStatesEnum.APPROX_MATCH_STATE,
3600                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
3601                new InitApproxMatchFilter() );
3602
3603        // --------------------------------------------------------------------------------------------
3604        // Transition from Assertion Value Filter to Extensible Match filter
3605        // --------------------------------------------------------------------------------------------
3606        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3607        //     ...
3608        //     filter Filter,
3609        //     ...
3610        //
3611        // Filter ::= CHOICE {
3612        //     ...
3613        //     extensibleMatch  [9] MatchingRuleAssertion,
3614        //     ...
3615        //
3616        // Init Assertion Value Filter filter
3617        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
3618            new GrammarTransition(
3619                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3620                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
3621                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
3622                new InitExtensibleMatchFilter() );
3623
3624        // --------------------------------------------------------------------------------------------
3625        // Transition from Assertion Value Filter to Attribute Description List
3626        // --------------------------------------------------------------------------------------------
3627        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3628        //     ...
3629        //     filter      Filter,
3630        //     attributes  AttributeDescriptionList }
3631        //
3632        // AttributeDescriptionList ::= SEQUENCE OF
3633        //     AttributeDescription
3634        //
3635        // Init attribute description list
3636        super.transitions[LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE.ordinal()][SEQUENCE.getValue()] =
3637            new GrammarTransition(
3638                LdapStatesEnum.ASSERTION_VALUE_FILTER_STATE,
3639                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
3640                SEQUENCE,
3641                new InitSearchRequestAttributeDescList() );
3642
3643        // --------------------------------------------------------------------------------------------
3644        // Transition from Attribute Description List to AttributeDescription
3645        // --------------------------------------------------------------------------------------------
3646        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3647        //     ...
3648        //     filter      Filter,
3649        //     attributes  AttributeDescriptionList }
3650        //
3651        // AttributeDescriptionList ::= SEQUENCE OF
3652        //     AttributeDescription
3653        //
3654        // Store attribute description
3655        super.transitions[LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE.ordinal()][OCTET_STRING.getValue()] =
3656            new GrammarTransition(
3657                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
3658                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE,
3659                OCTET_STRING,
3660                new StoreSearchRequestAttributeDesc() );
3661
3662        // --------------------------------------------------------------------------------------------
3663        // Transition from Attribute Description List to Controls
3664        // --------------------------------------------------------------------------------------------
3665        //         searchRequest   SearchRequest,
3666        //         ... },
3667        //     controls       [0] Controls OPTIONAL }
3668        //
3669        // Empty attribute description list, with controls
3670        super.transitions[LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
3671            new GrammarTransition(
3672                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
3673                LdapStatesEnum.CONTROLS_STATE,
3674                LdapCodecConstants.CONTROLS_TAG,
3675                new InitControls() );
3676
3677        // --------------------------------------------------------------------------------------------
3678        // Transition from Attribute Description to AttributeDescription
3679        // --------------------------------------------------------------------------------------------
3680        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3681        //     ...
3682        //     filter      Filter,
3683        //     attributes  AttributeDescriptionList }
3684        //
3685        // AttributeDescriptionList ::= SEQUENCE OF
3686        //     AttributeDescription
3687        //
3688        // Store attribute description
3689        super.transitions[LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE.ordinal()][OCTET_STRING.getValue()] =
3690            new GrammarTransition(
3691                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE,
3692                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE,
3693                OCTET_STRING,
3694                new StoreSearchRequestAttributeDesc() );
3695
3696        // --------------------------------------------------------------------------------------------
3697        // transition from Attribute Description to Controls.
3698        // --------------------------------------------------------------------------------------------
3699        //         searchRequest   SearchRequest,
3700        //         ... },
3701        //     controls       [0] Controls OPTIONAL }
3702        //
3703        super.transitions[LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE.ordinal()][LdapCodecConstants.CONTROLS_TAG] =
3704            new GrammarTransition(
3705                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_STATE,
3706                LdapStatesEnum.CONTROLS_STATE,
3707                LdapCodecConstants.CONTROLS_TAG,
3708                new InitControls() );
3709
3710        // --------------------------------------------------------------------------------------------
3711        // Transition from Greater Or Equal to Attribute Desc Filter
3712        // --------------------------------------------------------------------------------------------
3713        // Filter ::= CHOICE {
3714        //     ...
3715        //     greaterOrEqual  [5] AttributeValueAssertion,
3716        //     ...
3717        //
3718        // AttributeValueAssertion ::= SEQUENCE {
3719        //     attributeDesc   AttributeDescription,
3720        //     ...
3721        //
3722        // Init Attribute Desc filter
3723        super.transitions[LdapStatesEnum.GREATER_OR_EQUAL_STATE.ordinal()][OCTET_STRING.getValue()] =
3724            new GrammarTransition(
3725                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
3726                LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE,
3727                OCTET_STRING,
3728                new InitAttributeDescFilter() );
3729
3730        // --------------------------------------------------------------------------------------------
3731        // Transition from Less Or Equal to Attribute Desc Filter
3732        // --------------------------------------------------------------------------------------------
3733        // Filter ::= CHOICE {
3734        //     ...
3735        //     lessOrEqual  [6] AttributeValueAssertion,
3736        //     ...
3737        //
3738        // AttributeValueAssertion ::= SEQUENCE {
3739        //     attributeDesc   AttributeDescription,
3740        //     ...
3741        //
3742        // Init Attribute Desc filter
3743        super.transitions[LdapStatesEnum.LESS_OR_EQUAL_STATE.ordinal()][OCTET_STRING.getValue()] =
3744            new GrammarTransition(
3745                LdapStatesEnum.LESS_OR_EQUAL_STATE,
3746                LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE,
3747                OCTET_STRING,
3748                new InitAttributeDescFilter() );
3749
3750        // --------------------------------------------------------------------------------------------
3751        // Transition from Substrings to typeSubstring
3752        // --------------------------------------------------------------------------------------------
3753        // Filter ::= CHOICE {
3754        //     ...
3755        //     substrings  [4] SubstringFilter,
3756        //     ...
3757        //
3758        // SubstringFilter ::= SEQUENCE {
3759        //     type   AttributeDescription,
3760        //     ...
3761        //
3762        // Init substring type
3763        super.transitions[LdapStatesEnum.SUBSTRING_FILTER_STATE.ordinal()][OCTET_STRING.getValue()] =
3764            new GrammarTransition(
3765                LdapStatesEnum.SUBSTRING_FILTER_STATE,
3766                LdapStatesEnum.TYPE_SUBSTRING_STATE,
3767                OCTET_STRING,
3768                new StoreSubstringFilterType() );
3769
3770        // --------------------------------------------------------------------------------------------
3771        // Transition from typeSubstring to substrings
3772        // --------------------------------------------------------------------------------------------
3773        // Filter ::= CHOICE {
3774        //     ...
3775        //     substrings  [4] SubstringFilter,
3776        //     ...
3777        //
3778        // SubstringFilter ::= SEQUENCE {
3779        //     ...
3780        //     substrings SEQUENCE OF CHOICE {
3781        //     ...
3782        //
3783        // Init substring type
3784        super.transitions[LdapStatesEnum.TYPE_SUBSTRING_STATE.ordinal()][SEQUENCE.getValue()] =
3785            new GrammarTransition(
3786                LdapStatesEnum.TYPE_SUBSTRING_STATE,
3787                LdapStatesEnum.SUBSTRINGS_STATE,
3788                SEQUENCE,
3789                new CheckNotNullLength<LdapMessageContainer<SearchRequestDecorator>>() );
3790
3791        // --------------------------------------------------------------------------------------------
3792        // Transition from substrings to Initial
3793        // --------------------------------------------------------------------------------------------
3794        // SubstringFilter ::= SEQUENCE {
3795        //     ...
3796        //     substrings SEQUENCE OF CHOICE {
3797        //         initial  [0] LDAPSTRING,
3798        //         ...
3799        //
3800        // Store initial value
3801        super.transitions[LdapStatesEnum.SUBSTRINGS_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_INITIAL_TAG] =
3802            new GrammarTransition(
3803                LdapStatesEnum.SUBSTRINGS_STATE,
3804                LdapStatesEnum.INITIAL_STATE,
3805                LdapCodecConstants.SUBSTRINGS_FILTER_INITIAL_TAG,
3806                new StoreInitial() );
3807
3808        // --------------------------------------------------------------------------------------------
3809        // Transition from substrings to any
3810        // --------------------------------------------------------------------------------------------
3811        // SubstringFilter ::= SEQUENCE {
3812        //     ...
3813        //     substrings SEQUENCE OF CHOICE {
3814        //         ...
3815        //         any  [1] LDAPSTRING,
3816        //         ...
3817        //
3818        // Store substring any type
3819        super.transitions[LdapStatesEnum.SUBSTRINGS_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG] =
3820            new GrammarTransition(
3821                LdapStatesEnum.SUBSTRINGS_STATE,
3822                LdapStatesEnum.ANY_STATE,
3823                LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG,
3824                new StoreAny() );
3825
3826        // --------------------------------------------------------------------------------------------
3827        // Transition from substrings to final
3828        // --------------------------------------------------------------------------------------------
3829        // SubstringFilter ::= SEQUENCE {
3830        //     ...
3831        //     substrings SEQUENCE OF CHOICE {
3832        //         ...
3833        //         final  [2] LDAPSTRING }
3834        //
3835        // Store substring final type
3836        super.transitions[LdapStatesEnum.SUBSTRINGS_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG] =
3837            new GrammarTransition(
3838                LdapStatesEnum.SUBSTRINGS_STATE,
3839                LdapStatesEnum.FINAL_STATE,
3840                LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG,
3841                new StoreFinal() );
3842
3843        // --------------------------------------------------------------------------------------------
3844        // Transition from initial to any
3845        // --------------------------------------------------------------------------------------------
3846        // SubstringFilter ::= SEQUENCE {
3847        //     ...
3848        //     substrings SEQUENCE OF CHOICE {
3849        //         ...
3850        //         any  [1] LDAPSTRING,
3851        //         ...
3852        //
3853        // Store substring any type
3854        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG] =
3855            new GrammarTransition(
3856                LdapStatesEnum.INITIAL_STATE,
3857                LdapStatesEnum.ANY_STATE,
3858                LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG,
3859                new StoreAny() );
3860
3861        // --------------------------------------------------------------------------------------------
3862        // Transition from initial to final
3863        // --------------------------------------------------------------------------------------------
3864        // SubstringFilter ::= SEQUENCE {
3865        //     ...
3866        //     substrings SEQUENCE OF CHOICE {
3867        //         ...
3868        //         final  [2] LDAPSTRING }
3869        //
3870        // Store substring final type
3871        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG] =
3872            new GrammarTransition(
3873                LdapStatesEnum.INITIAL_STATE,
3874                LdapStatesEnum.FINAL_STATE,
3875                LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG,
3876                new StoreFinal() );
3877
3878        // --------------------------------------------------------------------------------------------
3879        // Transition from initial to Attribute Description List
3880        // --------------------------------------------------------------------------------------------
3881        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3882        //     ...
3883        //     filter      Filter,
3884        //     attributes  AttributeDescriptionList }
3885        //
3886        // AttributeDescriptionList ::= SEQUENCE OF
3887        //     AttributeDescription
3888        //
3889        // Init attribute description list
3890        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][SEQUENCE.getValue()] =
3891            new GrammarTransition(
3892                LdapStatesEnum.INITIAL_STATE,
3893                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
3894                SEQUENCE,
3895                new InitSearchRequestAttributeDescList() );
3896
3897        // --------------------------------------------------------------------------------------------
3898        // Transition from initial to AND filter
3899        // --------------------------------------------------------------------------------------------
3900        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3901        //     ...
3902        //     filter Filter,
3903        //     ...
3904        //
3905        // Filter ::= CHOICE {
3906        //     and             [0] SET OF Filter,
3907        //     ...
3908        //
3909        // Init AND filter
3910        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
3911            new GrammarTransition(
3912                LdapStatesEnum.INITIAL_STATE,
3913                LdapStatesEnum.AND_STATE,
3914                LdapCodecConstants.AND_FILTER_TAG,
3915                new InitAndFilter() );
3916
3917        // --------------------------------------------------------------------------------------------
3918        // Transition from initial to OR filter
3919        // --------------------------------------------------------------------------------------------
3920        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3921        //     ...
3922        //     filter Filter,
3923        //     ...
3924        //
3925        // Filter ::= CHOICE {
3926        //     ...
3927        //     or              [1] SET OF Filter,
3928        //     ...
3929        //
3930        // Init OR filter
3931        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
3932            new GrammarTransition(
3933                LdapStatesEnum.INITIAL_STATE,
3934                LdapStatesEnum.OR_STATE,
3935                LdapCodecConstants.OR_FILTER_TAG,
3936                new InitOrFilter() );
3937
3938        // --------------------------------------------------------------------------------------------
3939        // Transition from initial to NOT filter
3940        // --------------------------------------------------------------------------------------------
3941        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3942        //     ...
3943        //     filter Filter,
3944        //     ...
3945        //
3946        // Filter ::= CHOICE {
3947        //     ...
3948        //     not             [2] SET OF Filter,
3949        //     ...
3950        //
3951        // Init NOT filter
3952        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
3953            new GrammarTransition(
3954                LdapStatesEnum.INITIAL_STATE,
3955                LdapStatesEnum.NOT_STATE,
3956                LdapCodecConstants.NOT_FILTER_TAG,
3957                new InitNotFilter() );
3958
3959        // --------------------------------------------------------------------------------------------
3960        // Transition from initial to Equality Match filter
3961        // --------------------------------------------------------------------------------------------
3962        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3963        //     ...
3964        //     filter Filter,
3965        //     ...
3966        //
3967        // Filter ::= CHOICE {
3968        //     ...
3969        //     equalityMatch   [3] AttributeValueAssertion,
3970        //     ...
3971        //
3972        // Init NOT filter
3973        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
3974            new GrammarTransition(
3975                LdapStatesEnum.INITIAL_STATE,
3976                LdapStatesEnum.EQUALITY_MATCH_STATE,
3977                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
3978                new InitEqualityMatchFilter() );
3979
3980        // --------------------------------------------------------------------------------------------
3981        // Transition from initial to Substrings filter
3982        // --------------------------------------------------------------------------------------------
3983        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
3984        //     ...
3985        //     filter Filter,
3986        //     ...
3987        //
3988        // Filter ::= CHOICE {
3989        //     ...
3990        //     substrings     [4] SubstringFilter,
3991        //     ...
3992        //
3993        // Init Substrings filter
3994        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
3995            new GrammarTransition(
3996                LdapStatesEnum.INITIAL_STATE,
3997                LdapStatesEnum.SUBSTRING_FILTER_STATE,
3998                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
3999                new InitSubstringsFilter() );
4000
4001        // --------------------------------------------------------------------------------------------
4002        // Transition from initial to GreaterOrEqual filter
4003        // --------------------------------------------------------------------------------------------
4004        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4005        //     ...
4006        //     filter Filter,
4007        //     ...
4008        //
4009        // Filter ::= CHOICE {
4010        //     ...
4011        //     greaterOrEqual  [5] AttributeValueAssertion,
4012        //     ...
4013        //
4014        // Init Greater Or Equal filter
4015        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
4016            new GrammarTransition(
4017                LdapStatesEnum.INITIAL_STATE,
4018                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
4019                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
4020                new InitGreaterOrEqualFilter() );
4021
4022        // --------------------------------------------------------------------------------------------
4023        // Transition from initial to LessOrEqual filter
4024        // --------------------------------------------------------------------------------------------
4025        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4026        //     ...
4027        //     filter Filter,
4028        //     ...
4029        //
4030        // Filter ::= CHOICE {
4031        //     ...
4032        //     LessOrEqual    [6] AttributeValueAssertion,
4033        //     ...
4034        //
4035        // Init Less Or Equal filter
4036        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
4037            new GrammarTransition(
4038                LdapStatesEnum.INITIAL_STATE,
4039                LdapStatesEnum.LESS_OR_EQUAL_STATE,
4040                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
4041                new InitLessOrEqualFilter() );
4042
4043        // --------------------------------------------------------------------------------------------
4044        // Transition from initial to Present filter
4045        // --------------------------------------------------------------------------------------------
4046        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4047        //     ...
4048        //     filter Filter,
4049        //     ...
4050        //
4051        // Filter ::= CHOICE {
4052        //     ...
4053        //     present        [7] AttributeDescription,
4054        //     ...
4055        //
4056        // Init present filter
4057        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
4058            new GrammarTransition(
4059                LdapStatesEnum.INITIAL_STATE,
4060                LdapStatesEnum.PRESENT_STATE,
4061                LdapCodecConstants.PRESENT_FILTER_TAG,
4062                new InitPresentFilter() );
4063
4064        // --------------------------------------------------------------------------------------------
4065        // Transition from initial to Approx Match filter
4066        // --------------------------------------------------------------------------------------------
4067        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4068        //     ...
4069        //     filter Filter,
4070        //     ...
4071        //
4072        // Filter ::= CHOICE {
4073        //     ...
4074        //     approxMatch     [8] AttributeValueAssertion,
4075        //     ...
4076        //
4077        // Init Approx Match filter
4078        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
4079            new GrammarTransition(
4080                LdapStatesEnum.INITIAL_STATE,
4081                LdapStatesEnum.APPROX_MATCH_STATE,
4082                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
4083                new InitApproxMatchFilter() );
4084
4085        // --------------------------------------------------------------------------------------------
4086        // Transition from initial to Extensible Match filter
4087        // --------------------------------------------------------------------------------------------
4088        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4089        //     ...
4090        //     filter Filter,
4091        //     ...
4092        //
4093        // Filter ::= CHOICE {
4094        //     ...
4095        //     extensibleMatch  [9] MatchingRuleAssertion,
4096        //     ...
4097        //
4098        // Init Assertion Value Filter filter
4099        super.transitions[LdapStatesEnum.INITIAL_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
4100            new GrammarTransition(
4101                LdapStatesEnum.INITIAL_STATE,
4102                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4103                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
4104                new InitExtensibleMatchFilter() );
4105
4106        // --------------------------------------------------------------------------------------------
4107        // Transition from any to final
4108        // --------------------------------------------------------------------------------------------
4109        // SubstringFilter ::= SEQUENCE {
4110        //     ...
4111        //     substrings SEQUENCE OF CHOICE {
4112        //         ...
4113        //         final  [2] LDAPSTRING }
4114        //
4115        // Store substring final type
4116        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG] =
4117            new GrammarTransition(
4118                LdapStatesEnum.ANY_STATE,
4119                LdapStatesEnum.FINAL_STATE,
4120                LdapCodecConstants.SUBSTRINGS_FILTER_FINAL_TAG,
4121                new StoreFinal() );
4122
4123        // --------------------------------------------------------------------------------------------
4124        // Transition from any to any
4125        // --------------------------------------------------------------------------------------------
4126        // SubstringFilter ::= SEQUENCE {
4127        //     ...
4128        //     substrings SEQUENCE OF CHOICE {
4129        //         ...
4130        //         any  [1] LDAPSTRING
4131        //         ...
4132        //
4133        // Store substring any type
4134        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG] =
4135            new GrammarTransition(
4136                LdapStatesEnum.ANY_STATE,
4137                LdapStatesEnum.ANY_STATE,
4138                LdapCodecConstants.SUBSTRINGS_FILTER_ANY_TAG,
4139                new StoreAny() );
4140
4141        // --------------------------------------------------------------------------------------------
4142        // Transition from any to Attribute Description List
4143        // --------------------------------------------------------------------------------------------
4144        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4145        //     ...
4146        //     filter      Filter,
4147        //     attributes  AttributeDescriptionList }
4148        //
4149        // AttributeDescriptionList ::= SEQUENCE OF
4150        //     AttributeDescription
4151        //
4152        // Init attribute description list
4153        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][SEQUENCE.getValue()] =
4154            new GrammarTransition(
4155                LdapStatesEnum.ANY_STATE,
4156                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
4157                SEQUENCE,
4158                new InitSearchRequestAttributeDescList() );
4159
4160        // --------------------------------------------------------------------------------------------
4161        // Transition from any to AND filter
4162        // --------------------------------------------------------------------------------------------
4163        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4164        //     ...
4165        //     filter Filter,
4166        //     ...
4167        //
4168        // Filter ::= CHOICE {
4169        //     and             [0] SET OF Filter,
4170        //     ...
4171        //
4172        // Init AND filter
4173        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
4174            new GrammarTransition(
4175                LdapStatesEnum.ANY_STATE,
4176                LdapStatesEnum.AND_STATE,
4177                LdapCodecConstants.AND_FILTER_TAG,
4178                new InitAndFilter() );
4179
4180        // --------------------------------------------------------------------------------------------
4181        // Transition from any to OR filter
4182        // --------------------------------------------------------------------------------------------
4183        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4184        //     ...
4185        //     filter Filter,
4186        //     ...
4187        //
4188        // Filter ::= CHOICE {
4189        //     ...
4190        //     or              [1] SET OF Filter,
4191        //     ...
4192        //
4193        // Init OR filter
4194        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
4195            new GrammarTransition(
4196                LdapStatesEnum.ANY_STATE,
4197                LdapStatesEnum.OR_STATE,
4198                LdapCodecConstants.OR_FILTER_TAG,
4199                new InitOrFilter() );
4200
4201        // --------------------------------------------------------------------------------------------
4202        // Transition from any to NOT filter
4203        // --------------------------------------------------------------------------------------------
4204        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4205        //     ...
4206        //     filter Filter,
4207        //     ...
4208        //
4209        // Filter ::= CHOICE {
4210        //     ...
4211        //     not             [2] SET OF Filter,
4212        //     ...
4213        //
4214        // Init NOT filter
4215        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
4216            new GrammarTransition(
4217                LdapStatesEnum.ANY_STATE,
4218                LdapStatesEnum.NOT_STATE,
4219                LdapCodecConstants.NOT_FILTER_TAG,
4220                new InitNotFilter() );
4221
4222        // --------------------------------------------------------------------------------------------
4223        // Transition from any to Equality Match filter
4224        // --------------------------------------------------------------------------------------------
4225        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4226        //     ...
4227        //     filter Filter,
4228        //     ...
4229        //
4230        // Filter ::= CHOICE {
4231        //     ...
4232        //     equalityMatch   [3] AttributeValueAssertion,
4233        //     ...
4234        //
4235        // Init NOT filter
4236        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
4237            new GrammarTransition(
4238                LdapStatesEnum.ANY_STATE,
4239                LdapStatesEnum.EQUALITY_MATCH_STATE,
4240                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
4241                new InitEqualityMatchFilter() );
4242
4243        // --------------------------------------------------------------------------------------------
4244        // Transition from any to Substrings filter
4245        // --------------------------------------------------------------------------------------------
4246        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4247        //     ...
4248        //     filter Filter,
4249        //     ...
4250        //
4251        // Filter ::= CHOICE {
4252        //     ...
4253        //     substrings     [4] SubstringFilter,
4254        //     ...
4255        //
4256        // Init Substrings filter
4257        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
4258            new GrammarTransition(
4259                LdapStatesEnum.ANY_STATE,
4260                LdapStatesEnum.SUBSTRING_FILTER_STATE,
4261                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
4262                new InitSubstringsFilter() );
4263
4264        // --------------------------------------------------------------------------------------------
4265        // Transition from any to GreaterOrEqual filter
4266        // --------------------------------------------------------------------------------------------
4267        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4268        //     ...
4269        //     filter Filter,
4270        //     ...
4271        //
4272        // Filter ::= CHOICE {
4273        //     ...
4274        //     greaterOrEqual  [5] AttributeValueAssertion,
4275        //     ...
4276        //
4277        // Init Greater Or Equal filter
4278        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
4279            new GrammarTransition(
4280                LdapStatesEnum.ANY_STATE,
4281                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
4282                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
4283                new InitGreaterOrEqualFilter() );
4284
4285        // --------------------------------------------------------------------------------------------
4286        // Transition from any to LessOrEqual filter
4287        // --------------------------------------------------------------------------------------------
4288        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4289        //     ...
4290        //     filter Filter,
4291        //     ...
4292        //
4293        // Filter ::= CHOICE {
4294        //     ...
4295        //     LessOrEqual    [6] AttributeValueAssertion,
4296        //     ...
4297        //
4298        // Init Less Or Equal filter
4299        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
4300            new GrammarTransition(
4301                LdapStatesEnum.ANY_STATE,
4302                LdapStatesEnum.LESS_OR_EQUAL_STATE,
4303                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
4304                new InitLessOrEqualFilter() );
4305
4306        // --------------------------------------------------------------------------------------------
4307        // Transition from any to Present filter
4308        // --------------------------------------------------------------------------------------------
4309        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4310        //     ...
4311        //     filter Filter,
4312        //     ...
4313        //
4314        // Filter ::= CHOICE {
4315        //     ...
4316        //     present        [7] AttributeDescription,
4317        //     ...
4318        //
4319        // Init present filter
4320        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
4321            new GrammarTransition(
4322                LdapStatesEnum.ANY_STATE,
4323                LdapStatesEnum.PRESENT_STATE,
4324                LdapCodecConstants.PRESENT_FILTER_TAG,
4325                new InitPresentFilter() );
4326
4327        // --------------------------------------------------------------------------------------------
4328        // Transition from any to Approx Match filter
4329        // --------------------------------------------------------------------------------------------
4330        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4331        //     ...
4332        //     filter Filter,
4333        //     ...
4334        //
4335        // Filter ::= CHOICE {
4336        //     ...
4337        //     approxMatch     [8] AttributeValueAssertion,
4338        //     ...
4339        //
4340        // Init Approx Match filter
4341        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
4342            new GrammarTransition(
4343                LdapStatesEnum.ANY_STATE,
4344                LdapStatesEnum.APPROX_MATCH_STATE,
4345                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
4346                new InitApproxMatchFilter() );
4347
4348        // --------------------------------------------------------------------------------------------
4349        // Transition from any to Extensible Match filter
4350        // --------------------------------------------------------------------------------------------
4351        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4352        //     ...
4353        //     filter Filter,
4354        //     ...
4355        //
4356        // Filter ::= CHOICE {
4357        //     ...
4358        //     extensibleMatch  [9] MatchingRuleAssertion,
4359        //     ...
4360        //
4361        // Init Assertion Value Filter filter
4362        super.transitions[LdapStatesEnum.ANY_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
4363            new GrammarTransition(
4364                LdapStatesEnum.ANY_STATE,
4365                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4366                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
4367                new InitExtensibleMatchFilter() );
4368
4369        // --------------------------------------------------------------------------------------------
4370        // Transition from final to Attribute Description List
4371        // --------------------------------------------------------------------------------------------
4372        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4373        //     ...
4374        //     filter      Filter,
4375        //     attributes  AttributeDescriptionList }
4376        //
4377        // AttributeDescriptionList ::= SEQUENCE OF
4378        //     AttributeDescription
4379        //
4380        // Init attribute description list
4381        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][SEQUENCE.getValue()] =
4382            new GrammarTransition(
4383                LdapStatesEnum.FINAL_STATE,
4384                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
4385                SEQUENCE,
4386                new InitSearchRequestAttributeDescList() );
4387
4388        // --------------------------------------------------------------------------------------------
4389        // Transition from final to AND filter
4390        // --------------------------------------------------------------------------------------------
4391        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4392        //     ...
4393        //     filter Filter,
4394        //     ...
4395        //
4396        // Filter ::= CHOICE {
4397        //     and             [0] SET OF Filter,
4398        //     ...
4399        //
4400        // Init AND filter
4401        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
4402            new GrammarTransition(
4403                LdapStatesEnum.FINAL_STATE,
4404                LdapStatesEnum.AND_STATE,
4405                LdapCodecConstants.AND_FILTER_TAG,
4406                new InitAndFilter() );
4407
4408        // --------------------------------------------------------------------------------------------
4409        // Transition from final to OR filter
4410        // --------------------------------------------------------------------------------------------
4411        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4412        //     ...
4413        //     filter Filter,
4414        //     ...
4415        //
4416        // Filter ::= CHOICE {
4417        //     ...
4418        //     or              [1] SET OF Filter,
4419        //     ...
4420        //
4421        // Init OR filter
4422        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
4423            new GrammarTransition(
4424                LdapStatesEnum.FINAL_STATE,
4425                LdapStatesEnum.OR_STATE,
4426                LdapCodecConstants.OR_FILTER_TAG,
4427                new InitOrFilter() );
4428
4429        // --------------------------------------------------------------------------------------------
4430        // Transition from final to NOT filter
4431        // --------------------------------------------------------------------------------------------
4432        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4433        //     ...
4434        //     filter Filter,
4435        //     ...
4436        //
4437        // Filter ::= CHOICE {
4438        //     ...
4439        //     not             [2] SET OF Filter,
4440        //     ...
4441        //
4442        // Init NOT filter
4443        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
4444            new GrammarTransition(
4445                LdapStatesEnum.FINAL_STATE,
4446                LdapStatesEnum.NOT_STATE,
4447                LdapCodecConstants.NOT_FILTER_TAG,
4448                new InitNotFilter() );
4449
4450        // --------------------------------------------------------------------------------------------
4451        // Transition from final to Equality Match filter
4452        // --------------------------------------------------------------------------------------------
4453        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4454        //     ...
4455        //     filter Filter,
4456        //     ...
4457        //
4458        // Filter ::= CHOICE {
4459        //     ...
4460        //     equalityMatch   [3] AttributeValueAssertion,
4461        //     ...
4462        //
4463        // Init NOT filter
4464        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
4465            new GrammarTransition(
4466                LdapStatesEnum.FINAL_STATE,
4467                LdapStatesEnum.EQUALITY_MATCH_STATE,
4468                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
4469                new InitEqualityMatchFilter() );
4470
4471        // --------------------------------------------------------------------------------------------
4472        // Transition from final to Substrings filter
4473        // --------------------------------------------------------------------------------------------
4474        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4475        //     ...
4476        //     filter Filter,
4477        //     ...
4478        //
4479        // Filter ::= CHOICE {
4480        //     ...
4481        //     substrings     [4] SubstringFilter,
4482        //     ...
4483        //
4484        // Init Substrings filter
4485        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
4486            new GrammarTransition(
4487                LdapStatesEnum.FINAL_STATE,
4488                LdapStatesEnum.SUBSTRING_FILTER_STATE,
4489                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
4490                new InitSubstringsFilter() );
4491
4492        // --------------------------------------------------------------------------------------------
4493        // Transition from final to GreaterOrEqual filter
4494        // --------------------------------------------------------------------------------------------
4495        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4496        //     ...
4497        //     filter Filter,
4498        //     ...
4499        //
4500        // Filter ::= CHOICE {
4501        //     ...
4502        //     greaterOrEqual  [5] AttributeValueAssertion,
4503        //     ...
4504        //
4505        // Init Greater Or Equal filter
4506        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
4507            new GrammarTransition(
4508                LdapStatesEnum.FINAL_STATE,
4509                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
4510                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
4511                new InitGreaterOrEqualFilter() );
4512
4513        // --------------------------------------------------------------------------------------------
4514        // Transition from final to LessOrEqual filter
4515        // --------------------------------------------------------------------------------------------
4516        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4517        //     ...
4518        //     filter Filter,
4519        //     ...
4520        //
4521        // Filter ::= CHOICE {
4522        //     ...
4523        //     LessOrEqual    [6] AttributeValueAssertion,
4524        //     ...
4525        //
4526        // Init Less Or Equal filter
4527        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
4528            new GrammarTransition(
4529                LdapStatesEnum.FINAL_STATE,
4530                LdapStatesEnum.LESS_OR_EQUAL_STATE,
4531                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
4532                new InitLessOrEqualFilter() );
4533
4534        // --------------------------------------------------------------------------------------------
4535        // Transition from final to Present filter
4536        // --------------------------------------------------------------------------------------------
4537        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4538        //     ...
4539        //     filter Filter,
4540        //     ...
4541        //
4542        // Filter ::= CHOICE {
4543        //     ...
4544        //     present        [7] AttributeDescription,
4545        //     ...
4546        //
4547        // Init present filter
4548        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
4549            new GrammarTransition(
4550                LdapStatesEnum.FINAL_STATE,
4551                LdapStatesEnum.PRESENT_STATE,
4552                LdapCodecConstants.PRESENT_FILTER_TAG,
4553                new InitPresentFilter() );
4554
4555        // --------------------------------------------------------------------------------------------
4556        // Transition from final to Approx Match filter
4557        // --------------------------------------------------------------------------------------------
4558        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4559        //     ...
4560        //     filter Filter,
4561        //     ...
4562        //
4563        // Filter ::= CHOICE {
4564        //     ...
4565        //     approxMatch     [8] AttributeValueAssertion,
4566        //     ...
4567        //
4568        // Init Approx Match filter
4569        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
4570            new GrammarTransition(
4571                LdapStatesEnum.FINAL_STATE,
4572                LdapStatesEnum.APPROX_MATCH_STATE,
4573                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
4574                new InitApproxMatchFilter() );
4575
4576        // --------------------------------------------------------------------------------------------
4577        // Transition from final to Extensible Match filter
4578        // --------------------------------------------------------------------------------------------
4579        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4580        //     ...
4581        //     filter Filter,
4582        //     ...
4583        //
4584        // Filter ::= CHOICE {
4585        //     ...
4586        //     extensibleMatch  [9] MatchingRuleAssertion,
4587        //     ...
4588        //
4589        // Init Assertion Value Filter filter
4590        super.transitions[LdapStatesEnum.FINAL_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
4591            new GrammarTransition(
4592                LdapStatesEnum.FINAL_STATE,
4593                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4594                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
4595                new InitExtensibleMatchFilter() );
4596
4597        // --------------------------------------------------------------------------------------------
4598        // Transition from Present Filter to AND filter
4599        // --------------------------------------------------------------------------------------------
4600        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4601        //     ...
4602        //     filter Filter,
4603        //     ...
4604        //
4605        // Filter ::= CHOICE {
4606        //     and             [0] SET OF Filter,
4607        //     ...
4608        //
4609        // Init AND filter
4610        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
4611            new GrammarTransition(
4612                LdapStatesEnum.PRESENT_STATE,
4613                LdapStatesEnum.AND_STATE,
4614                LdapCodecConstants.AND_FILTER_TAG,
4615                new InitAndFilter() );
4616
4617        // --------------------------------------------------------------------------------------------
4618        // Transition from Present Filter to OR filter
4619        // --------------------------------------------------------------------------------------------
4620        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4621        //     ...
4622        //     filter Filter,
4623        //     ...
4624        //
4625        // Filter ::= CHOICE {
4626        //     ...
4627        //     or              [1] SET OF Filter,
4628        //     ...
4629        //
4630        // Init OR filter
4631        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
4632            new GrammarTransition(
4633                LdapStatesEnum.PRESENT_STATE,
4634                LdapStatesEnum.OR_STATE,
4635                LdapCodecConstants.OR_FILTER_TAG,
4636                new InitOrFilter() );
4637
4638        // --------------------------------------------------------------------------------------------
4639        // Transition from Present Filter to NOT filter
4640        // --------------------------------------------------------------------------------------------
4641        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4642        //     ...
4643        //     filter Filter,
4644        //     ...
4645        //
4646        // Filter ::= CHOICE {
4647        //     ...
4648        //     not             [2] SET OF Filter,
4649        //     ...
4650        //
4651        // Init NOT filter
4652        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
4653            new GrammarTransition(
4654                LdapStatesEnum.PRESENT_STATE,
4655                LdapStatesEnum.NOT_STATE,
4656                LdapCodecConstants.NOT_FILTER_TAG,
4657                new InitNotFilter() );
4658
4659        // --------------------------------------------------------------------------------------------
4660        // Transition from Present Filter to Equality Match filter
4661        // --------------------------------------------------------------------------------------------
4662        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4663        //     ...
4664        //     filter Filter,
4665        //     ...
4666        //
4667        // Filter ::= CHOICE {
4668        //     ...
4669        //     equalityMatch   [3] AttributeValueAssertion,
4670        //     ...
4671        //
4672        // Init NOT filter
4673        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
4674            new GrammarTransition(
4675                LdapStatesEnum.PRESENT_STATE,
4676                LdapStatesEnum.EQUALITY_MATCH_STATE,
4677                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
4678                new InitEqualityMatchFilter() );
4679
4680        // --------------------------------------------------------------------------------------------
4681        // Transition from Present Filter to Substrings filter
4682        // --------------------------------------------------------------------------------------------
4683        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4684        //     ...
4685        //     filter Filter,
4686        //     ...
4687        //
4688        // Filter ::= CHOICE {
4689        //     ...
4690        //     substrings     [4] SubstringFilter,
4691        //     ...
4692        //
4693        // Init Substrings filter
4694        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
4695            new GrammarTransition(
4696                LdapStatesEnum.PRESENT_STATE,
4697                LdapStatesEnum.SUBSTRING_FILTER_STATE,
4698                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
4699                new InitSubstringsFilter() );
4700
4701        // --------------------------------------------------------------------------------------------
4702        // Transition from Present Filter to GreaterOrEqual filter
4703        // --------------------------------------------------------------------------------------------
4704        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4705        //     ...
4706        //     filter Filter,
4707        //     ...
4708        //
4709        // Filter ::= CHOICE {
4710        //     ...
4711        //     greaterOrEqual  [5] AttributeValueAssertion,
4712        //     ...
4713        //
4714        // Init Greater Or Equal filter
4715        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
4716            new GrammarTransition(
4717                LdapStatesEnum.PRESENT_STATE,
4718                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
4719                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
4720                new InitGreaterOrEqualFilter() );
4721
4722        // --------------------------------------------------------------------------------------------
4723        // Transition from Present Filter to LessOrEqual filter
4724        // --------------------------------------------------------------------------------------------
4725        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4726        //     ...
4727        //     filter Filter,
4728        //     ...
4729        //
4730        // Filter ::= CHOICE {
4731        //     ...
4732        //     LessOrEqual    [6] AttributeValueAssertion,
4733        //     ...
4734        //
4735        // Init Less Or Equal filter
4736        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
4737            new GrammarTransition(
4738                LdapStatesEnum.PRESENT_STATE,
4739                LdapStatesEnum.LESS_OR_EQUAL_STATE,
4740                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
4741                new InitLessOrEqualFilter() );
4742
4743        // --------------------------------------------------------------------------------------------
4744        // Transition from Present Filter to Present filter
4745        // --------------------------------------------------------------------------------------------
4746        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4747        //     ...
4748        //     filter Filter,
4749        //     ...
4750        //
4751        // Filter ::= CHOICE {
4752        //     ...
4753        //     present        [7] AttributeDescription,
4754        //     ...
4755        //
4756        // Init present filter
4757        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
4758            new GrammarTransition(
4759                LdapStatesEnum.PRESENT_STATE,
4760                LdapStatesEnum.PRESENT_STATE,
4761                LdapCodecConstants.PRESENT_FILTER_TAG,
4762                new InitPresentFilter() );
4763
4764        // --------------------------------------------------------------------------------------------
4765        // Transition from Present Filter to Approx Match filter
4766        // --------------------------------------------------------------------------------------------
4767        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4768        //     ...
4769        //     filter Filter,
4770        //     ...
4771        //
4772        // Filter ::= CHOICE {
4773        //     ...
4774        //     approxMatch     [8] AttributeValueAssertion,
4775        //     ...
4776        //
4777        // Init Approx Match filter
4778        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
4779            new GrammarTransition(
4780                LdapStatesEnum.PRESENT_STATE,
4781                LdapStatesEnum.APPROX_MATCH_STATE,
4782                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
4783                new InitApproxMatchFilter() );
4784
4785        // --------------------------------------------------------------------------------------------
4786        // Transition from Present Filter to Extensible Match filter
4787        // --------------------------------------------------------------------------------------------
4788        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4789        //     ...
4790        //     filter Filter,
4791        //     ...
4792        //
4793        // Filter ::= CHOICE {
4794        //     ...
4795        //     extensibleMatch  [9] MatchingRuleAssertion,
4796        //     ...
4797        //
4798        // Init Assertion Value Filter filter
4799        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
4800            new GrammarTransition(
4801                LdapStatesEnum.PRESENT_STATE,
4802                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4803                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
4804                new InitExtensibleMatchFilter() );
4805
4806        // --------------------------------------------------------------------------------------------
4807        // Transition from Present Filter to Attribute Description List
4808        // --------------------------------------------------------------------------------------------
4809        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
4810        //     ...
4811        //     filter      Filter,
4812        //     attributes  AttributeDescriptionList }
4813        //
4814        // AttributeDescriptionList ::= SEQUENCE OF
4815        //     AttributeDescription
4816        //
4817        // Init attribute description list
4818        super.transitions[LdapStatesEnum.PRESENT_STATE.ordinal()][SEQUENCE.getValue()] =
4819            new GrammarTransition(
4820                LdapStatesEnum.PRESENT_STATE,
4821                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
4822                SEQUENCE,
4823                new InitSearchRequestAttributeDescList() );
4824
4825        // --------------------------------------------------------------------------------------------
4826        // Transition from Approx Match to Attribute Desc Filter
4827        // --------------------------------------------------------------------------------------------
4828        // Filter ::= CHOICE {
4829        //     ...
4830        //     approxMatch  [8] AttributeValueAssertion,
4831        //     ...
4832        //
4833        // AttributeValueAssertion ::= SEQUENCE {
4834        //     attributeDesc   AttributeDescription,
4835        //     ...
4836        //
4837        // Init Attribute Desc filter
4838        super.transitions[LdapStatesEnum.APPROX_MATCH_STATE.ordinal()][OCTET_STRING.getValue()] =
4839            new GrammarTransition(
4840                LdapStatesEnum.APPROX_MATCH_STATE,
4841                LdapStatesEnum.ATTRIBUTE_DESC_FILTER_STATE,
4842                OCTET_STRING,
4843                new InitAttributeDescFilter() );
4844
4845        // --------------------------------------------------------------------------------------------
4846        // Transition from Extensible Match to MatchingRule
4847        // --------------------------------------------------------------------------------------------
4848        // Filter ::= CHOICE {
4849        //     ...
4850        //     extensibleMatch  [9] MatchingRuleAssertion }
4851        //
4852        // MatchingRuleAssertion ::= SEQUENCE {
4853        //     matchingRule [1] MatchingRuleId OPTIONAL,
4854        //     ...
4855        //
4856        // Store the matching rule ID
4857        super.transitions[LdapStatesEnum.EXTENSIBLE_MATCH_STATE.ordinal()][LdapCodecConstants.MATCHING_RULE_ID_TAG] = new GrammarTransition(
4858            LdapStatesEnum.EXTENSIBLE_MATCH_STATE, LdapStatesEnum.MATCHING_RULE_STATE,
4859            LdapCodecConstants.MATCHING_RULE_ID_TAG, new GrammarAction<LdapMessageContainer<SearchRequestDecorator>>(
4860                "Store matching rule Value" )
4861            {
4862                public void action( LdapMessageContainer<SearchRequestDecorator> container ) throws DecoderException
4863                {
4864                    SearchRequestDecorator searchRequest = container.getMessage();
4865
4866                    TLV tlv = container.getCurrentTLV();
4867
4868                    // Store the value.
4869                    ExtensibleMatchFilter extensibleMatchFilter = ( ExtensibleMatchFilter )
4870                        searchRequest.getTerminalFilter();
4871
4872                    if ( tlv.getLength() == 0 )
4873                    {
4874                        String msg = I18n.err( I18n.ERR_04109 );
4875                        LOG.error( msg );
4876
4877                        // It will generate a PROTOCOL_ERROR
4878                        throw new DecoderException( I18n.err( I18n.ERR_04109 ) );
4879                    }
4880                    else
4881                    {
4882                        extensibleMatchFilter.setMatchingRule( Strings.utf8ToString( tlv.getValue().getData() ) );
4883                    }
4884                }
4885            } );
4886
4887        // --------------------------------------------------------------------------------------------
4888        // Transition from Extensible Match to type matching rule
4889        // --------------------------------------------------------------------------------------------
4890        // Filter ::= CHOICE {
4891        //     ...
4892        //     extensibleMatch  [9] MatchingRuleAssertion }
4893        //
4894        // MatchingRuleAssertion ::= SEQUENCE {
4895        //     ...
4896        //     type [2] AttributeDescription OPTIONAL,
4897        //     ...
4898        //
4899        // Store the matching rule ID
4900        super.transitions[LdapStatesEnum.EXTENSIBLE_MATCH_STATE.ordinal()][LdapCodecConstants.MATCHING_RULE_TYPE_TAG] =
4901            new GrammarTransition(
4902                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4903                LdapStatesEnum.TYPE_MATCHING_RULE_STATE,
4904                LdapCodecConstants.MATCHING_RULE_TYPE_TAG,
4905                new StoreTypeMatchingRule() );
4906
4907        // --------------------------------------------------------------------------------------------
4908        // Transition from Extensible Match to match value
4909        // --------------------------------------------------------------------------------------------
4910        // Filter ::= CHOICE {
4911        //     ...
4912        //     extensibleMatch  [9] MatchingRuleAssertion }
4913        //
4914        // MatchingRuleAssertion ::= SEQUENCE {
4915        //     ...
4916        //     matchValue [3] AssertionValue,
4917        //     ...
4918        //
4919        // Store the matching rule ID
4920        super.transitions[LdapStatesEnum.EXTENSIBLE_MATCH_STATE.ordinal()][LdapCodecConstants.MATCH_VALUE_TAG] =
4921            new GrammarTransition(
4922                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
4923                LdapStatesEnum.MATCH_VALUE_STATE,
4924                LdapCodecConstants.MATCH_VALUE_TAG,
4925                new StoreMatchValue() );
4926
4927        // --------------------------------------------------------------------------------------------
4928        // Transition from matching rule to type matching rule
4929        // --------------------------------------------------------------------------------------------
4930        // Filter ::= CHOICE {
4931        //     ...
4932        //     extensibleMatch  [9] MatchingRuleAssertion }
4933        //
4934        // MatchingRuleAssertion ::= SEQUENCE {
4935        //     ...
4936        //     type [2] AttributeDescription OPTIONAL,
4937        //     ...
4938        //
4939        // Store the matching rule ID
4940        super.transitions[LdapStatesEnum.MATCHING_RULE_STATE.ordinal()][LdapCodecConstants.MATCHING_RULE_TYPE_TAG] =
4941            new GrammarTransition(
4942                LdapStatesEnum.MATCHING_RULE_STATE,
4943                LdapStatesEnum.TYPE_MATCHING_RULE_STATE,
4944                LdapCodecConstants.MATCHING_RULE_TYPE_TAG,
4945                new StoreTypeMatchingRule() );
4946
4947        // --------------------------------------------------------------------------------------------
4948        // Transition from matching rule to match value
4949        // --------------------------------------------------------------------------------------------
4950        // Filter ::= CHOICE {
4951        //     ...
4952        //     extensibleMatch  [9] MatchingRuleAssertion }
4953        //
4954        // MatchingRuleAssertion ::= SEQUENCE {
4955        //     ...
4956        //     matchValue [3] AssertionValue,
4957        //     ...
4958        //
4959        // Store the matching rule ID
4960        super.transitions[LdapStatesEnum.MATCHING_RULE_STATE.ordinal()][LdapCodecConstants.MATCH_VALUE_TAG] =
4961            new GrammarTransition(
4962                LdapStatesEnum.MATCHING_RULE_STATE,
4963                LdapStatesEnum.MATCH_VALUE_STATE,
4964                LdapCodecConstants.MATCH_VALUE_TAG,
4965                new StoreMatchValue() );
4966
4967        // --------------------------------------------------------------------------------------------
4968        // Transition from matching type to match value
4969        // --------------------------------------------------------------------------------------------
4970        // Filter ::= CHOICE {
4971        //     ...
4972        //     extensibleMatch  [9] MatchingRuleAssertion }
4973        //
4974        // MatchingRuleAssertion ::= SEQUENCE {
4975        //     ...
4976        //     matchValue [3] AssertionValue,
4977        //     ...
4978        //
4979        // Store the matching rule ID
4980        super.transitions[LdapStatesEnum.TYPE_MATCHING_RULE_STATE.ordinal()][LdapCodecConstants.MATCH_VALUE_TAG] =
4981            new GrammarTransition(
4982                LdapStatesEnum.TYPE_MATCHING_RULE_STATE,
4983                LdapStatesEnum.MATCH_VALUE_STATE,
4984                LdapCodecConstants.MATCH_VALUE_TAG,
4985                new StoreMatchValue() );
4986
4987        // --------------------------------------------------------------------------------------------
4988        // Transition from match value to dnAttributes
4989        // --------------------------------------------------------------------------------------------
4990        // Filter ::= CHOICE {
4991        //     ...
4992        //     extensibleMatch  [9] MatchingRuleAssertion }
4993        //
4994        // MatchingRuleAssertion ::= SEQUENCE {
4995        //     ...
4996        //     dnAttributes [4] BOOLEAN DEFAULT FALSE }
4997        //
4998        // Store the dnAttributes flag
4999        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.DN_ATTRIBUTES_FILTER_TAG] =
5000            new GrammarTransition(
5001                LdapStatesEnum.MATCH_VALUE_STATE,
5002                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5003                LdapCodecConstants.DN_ATTRIBUTES_FILTER_TAG,
5004                new StoreMatchingRuleDnAttributes() );
5005
5006        // --------------------------------------------------------------------------------------------
5007        // Transition from match value to AND filter
5008        // --------------------------------------------------------------------------------------------
5009        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5010        //     ...
5011        //     filter Filter,
5012        //     ...
5013        //
5014        // Filter ::= CHOICE {
5015        //     and             [0] SET OF Filter,
5016        //     ...
5017        //
5018        // Init AND filter
5019        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
5020            new GrammarTransition(
5021                LdapStatesEnum.MATCH_VALUE_STATE,
5022                LdapStatesEnum.AND_STATE,
5023                LdapCodecConstants.AND_FILTER_TAG,
5024                new InitAndFilter() );
5025
5026        // --------------------------------------------------------------------------------------------
5027        // Transition from match value to OR filter
5028        // --------------------------------------------------------------------------------------------
5029        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5030        //     ...
5031        //     filter Filter,
5032        //     ...
5033        //
5034        // Filter ::= CHOICE {
5035        //     ...
5036        //     or              [1] SET OF Filter,
5037        //     ...
5038        //
5039        // Init OR filter
5040        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
5041            new GrammarTransition(
5042                LdapStatesEnum.MATCH_VALUE_STATE,
5043                LdapStatesEnum.OR_STATE,
5044                LdapCodecConstants.OR_FILTER_TAG,
5045                new InitOrFilter() );
5046
5047        // --------------------------------------------------------------------------------------------
5048        // Transition from match value to NOT filter
5049        // --------------------------------------------------------------------------------------------
5050        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5051        //     ...
5052        //     filter Filter,
5053        //     ...
5054        //
5055        // Filter ::= CHOICE {
5056        //     ...
5057        //     not             [2] SET OF Filter,
5058        //     ...
5059        //
5060        // Init NOT filter
5061        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
5062            new GrammarTransition(
5063                LdapStatesEnum.MATCH_VALUE_STATE,
5064                LdapStatesEnum.NOT_STATE,
5065                LdapCodecConstants.NOT_FILTER_TAG,
5066                new InitNotFilter() );
5067
5068        // --------------------------------------------------------------------------------------------
5069        // Transition from match value to Equality Match filter
5070        // --------------------------------------------------------------------------------------------
5071        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5072        //     ...
5073        //     filter Filter,
5074        //     ...
5075        //
5076        // Filter ::= CHOICE {
5077        //     ...
5078        //     equalityMatch   [3] AttributeValueAssertion,
5079        //     ...
5080        //
5081        // Init NOT filter
5082        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
5083            new GrammarTransition(
5084                LdapStatesEnum.MATCH_VALUE_STATE,
5085                LdapStatesEnum.EQUALITY_MATCH_STATE,
5086                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
5087                new InitEqualityMatchFilter() );
5088
5089        // --------------------------------------------------------------------------------------------
5090        // Transition from match value to Substrings filter
5091        // --------------------------------------------------------------------------------------------
5092        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5093        //     ...
5094        //     filter Filter,
5095        //     ...
5096        //
5097        // Filter ::= CHOICE {
5098        //     ...
5099        //     substrings     [4] SubstringFilter,
5100        //     ...
5101        //
5102        // Init Substrings filter
5103        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
5104            new GrammarTransition(
5105                LdapStatesEnum.MATCH_VALUE_STATE,
5106                LdapStatesEnum.SUBSTRING_FILTER_STATE,
5107                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
5108                new InitSubstringsFilter() );
5109
5110        // --------------------------------------------------------------------------------------------
5111        // Transition from match value to GreaterOrEqual filter
5112        // --------------------------------------------------------------------------------------------
5113        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5114        //     ...
5115        //     filter Filter,
5116        //     ...
5117        //
5118        // Filter ::= CHOICE {
5119        //     ...
5120        //     greaterOrEqual  [5] AttributeValueAssertion,
5121        //     ...
5122        //
5123        // Init Greater Or Equal filter
5124        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
5125            new GrammarTransition(
5126                LdapStatesEnum.MATCH_VALUE_STATE,
5127                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
5128                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
5129                new InitGreaterOrEqualFilter() );
5130
5131        // --------------------------------------------------------------------------------------------
5132        // Transition from match value to LessOrEqual filter
5133        // --------------------------------------------------------------------------------------------
5134        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5135        //     ...
5136        //     filter Filter,
5137        //     ...
5138        //
5139        // Filter ::= CHOICE {
5140        //     ...
5141        //     LessOrEqual    [6] AttributeValueAssertion,
5142        //     ...
5143        //
5144        // Init Less Or Equal filter
5145        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
5146            new GrammarTransition(
5147                LdapStatesEnum.MATCH_VALUE_STATE,
5148                LdapStatesEnum.LESS_OR_EQUAL_STATE,
5149                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
5150                new InitLessOrEqualFilter() );
5151
5152        // --------------------------------------------------------------------------------------------
5153        // Transition from match value to Present filter
5154        // --------------------------------------------------------------------------------------------
5155        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5156        //     ...
5157        //     filter Filter,
5158        //     ...
5159        //
5160        // Filter ::= CHOICE {
5161        //     ...
5162        //     present        [7] AttributeDescription,
5163        //     ...
5164        //
5165        // Init present filter
5166        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
5167            new GrammarTransition(
5168                LdapStatesEnum.MATCH_VALUE_STATE,
5169                LdapStatesEnum.PRESENT_STATE,
5170                LdapCodecConstants.PRESENT_FILTER_TAG,
5171                new InitPresentFilter() );
5172
5173        // --------------------------------------------------------------------------------------------
5174        // Transition from match value to Approx Match filter
5175        // --------------------------------------------------------------------------------------------
5176        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5177        //     ...
5178        //     filter Filter,
5179        //     ...
5180        //
5181        // Filter ::= CHOICE {
5182        //     ...
5183        //     approxMatch     [8] AttributeValueAssertion,
5184        //     ...
5185        //
5186        // Init Approx Match filter
5187        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
5188            new GrammarTransition(
5189                LdapStatesEnum.MATCH_VALUE_STATE,
5190                LdapStatesEnum.APPROX_MATCH_STATE,
5191                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
5192                new InitApproxMatchFilter() );
5193
5194        // --------------------------------------------------------------------------------------------
5195        // Transition from match value to Extensible Match filter
5196        // --------------------------------------------------------------------------------------------
5197        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5198        //     ...
5199        //     filter Filter,
5200        //     ...
5201        //
5202        // Filter ::= CHOICE {
5203        //     ...
5204        //     extensibleMatch  [9] MatchingRuleAssertion,
5205        //     ...
5206        //
5207        // Init Assertion Value Filter filter
5208        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
5209            new GrammarTransition(
5210                LdapStatesEnum.MATCH_VALUE_STATE,
5211                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
5212                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
5213                new InitExtensibleMatchFilter() );
5214
5215        // --------------------------------------------------------------------------------------------
5216        // Transition from match value to Attribute Description List
5217        // --------------------------------------------------------------------------------------------
5218        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5219        //     ...
5220        //     filter      Filter,
5221        //     attributes  AttributeDescriptionList }
5222        //
5223        // AttributeDescriptionList ::= SEQUENCE OF
5224        //     AttributeDescription
5225        //
5226        // Init attribute description list
5227        super.transitions[LdapStatesEnum.MATCH_VALUE_STATE.ordinal()][SEQUENCE.getValue()] =
5228            new GrammarTransition(
5229                LdapStatesEnum.MATCH_VALUE_STATE,
5230                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
5231                SEQUENCE,
5232                new InitSearchRequestAttributeDescList() );
5233
5234        // --------------------------------------------------------------------------------------------
5235        // Transition from dnAttributes to AND filter
5236        // --------------------------------------------------------------------------------------------
5237        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5238        //     ...
5239        //     filter Filter,
5240        //     ...
5241        //
5242        // Filter ::= CHOICE {
5243        //     and             [0] SET OF Filter,
5244        //     ...
5245        //
5246        // Init AND filter
5247        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.AND_FILTER_TAG] =
5248            new GrammarTransition(
5249                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5250                LdapStatesEnum.AND_STATE,
5251                LdapCodecConstants.AND_FILTER_TAG,
5252                new InitAndFilter() );
5253
5254        // --------------------------------------------------------------------------------------------
5255        // Transition from dnAttributes to OR filter
5256        // --------------------------------------------------------------------------------------------
5257        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5258        //     ...
5259        //     filter Filter,
5260        //     ...
5261        //
5262        // Filter ::= CHOICE {
5263        //     ...
5264        //     or              [1] SET OF Filter,
5265        //     ...
5266        //
5267        // Init OR filter
5268        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.OR_FILTER_TAG] =
5269            new GrammarTransition(
5270                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5271                LdapStatesEnum.OR_STATE,
5272                LdapCodecConstants.OR_FILTER_TAG,
5273                new InitOrFilter() );
5274
5275        // --------------------------------------------------------------------------------------------
5276        // Transition from dnAttributes to NOT filter
5277        // --------------------------------------------------------------------------------------------
5278        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5279        //     ...
5280        //     filter Filter,
5281        //     ...
5282        //
5283        // Filter ::= CHOICE {
5284        //     ...
5285        //     not             [2] SET OF Filter,
5286        //     ...
5287        //
5288        // Init NOT filter
5289        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.NOT_FILTER_TAG] =
5290            new GrammarTransition(
5291                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5292                LdapStatesEnum.NOT_STATE,
5293                LdapCodecConstants.NOT_FILTER_TAG,
5294                new InitNotFilter() );
5295
5296        // --------------------------------------------------------------------------------------------
5297        // Transition from dnAttributes to Equality Match filter
5298        // --------------------------------------------------------------------------------------------
5299        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5300        //     ...
5301        //     filter Filter,
5302        //     ...
5303        //
5304        // Filter ::= CHOICE {
5305        //     ...
5306        //     equalityMatch   [3] AttributeValueAssertion,
5307        //     ...
5308        //
5309        // Init NOT filter
5310        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG] =
5311            new GrammarTransition(
5312                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5313                LdapStatesEnum.EQUALITY_MATCH_STATE,
5314                LdapCodecConstants.EQUALITY_MATCH_FILTER_TAG,
5315                new InitEqualityMatchFilter() );
5316
5317        // --------------------------------------------------------------------------------------------
5318        // Transition from dnAttributes to Substrings filter
5319        // --------------------------------------------------------------------------------------------
5320        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5321        //     ...
5322        //     filter Filter,
5323        //     ...
5324        //
5325        // Filter ::= CHOICE {
5326        //     ...
5327        //     substrings     [4] SubstringFilter,
5328        //     ...
5329        //
5330        // Init Substrings filter
5331        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.SUBSTRINGS_FILTER_TAG] =
5332            new GrammarTransition(
5333                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5334                LdapStatesEnum.SUBSTRING_FILTER_STATE,
5335                LdapCodecConstants.SUBSTRINGS_FILTER_TAG,
5336                new InitSubstringsFilter() );
5337
5338        // --------------------------------------------------------------------------------------------
5339        // Transition from dnAttributes to GreaterOrEqual filter
5340        // --------------------------------------------------------------------------------------------
5341        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5342        //     ...
5343        //     filter Filter,
5344        //     ...
5345        //
5346        // Filter ::= CHOICE {
5347        //     ...
5348        //     greaterOrEqual  [5] AttributeValueAssertion,
5349        //     ...
5350        //
5351        // Init Greater Or Equal filter
5352        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG] =
5353            new GrammarTransition(
5354                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5355                LdapStatesEnum.GREATER_OR_EQUAL_STATE,
5356                LdapCodecConstants.GREATER_OR_EQUAL_FILTER_TAG,
5357                new InitGreaterOrEqualFilter() );
5358
5359        // --------------------------------------------------------------------------------------------
5360        // Transition from dnAttributes to LessOrEqual filter
5361        // --------------------------------------------------------------------------------------------
5362        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5363        //     ...
5364        //     filter Filter,
5365        //     ...
5366        //
5367        // Filter ::= CHOICE {
5368        //     ...
5369        //     LessOrEqual    [6] AttributeValueAssertion,
5370        //     ...
5371        //
5372        // Init Less Or Equal filter
5373        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG] =
5374            new GrammarTransition(
5375                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5376                LdapStatesEnum.LESS_OR_EQUAL_STATE,
5377                LdapCodecConstants.LESS_OR_EQUAL_FILTER_TAG,
5378                new InitLessOrEqualFilter() );
5379
5380        // --------------------------------------------------------------------------------------------
5381        // Transition from dnAttributes to Present filter
5382        // --------------------------------------------------------------------------------------------
5383        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5384        //     ...
5385        //     filter Filter,
5386        //     ...
5387        //
5388        // Filter ::= CHOICE {
5389        //     ...
5390        //     present        [7] AttributeDescription,
5391        //     ...
5392        //
5393        // Init present filter
5394        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.PRESENT_FILTER_TAG] =
5395            new GrammarTransition(
5396                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5397                LdapStatesEnum.PRESENT_STATE,
5398                LdapCodecConstants.PRESENT_FILTER_TAG,
5399                new InitPresentFilter() );
5400
5401        // --------------------------------------------------------------------------------------------
5402        // Transition from dnAttributes to Approx Match filter
5403        // --------------------------------------------------------------------------------------------
5404        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5405        //     ...
5406        //     filter Filter,
5407        //     ...
5408        //
5409        // Filter ::= CHOICE {
5410        //     ...
5411        //     approxMatch     [8] AttributeValueAssertion,
5412        //     ...
5413        //
5414        // Init Approx Match filter
5415        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.APPROX_MATCH_FILTER_TAG] =
5416            new GrammarTransition(
5417                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5418                LdapStatesEnum.APPROX_MATCH_STATE,
5419                LdapCodecConstants.APPROX_MATCH_FILTER_TAG,
5420                new InitApproxMatchFilter() );
5421
5422        // --------------------------------------------------------------------------------------------
5423        // Transition from dnAttributes to Extensible Match filter
5424        // --------------------------------------------------------------------------------------------
5425        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5426        //     ...
5427        //     filter Filter,
5428        //     ...
5429        //
5430        // Filter ::= CHOICE {
5431        //     ...
5432        //     extensibleMatch  [9] MatchingRuleAssertion,
5433        //     ...
5434        //
5435        // Init Assertion Value Filter filter
5436        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG] =
5437            new GrammarTransition(
5438                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5439                LdapStatesEnum.EXTENSIBLE_MATCH_STATE,
5440                LdapCodecConstants.EXTENSIBLE_MATCH_FILTER_TAG,
5441                new InitExtensibleMatchFilter() );
5442
5443        // --------------------------------------------------------------------------------------------
5444        // Transition from dnAttributes to Attribute Description List
5445        // --------------------------------------------------------------------------------------------
5446        // SearchRequest ::= [APPLICATION 3] SEQUENCE {
5447        //     ...
5448        //     filter      Filter,
5449        //     attributes  AttributeDescriptionList }
5450        //
5451        // AttributeDescriptionList ::= SEQUENCE OF
5452        //     AttributeDescription
5453        //
5454        // Init attribute description list
5455        super.transitions[LdapStatesEnum.DN_ATTRIBUTES_STATE.ordinal()][SEQUENCE.getValue()] =
5456            new GrammarTransition(
5457                LdapStatesEnum.DN_ATTRIBUTES_STATE,
5458                LdapStatesEnum.ATTRIBUTE_DESCRIPTION_LIST_STATE,
5459                SEQUENCE,
5460                new InitSearchRequestAttributeDescList() );
5461    }
5462
5463
5464    /**
5465     * Get the instance of this grammar
5466     *
5467     * @return An instance on the LdapMessage Grammar
5468     */
5469    @SuppressWarnings("rawtypes")
5470    public static Grammar getInstance()
5471    {
5472        return instance;
5473    }
5474}