Class PagedResultsControl

  • All Implemented Interfaces:
    Control, RequestControl, ResponseControl

    public class PagedResultsControl
    extends AbstractControl
    implements RequestControl, ResponseControl
    Request/response control for PagedResults. See RFC 2696. Control is defined as:
       realSearchControlValue ::= SEQUENCE {
         size            INTEGER (0..maxInt),
                                 -- requested page size from client
                                 -- result set size estimate from server
         cookie          OCTET STRING
       }
     
    • Field Detail

      • HASH_CODE_SEED

        private static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • EMPTY_COOKIE

        private static final byte[] EMPTY_COOKIE
        Empty byte array used for null cookies.
      • resultSize

        private int resultSize
        paged results size.
      • cookie

        private byte[] cookie
        server generated cookie.
    • Constructor Detail

      • PagedResultsControl

        public PagedResultsControl()
        Default constructor.
      • PagedResultsControl

        public PagedResultsControl​(boolean critical)
        Creates a new paged results control.
        Parameters:
        critical - whether this control is critical
      • PagedResultsControl

        public PagedResultsControl​(int size)
        Creates a new paged results control.
        Parameters:
        size - paged results size
      • PagedResultsControl

        public PagedResultsControl​(int size,
                                   boolean critical)
        Creates a new paged results control.
        Parameters:
        size - paged results size
        critical - whether this control is critical
      • PagedResultsControl

        public PagedResultsControl​(int size,
                                   byte[] value,
                                   boolean critical)
        Creates a new paged results control.
        Parameters:
        size - paged results size
        value - paged results cookie
        critical - whether this control is critical
    • Method Detail

      • hasValue

        public boolean hasValue()
        Description copied from interface: RequestControl
        Returns whether the control has a value associated with it.
        Specified by:
        hasValue in interface RequestControl
        Returns:
        whether the control has a value
      • getSize

        public int getSize()
        Returns the paged results size. For requests this is the requested page size. For responses this is the result size estimate from the server.
        Returns:
        paged results size
      • setSize

        public void setSize​(int size)
        Sets the paged results size. For requests this is the requested page size. For responses this is the result size estimate from the server.
        Parameters:
        size - paged results size
      • getCookie

        public byte[] getCookie()
        Returns the paged results cookie.
        Returns:
        paged results cookie
      • setCookie

        public void setCookie​(byte[] value)
        Sets the paged results cookie.
        Parameters:
        value - paged results cookie
      • hashCode

        public int hashCode()
        Description copied from class: AbstractControl
        Returns the hash code for this object.
        Specified by:
        hashCode in class AbstractControl
        Returns:
        hash code
      • encode

        public byte[] encode()
        Description copied from interface: RequestControl
        Provides the BER encoding of this control.
        Specified by:
        encode in interface RequestControl
        Returns:
        BER encoded request control
      • decode

        public void decode​(DERBuffer encoded)
        Description copied from interface: ResponseControl
        Initializes this response control with the supplied BER encoded data.
        Specified by:
        decode in interface ResponseControl
        Parameters:
        encoded - BER encoded response control