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;
21  
22  
23  import org.apache.directory.api.ldap.model.entry.Value;
24  import org.apache.directory.api.ldap.model.name.Dn;
25  
26  
27  /**
28   * Compare request protocol message that tests an entry to see if it abides by
29   * an attribute value assertion.
30   * 
31   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
32   */
33  public interface CompareRequest extends SingleReplyRequest, AbandonableRequest
34  {
35      /**
36       * Gets the distinguished name of the entry to be compared using the
37       * attribute value assertion.
38       * 
39       * @return the Dn of the compared entry.
40       */
41      Dn getName();
42  
43  
44      /**
45       * Sets the distinguished name of the entry to be compared using the
46       * attribute value assertion.
47       * 
48       * @param name the Dn of the compared entry.
49       * @return The CompareRequest instance
50       */
51      CompareRequest setName( Dn name );
52  
53  
54      /**
55       * Gets the attribute value to use in making the comparison.
56       * 
57       * @return the attribute value to used in comparison.
58       */
59      Value<?> getAssertionValue();
60  
61  
62      /**
63       * Sets the attribute value to use in the comparison.
64       * 
65       * @param value the attribute value used in comparison.
66       * @return The CompareRequest instance
67       */
68      CompareRequest setAssertionValue( String value );
69  
70  
71      /**
72       * Sets the attribute value to use in the comparison.
73       * 
74       * @param value the attribute value used in comparison.
75       * @return The CompareRequest instance
76       */
77      CompareRequest setAssertionValue( byte[] value );
78  
79  
80      /**
81       * Gets the attribute id use in making the comparison.
82       * 
83       * @return the attribute id used in comparison.
84       */
85      String getAttributeId();
86  
87  
88      /**
89       * Sets the attribute id used in the comparison.
90       * 
91       * @param attrId the attribute id used in comparison.
92       * @return The CompareRequest instance
93       */
94      CompareRequest setAttributeId( String attrId );
95  
96  
97      /**
98       * {@inheritDoc}
99       */
100     CompareRequest setMessageId( int messageId );
101 
102 
103     /**
104      * {@inheritDoc}
105      */
106     CompareRequest addControl( Control control );
107 
108 
109     /**
110      * {@inheritDoc}
111      */
112     CompareRequest addAllControls( Control[] controls );
113 
114 
115     /**
116      * {@inheritDoc}
117      */
118     CompareRequest removeControl( Control control );
119 }