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  package org.apache.directory.api.ldap.model.message.controls;
20  
21  
22  import org.apache.directory.api.ldap.model.message.Control;
23  
24  
25  /**
26   * A persistence search object
27   *
28   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
29   */
30  public interface PersistentSearch extends Control
31  {
32      /** This control OID */
33      String OID = "2.16.840.1.113730.3.4.3";
34  
35      /** Min and Max values for the possible combined change types */
36      int CHANGE_TYPES_MIN = ChangeType.ADD.getValue();
37  
38      /** The maximum value for the possible combined changes type */
39      int CHANGE_TYPES_MAX = ChangeType.ADD.getValue()
40          | ChangeType.DELETE.getValue()
41          | ChangeType.MODIFY.getValue()
42          | ChangeType.MODDN.getValue();
43  
44  
45      /**
46       * Sets the ChangesOnly flag
47       *   
48       * @param changesOnly The ChangesOnly flag
49       */
50      void setChangesOnly( boolean changesOnly );
51  
52  
53      /**
54       * @return <TT>TRUE</TT> if the changesOnly flag is set
55       */
56      boolean isChangesOnly();
57  
58  
59      /**
60       * Sets the return entry changes flag
61       * 
62       * @param returnECs the return entry changes flag
63       */
64      void setReturnECs( boolean returnECs );
65  
66  
67      /**
68       * @return <TT>TRUE</TT> if the return entry changes flag is set
69       */
70      boolean isReturnECs();
71  
72  
73      /**
74       * Set the changeType value we want to get back ( a combinaison of Add, Delete,
75       * Modify and ModifyDN)
76       *  
77       * @param changeTypes The changeType values (Add, Modify, Delete and ModifyDn)
78       */
79      void setChangeTypes( int changeTypes );
80  
81  
82      /**
83       * @return The changeTypes value
84       */
85      int getChangeTypes();
86  
87  
88      /**
89       * For each changeType, tells if the notification is enabled
90       * 
91       * @param changeType The ChnageType we are interested in
92       * @return <T>TRUE<T> if the notification is set for this ChangeType
93       */
94      boolean isNotificationEnabled( ChangeType changeType );
95  
96  
97      /**
98       * Sets the notification for a given changeType 
99       * @param changeType The chnageType we want some notification to be set
100      */
101     void enableNotification( ChangeType changeType );
102 
103 
104     /**
105      * Unsets the notification for a given changeType 
106      * @param changeType The chnageType we want some notification to be unset
107      */
108     void disableNotification( ChangeType changeType );
109 }