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.syncState.SyncStateValue;
25  
26  
27  /**
28   * A container for the SyncStateValue control
29   *  
30   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
31   */
32  public class SyncStateValueContainer extends AbstractContainer
33  {
34      /** SyncStateValueControl */
35      private SyncStateValue control;
36  
37  
38      /**
39       * Creates a new SyncStateValueControlContainer object. We will store one grammar,
40       * it's enough ...
41       */
42      public SyncStateValueContainer()
43      {
44          super();
45          setGrammar( SyncStateValueGrammar.getInstance() );
46          setTransition( SyncStateValueStatesEnum.START_STATE );
47      }
48  
49  
50      /**
51       * Creates a new SyncStateValueControlContainer object. We will store one grammar,
52       * it's enough ...
53       * 
54       * @param control The control to store
55       */
56      public SyncStateValueContainer( SyncStateValue control )
57      {
58          super();
59          this.control = control;
60          setGrammar( SyncStateValueGrammar.getInstance() );
61          setTransition( SyncStateValueStatesEnum.START_STATE );
62      }
63  
64  
65      /**
66       * @return Returns the syncStateValue control.
67       */
68      public SyncStateValue getSyncStateValueControl()
69      {
70          return control;
71      }
72  
73  
74      /**
75       * Set a SyncStateValueControl Object into the container. It will be completed by
76       * the ldapDecoder.
77       * 
78       * @param control the SyncStateValueControl to set.
79       */
80      public void setSyncStateValueControl( SyncStateValue control )
81      {
82          this.control = control;
83      }
84  
85  
86      /**
87       * Clean the container
88       */
89      @Override
90      public void clean()
91      {
92          super.clean();
93          control = null;
94      }
95  }