001/*
002 *   Licensed to the Apache Software Foundation (ASF) under one
003 *   or more contributor license agreements.  See the NOTICE file
004 *   distributed with this work for additional information
005 *   regarding copyright ownership.  The ASF licenses this file
006 *   to you under the Apache License, Version 2.0 (the
007 *   "License"); you may not use this file except in compliance
008 *   with the License.  You may obtain a copy of the License at
009 *
010 *     http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *   Unless required by applicable law or agreed to in writing,
013 *   software distributed under the License is distributed on an
014 *   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 *   KIND, either express or implied.  See the License for the
016 *   specific language governing permissions and limitations
017 *   under the License.
018 *
019 */
020package org.apache.directory.api.ldap.extras.controls.vlv;
021
022
023import org.apache.directory.api.ldap.model.message.Control;
024
025
026/**
027 * Virtual List View control as specified in draft-ietf-ldapext-ldapv3-vlv-09.
028 * 
029 *  VirtualListViewRequest ::= SEQUENCE {
030 *         beforeCount    INTEGER (0..maxInt),
031 *         afterCount     INTEGER (0..maxInt),
032 *         target       CHOICE {
033 *                        byOffset        [0] SEQUENCE {
034 *                             offset          INTEGER (1 .. maxInt),
035 *                             contentCount    INTEGER (0 .. maxInt) },
036 *                        greaterThanOrEqual [1] AssertionValue },
037 *         contextID     OCTET STRING OPTIONAL }
038 * 
039 * Note : the target is set accordingly to which of the setOffset() or
040 * assertionValue() method is called last.
041 *
042 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
043 */
044public interface VirtualListViewRequest extends Control
045{
046    /** This control OID */
047    String OID = "2.16.840.1.113730.3.4.9";
048
049
050    /**
051     * @return The number of entries before the target entry that are going to be sent
052     */
053    int getBeforeCount();
054
055
056    /**
057     * @param beforeCount Set the number of entries to be returned before the target entry
058     */
059    void setBeforeCount( int beforeCount );
060
061
062    /**
063     * @return The number of entries after the target entry that are going to be sent
064     */
065    int getAfterCount();
066
067
068    /**
069     * @param afterCount Set the number of entries to be returned after the target entry
070     */
071    void setAfterCount( int afterCount );
072
073
074    /**
075     * @return The position of the target entry
076     */
077    int getOffset();
078
079
080    /**
081     * @param offset the position of the target entry
082     */
083    void setOffset( int offset );
084
085
086    /**
087     * @return The number of expected entries
088     */
089    int getContentCount();
090
091
092    /**
093     * @param contentCount The number of entries
094     */
095    void setContentCount( int contentCount );
096
097
098    /**
099     * @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}