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.vlv;
21
22
23 import org.apache.directory.api.ldap.model.message.Control;
24
25
26 /**
27 * Virtual List View control as specified in draft-ietf-ldapext-ldapv3-vlv-09.
28 *
29 * VirtualListViewRequest ::= SEQUENCE {
30 * beforeCount INTEGER (0..maxInt),
31 * afterCount INTEGER (0..maxInt),
32 * target CHOICE {
33 * byOffset [0] SEQUENCE {
34 * offset INTEGER (1 .. maxInt),
35 * contentCount INTEGER (0 .. maxInt) },
36 * greaterThanOrEqual [1] AssertionValue },
37 * contextID OCTET STRING OPTIONAL }
38 *
39 * Note : the target is set accordingly to which of the setOffset() or
40 * assertionValue() method is called last.
41 *
42 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
43 */
44 public interface VirtualListViewRequest extends Control
45 {
46 /** This control OID */
47 String OID = "2.16.840.1.113730.3.4.9";
48
49
50 /**
51 * @return The number of entries before the target entry that are going to be sent
52 */
53 int getBeforeCount();
54
55
56 /**
57 * @param beforeCount Set the number of entries to be returned before the target entry
58 */
59 void setBeforeCount( int beforeCount );
60
61
62 /**
63 * @return The number of entries after the target entry that are going to be sent
64 */
65 int getAfterCount();
66
67
68 /**
69 * @param afterCount Set the number of entries to be returned after the target entry
70 */
71 void setAfterCount( int afterCount );
72
73
74 /**
75 * @return The position of the target entry
76 */
77 int getOffset();
78
79
80 /**
81 * @param offset the position of the target entry
82 */
83 void setOffset( int offset );
84
85
86 /**
87 * @return The number of expected entries
88 */
89 int getContentCount();
90
91
92 /**
93 * @param contentCount The number of entries
94 */
95 void setContentCount( int contentCount );
96
97
98 /**
99 * @return The AssertionValue
100 */
101 byte[] getAssertionValue();
102
103
104 /**
105 * @param assertionValue Set the AssertionValue
106 */
107 void setAssertionValue( byte[] assertionValue );
108
109
110 /**
111 * @return The ID used for this request
112 */
113 byte[] getContextId();
114
115
116 /**
117 * @param contextId Set the context ID
118 */
119 void setContextId( byte[] contextId );
120
121
122 /**
123 * @return <code>true</code> if the VLV target is an offset, false otherwise
124 */
125 boolean hasOffset();
126
127
128 /**
129 * @return <code>true</code> if the VLV target is an assertionValue, false otherwise
130 */
131 boolean hasAssertionValue();
132 }