Class VLVRequestControl


  • public class VLVRequestControl
    extends Control
    This class implements the virtual list view request controls as defined in draft-ietf-ldapext-ldapv3-vlv. The ASN.1 description for the control value is:

     VirtualListViewRequest ::= SEQUENCE {
           beforeCount    INTEGER (0..maxInt),
           afterCount     INTEGER (0..maxInt),
           target       CHOICE {
                          byOffset        [0] SEQUENCE {
                               offset          INTEGER (1 .. maxInt),
                               contentCount    INTEGER (0 .. maxInt) },
                          greaterThanOrEqual [1] AssertionValue },
           contextID     OCTET STRING OPTIONAL }
     
    • Field Detail

      • TYPE_TARGET_BYOFFSET

        public static final byte TYPE_TARGET_BYOFFSET
        The BER type to use when encoding the byOffset target element.
        See Also:
        Constant Field Values
      • TYPE_TARGET_GREATERTHANOREQUAL

        public static final byte TYPE_TARGET_GREATERTHANOREQUAL
        The BER type to use when encoding the greaterThanOrEqual target element.
        See Also:
        Constant Field Values
    • Constructor Detail

      • VLVRequestControl

        public VLVRequestControl​(int beforeCount,
                                 int afterCount,
                                 int offset,
                                 int contentCount)
        Creates a new VLV request control with the provided information.
        Parameters:
        beforeCount - The number of entries before the target offset to retrieve in the results page.
        afterCount - The number of entries after the target offset to retrieve in the results page.
        offset - The offset in the result set to target for the beginning of the page of results.
        contentCount - The content count returned by the server in the last phase of the VLV request, or zero for a new VLV request session.
      • VLVRequestControl

        public VLVRequestControl​(boolean isCritical,
                                 int beforeCount,
                                 int afterCount,
                                 int offset,
                                 int contentCount,
                                 ByteString contextID)
        Creates a new VLV request control with the provided information.
        Parameters:
        isCritical - Indicates whether the control is critical.
        beforeCount - The number of entries before the target offset to retrieve in the results page.
        afterCount - The number of entries after the target offset to retrieve in the results page.
        offset - The offset in the result set to target for the beginning of the page of results.
        contentCount - The content count returned by the server in the last phase of the VLV request, or zero for a new VLV request session.
        contextID - The context ID provided by the server in the last VLV response for the same set of criteria, or null if there was no previous VLV response or the server did not include a context ID in the last response.
      • VLVRequestControl

        public VLVRequestControl​(int beforeCount,
                                 int afterCount,
                                 ByteString greaterThanOrEqual)
        Creates a new VLV request control with the provided information.
        Parameters:
        beforeCount - The number of entries before the target offset to retrieve in the results page.
        afterCount - The number of entries after the target offset to retrieve in the results page.
        greaterThanOrEqual - The greaterThanOrEqual target assertion value that indicates where to start the page of results.
      • VLVRequestControl

        public VLVRequestControl​(boolean isCritical,
                                 int beforeCount,
                                 int afterCount,
                                 ByteString greaterThanOrEqual,
                                 ByteString contextID)
        Creates a new VLV request control with the provided information.
        Parameters:
        isCritical - Indicates whether the control should be considered critical.
        beforeCount - The number of entries before the target assertion value.
        afterCount - The number of entries after the target assertion value.
        greaterThanOrEqual - The greaterThanOrEqual target assertion value that indicates where to start the page of results.
        contextID - The context ID provided by the server in the last VLV response for the same set of criteria, or null if there was no previous VLV response or the server did not include a context ID in the last response.
    • Method Detail

      • getBeforeCount

        public int getBeforeCount()
        Retrieves the number of entries before the target offset or assertion value to include in the results page.
        Returns:
        The number of entries before the target offset to include in the results page.
      • getAfterCount

        public int getAfterCount()
        Retrieves the number of entries after the target offset or assertion value to include in the results page.
        Returns:
        The number of entries after the target offset to include in the results page.
      • getTargetType

        public byte getTargetType()
        Retrieves the BER type for the target that specifies the beginning of the results page.
        Returns:
        TYPE_TARGET_BYOFFSET if the beginning of the results page should be specified as a nuemric offset, or TYPE_TARGET_GREATERTHANOREQUAL if it should be specified by an assertion value.
      • getOffset

        public int getOffset()
        Retrieves the offset that indicates the beginning of the results page. The return value will only be applicable if the getTargetType method returns TYPE_TARGET_BYOFFSET.
        Returns:
        The offset that indicates the beginning of the results page.
      • getContentCount

        public int getContentCount()
        Retrieves the content count indicating the estimated number of entries in the complete result set. The return value will only be applicable if the getTargetType method returns TYPE_TARGET_BYOFFSET.
        Returns:
        The content count indicating the estimated number of entries in the complete result set.
      • getGreaterThanOrEqualAssertion

        public ByteString getGreaterThanOrEqualAssertion()
        Retrieves the assertion value that will be used to locate the beginning of the results page. This will only be applicable if the getTargetType method returns TYPE_TARGET_GREATERTHANOREQUAL.
        Returns:
        The assertion value that will be used to locate the beginning of the results page, or null if the beginning of the results page is to be specified using an offset.
      • getContextID

        public ByteString getContextID()
        Retrieves a context ID value that should be used to resume a previous VLV results session.
        Returns:
        A context ID value that should be used to resume a previous VLV results session, or null if none is available.
      • writeValue

        protected void writeValue​(ASN1Writer writer)
                           throws IOException
        Writes this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.
        Specified by:
        writeValue in class Control
        Parameters:
        writer - The ASN.1 writer to use.
        Throws:
        IOException - If a problem occurs while writing to the stream.
      • toString

        public void toString​(StringBuilder buffer)
        Appends a string representation of this VLV request control to the provided buffer.
        Overrides:
        toString in class Control
        Parameters:
        buffer - The buffer to which the information should be appended.