Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 42230 invoked from network); 27 Jan 2011 02:59:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 27 Jan 2011 02:59:03 -0000 Received: (qmail 78417 invoked by uid 500); 27 Jan 2011 02:59:03 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 78364 invoked by uid 500); 27 Jan 2011 02:59:02 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 78357 invoked by uid 99); 27 Jan 2011 02:59:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 02:59:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Jan 2011 02:59:00 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 40E2B2388A38; Thu, 27 Jan 2011 02:58:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1063969 - /directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java Date: Thu, 27 Jan 2011 02:58:39 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110127025839.40E2B2388A38@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: akarasulu Date: Thu Jan 27 02:58:38 2011 New Revision: 1063969 URL: http://svn.apache.org/viewvc?rev=1063969&view=rev Log: extracting interface for PagedResults control Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java Added: directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java?rev=1063969&view=auto ============================================================================== --- directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java (added) +++ directory/shared/trunk/ldap/src/main/java/org/apache/directory/shared/ldap/codec/search/controls/pagedSearch/PagedResults.java Thu Jan 27 02:58:38 2011 @@ -0,0 +1,91 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + */ +package org.apache.directory.shared.ldap.codec.search.controls.pagedSearch; + + +import org.apache.directory.shared.ldap.model.message.Control; + + +/** + * A request/response control used to implement a simple paging of search + * results. This is an implementation of RFC 2696 : + * LDAP Control Extension for Simple Paged Results Manipulation + *
+ *
+ *    This control is included in the searchRequest and searchResultDone
+ *    messages as part of the controls field of the LDAPMessage, as defined
+ *    in Section 4.1.12 of [LDAPv3]. The structure of this control is as
+ *    follows:
+ *
+ * pagedResultsControl ::= SEQUENCE {
+ *         controlType     1.2.840.113556.1.4.319,
+ *         criticality     BOOLEAN DEFAULT FALSE,
+ *         controlValue    searchControlValue
+ * }
+ *
+ * The searchControlValue is an OCTET STRING wrapping the BER-encoded
+ * version of the following SEQUENCE:
+ *
+ * realSearchControlValue ::= SEQUENCE {
+ *         size            INTEGER (0..maxInt),
+ *                                 -- requested page size from client
+ *                                 -- result set size estimate from server
+ *         cookie          OCTET STRING
+ * }
+ *
+ * 
+ * + * @author Apache Directory Project + */ +public interface PagedResults extends Control +{ + /** The Paged Search Control OID */ + String OID = "1.2.840.113556.1.4.319"; + + + /** + * @return The requested or returned number of entries + */ + int getSize(); + + /** + * Set the number of entry requested or returned + * + * @param size The number of entries + */ + void setSize( int size ); + + /** + * @return The stored cookie + */ + byte[] getCookie(); + + /** + * Set the cookie + * + * @param cookie The cookie to store in this control + */ + void setCookie( byte[] cookie ); + + /** + * @return The integer value for the current cookie + */ + int getCookieValue(); +}