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.model.message.controls;
21  
22  
23  import org.apache.directory.api.ldap.model.message.Control;
24  import org.apache.directory.api.ldap.model.name.Dn;
25  
26  
27  /**
28   * A response control that may be returned by Persistent Search entry responses.
29   * It contains addition change information to describe the exact change that
30   * occurred to an entry. The exact details of this control are covered in section
31   * 5 of this (yes) expired draft: <a
32   * href="http://www3.ietf.org/proceedings/01aug/I-D/draft-ietf-ldapext-psearch-03.txt">
33   * Persistent Search Draft v03</a> which is printed out below for convenience:
34   *
35   * <pre>
36   *    5.  Entry Change Notification Control
37   *
38   *    This control provides additional information about the change the caused
39   *    a particular entry to be returned as the result of a persistent search.
40   *    The controlType is &quot;2.16.840.1.113730.3.4.7&quot;.  If the client set the
41   *    returnECs boolean to TRUE in the PersistentSearch control, servers MUST
42   *    include an EntryChangeNotification control in the Controls portion of
43   *    each SearchResultEntry that is returned due to an entry being added,
44   *    deleted, or modified.
45   *
46   *               EntryChangeNotification ::= SEQUENCE
47   *               {
48   *                         changeType ENUMERATED
49   *                         {
50   *                                 add             (1),
51   *                                 delete          (2),
52   *                                 modify          (4),
53   *                                 modDN           (8)
54   *                         },
55   *                         previousDN   LDAPDN OPTIONAL,     -- modifyDN ops. only
56   *                         changeNumber INTEGER OPTIONAL     -- if supported
57   *               }
58   *
59   *    changeType indicates what LDAP operation caused the entry to be
60   *    returned.
61   *
62   *    previousDN is present only for modifyDN operations and gives the Dn of
63   *    the entry before it was renamed and/or moved.  Servers MUST include this
64   *    optional field only when returning change notifications as a result of
65   *    modifyDN operations.
66   *
67   *    changeNumber is the change number [CHANGELOG] assigned by a server for
68   *    the change.  If a server supports an LDAP Change Log it SHOULD include
69   *    this field.
70   * </pre>
71   *
72   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
73   */
74  public interface EntryChange extends Control
75  {
76      int UNDEFINED_CHANGE_NUMBER = -1;
77  
78      /** The EntryChange control */
79      String OID = "2.16.840.1.113730.3.4.7";
80  
81  
82      /**
83       * @return The ChangeType
84       */
85      ChangeType getChangeType();
86  
87  
88      /**
89       * Set the ChangeType
90       *
91       * @param changeType Add, Delete; Modify or ModifyDN
92       */
93      void setChangeType( ChangeType changeType );
94  
95  
96      Dn getPreviousDn();
97  
98  
99      void setPreviousDn( Dn previousDn );
100 
101 
102     long getChangeNumber();
103 
104 
105     void setChangeNumber( long changeNumber );
106 }