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.model.message.controls; 021 022 023import org.apache.directory.api.ldap.model.message.Control; 024 025 026/** 027 * A request/response control used to implement a simple paging of search 028 * results. This is an implementation of RFC 2696 : 029 * <a href="http://www.faqs.org/rfcs/rfc2696.html">LDAP Control Extension for Simple Paged Results Manipulation</a> 030 * <br> 031 * <pre> 032 * This control is included in the searchRequest and searchResultDone 033 * messages as part of the controls field of the LDAPMessage, as defined 034 * in Section 4.1.12 of [LDAPv3]. The structure of this control is as 035 * follows: 036 * 037 * pagedResultsControl ::= SEQUENCE { 038 * controlType 1.2.840.113556.1.4.319, 039 * criticality BOOLEAN DEFAULT FALSE, 040 * controlValue searchControlValue 041 * } 042 * 043 * The searchControlValue is an OCTET STRING wrapping the BER-encoded 044 * version of the following SEQUENCE: 045 * 046 * realSearchControlValue ::= SEQUENCE { 047 * size INTEGER (0..maxInt), 048 * -- requested page size from client 049 * -- result set size estimate from server 050 * cookie OCTET STRING 051 * } 052 * 053 * </pre> 054 * 055 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a> 056 */ 057public interface PagedResults extends Control 058{ 059 /** The Paged Search Control OID */ 060 String OID = "1.2.840.113556.1.4.319"; 061 062 063 /** 064 * @return The requested or returned number of entries 065 */ 066 int getSize(); 067 068 069 /** 070 * Set the number of entry requested or returned 071 * 072 * @param size The number of entries 073 */ 074 void setSize( int size ); 075 076 077 /** 078 * @return The stored cookie 079 */ 080 byte[] getCookie(); 081 082 083 /** 084 * Set the cookie 085 * 086 * @param cookie The cookie to store in this control 087 */ 088 void setCookie( byte[] cookie ); 089 090 091 /** 092 * @return The integer value for the current cookie 093 */ 094 int getCookieValue(); 095}