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   *    https://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.ad;
21  
22  import org.apache.directory.api.ldap.model.message.Control;
23  
24  
25  /**
26   * The DirSync request control, as described in http://tools.ietf.org/html/draft-armijo-ldap-dirsync-00.
27   * Here is the ASN/1 description of the SearchRequest control :
28   *
29   * <pre>
30   * Repl    Control ::= SEQUENCE {
31   *     controlType             1.2.840.113556.1.4.841
32   *     controlValue            replControlValue
33   *     criticality             TRUE
34   * }
35   * </pre>
36   *
37   * the control value is :
38   *
39   * <pre>
40   * Client side :
41   * realReplControlValue ::= SEQUENCE {
42   *     parentsFirst            integer
43   *     maxAttributeCount       integer
44   *     cookie                  OCTET STRING
45   * }
46   * </pre>
47   *
48   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
49   *
50   */
51  public interface AdDirSyncRequest extends Control
52  {
53      /** This control OID */
54      String OID = "1.2.840.113556.1.4.841";
55  
56      /**
57       * @return 1 if the parents of the children comes before their children
58       */
59      int getParentsFirst();
60  
61  
62      /**
63       * Tell the server that it should send the parents of the children before
64       * their children.
65       * NOTE: it should have been a boolean, it's an integer instead.
66       *
67       * @param parentsFirst When set to 1, will return the parents before children
68       */
69      void setParentsFirst( int parentsFirst );
70  
71  
72      /**
73       * @return The maximum attribute count to be returned
74       */
75      int getMaxAttributeCount();
76  
77  
78      /**
79       * @param maxAttributeCount The maximum attribute count to be returned
80       */
81      void setMaxAttributeCount( int maxAttributeCount );
82  
83  
84      /**
85       * @return The cookie used while processing the successive DirSync operations
86       */
87      byte[] getCookie();
88  
89  
90      /**
91       * @param cookie The cookie to send to the server. It's the value found in the response control. Should be null
92       * for the first control.
93       */
94      void setCookie( byte[] cookie );
95  }