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.codec.api.LdapApiService;
25  import org.apache.directory.api.ldap.extras.controls.syncrepl.syncDone.SyncDoneValue;
26  
27  
28  /**
29   * 
30   * ASN.1 container for SyncDoneValueControl.
31   *
32   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
33   */
34  public class SyncDoneValueContainer extends AbstractContainer
35  {
36      /** syncDoneValue*/
37      private SyncDoneValue control;
38  
39      private LdapApiService codec;
40  
41  
42      /**
43       * 
44       * Creates a new SyncDoneValueControlContainer object.
45       *
46       */
47      public SyncDoneValueContainer( LdapApiService codec )
48      {
49          super();
50          this.codec = codec;
51          this.control = new SyncDoneValueDecorator( codec );
52          grammar = SyncDoneValueGrammar.getInstance();
53          setTransition( SyncDoneValueStatesEnum.START_STATE );
54      }
55  
56  
57      /**
58       * 
59       * Creates a new SyncDoneValueControlContainer object.
60       *
61       */
62      public SyncDoneValueContainer( LdapApiService codec, SyncDoneValue control )
63      {
64          super();
65          this.codec = codec;
66          this.control = control;
67          grammar = SyncDoneValueGrammar.getInstance();
68          setTransition( SyncDoneValueStatesEnum.START_STATE );
69      }
70  
71  
72      /**
73       * @return the SyncDoneValueControlCodec object
74       */
75      public SyncDoneValue getSyncDoneValueControl()
76      {
77          return control;
78      }
79  
80  
81      /**
82       * Set a SyncDoneValueControlCodec Object into the container. It will be completed
83       * by the ldapDecoder.
84       * 
85       * @param control the SyncDoneValueControlCodec to set.
86       */
87      public void setSyncDoneValueControl( SyncDoneValue control )
88      {
89          this.control = control;
90      }
91  
92  
93      public LdapApiService getCodecService()
94      {
95          return codec;
96      }
97  
98  
99      /**
100      * clean the container
101      */
102     @Override
103     public void clean()
104     {
105         super.clean();
106         control = null;
107     }
108 
109 }