View Javadoc
1   /*
2    *  Licensed to the Apache Software Foundation (ASF) under one
3    *  or more contributor license agreements.  See the NOTICE file
4    *  distributed with this work for additional information
5    *  regarding copyright ownership.  The ASF licenses this file
6    *  to you under the Apache License, Version 2.0 (the
7    *  "License"); you may not use this file except in compliance
8    *  with the License.  You may obtain a copy of the License at
9    *  
10   *    http://www.apache.org/licenses/LICENSE-2.0
11   *  
12   *  Unless required by applicable law or agreed to in writing,
13   *  software distributed under the License is distributed on an
14   *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   *  KIND, either express or implied.  See the License for the
16   *  specific language governing permissions and limitations
17   *  under the License. 
18   *  
19   */
20  package org.apache.directory.api.ldap.extras.controls.syncrepl_impl;
21  
22  
23  import org.apache.directory.api.asn1.ber.AbstractContainer;
24  import org.apache.directory.api.ldap.extras.controls.syncrepl.syncInfoValue.SyncRequestValue;
25  
26  
27  /**
28   * A container for the SyncRequestValue control
29   *  
30   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
31   */
32  public class SyncRequestValueContainer extends AbstractContainer
33  {
34      /** SyncRequestValueControl */
35      private SyncRequestValue control;
36  
37  
38      /**
39       * Creates a new SyncRequestValueControlContainer object. We will store one grammar,
40       * it's enough ...
41       */
42      public SyncRequestValueContainer()
43      {
44          super();
45          grammar = SyncRequestValueGrammar.getInstance();
46          setTransition( SyncRequestValueStatesEnum.START_STATE );
47      }
48  
49  
50      /**
51       * Creates a new SyncRequestValueControlContainer object. We will store one grammar,
52       * it's enough ...
53       */
54      public SyncRequestValueContainer( SyncRequestValue control )
55      {
56          super();
57          this.control = control;
58          grammar = SyncRequestValueGrammar.getInstance();
59          setTransition( SyncRequestValueStatesEnum.START_STATE );
60      }
61  
62  
63      /**
64       * @return Returns the syncRequestValue control.
65       */
66      public SyncRequestValue getSyncRequestValueControl()
67      {
68          return control;
69      }
70  
71  
72      /**
73       * Set a SyncRequestValueControl Object into the container. It will be completed by
74       * the ldapDecoder.
75       * 
76       * @param control the SyncRequestValueControl to set.
77       */
78      public void setSyncRequestValueControl( SyncRequestValue control )
79      {
80          this.control = control;
81      }
82  
83  
84      /**
85       * Clean the container
86       */
87      public void clean()
88      {
89          super.clean();
90          control = null;
91      }
92  }