Package org.opends.server.controls
Class VLVRequestControl
- java.lang.Object
-
- org.opends.server.types.Control
-
- org.opends.server.controls.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 Summary
Fields Modifier and Type Field Description static ControlDecoder<VLVRequestControl>DECODERThe Control Decoder that can be used to decode this control.static byteTYPE_TARGET_BYOFFSETThe BER type to use when encoding the byOffset target element.static byteTYPE_TARGET_GREATERTHANOREQUALThe BER type to use when encoding the greaterThanOrEqual target element.
-
Constructor Summary
Constructors Constructor Description VLVRequestControl(boolean isCritical, int beforeCount, int afterCount, int offset, int contentCount, ByteString contextID)Creates a new VLV request control with the provided information.VLVRequestControl(boolean isCritical, int beforeCount, int afterCount, ByteString greaterThanOrEqual, ByteString contextID)Creates a new VLV request control with the provided information.VLVRequestControl(int beforeCount, int afterCount, int offset, int contentCount)Creates a new VLV request control with the provided information.VLVRequestControl(int beforeCount, int afterCount, ByteString greaterThanOrEqual)Creates a new VLV request control with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAfterCount()Retrieves the number of entries after the target offset or assertion value to include in the results page.intgetBeforeCount()Retrieves the number of entries before the target offset or assertion value to include in the results page.intgetContentCount()Retrieves the content count indicating the estimated number of entries in the complete result set.ByteStringgetContextID()Retrieves a context ID value that should be used to resume a previous VLV results session.ByteStringgetGreaterThanOrEqualAssertion()Retrieves the assertion value that will be used to locate the beginning of the results page.intgetOffset()Retrieves the offset that indicates the beginning of the results page.bytegetTargetType()Retrieves the BER type for the target that specifies the beginning of the results page.voidtoString(StringBuilder buffer)Appends a string representation of this VLV request control to the provided buffer.protected voidwriteValue(ASN1Writer writer)Writes this control's value to an ASN.1 writer.-
Methods inherited from class org.opends.server.types.Control
getOID, isCritical, toString, write
-
-
-
-
Field Detail
-
DECODER
public static final ControlDecoder<VLVRequestControl> DECODER
The Control Decoder that can be used to decode this control.
-
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, ornullif 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, ornullif 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_BYOFFSETif the beginning of the results page should be specified as a nuemric offset, orTYPE_TARGET_GREATERTHANOREQUALif 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 thegetTargetTypemethod returnsTYPE_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 thegetTargetTypemethod returnsTYPE_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 thegetTargetTypemethod returnsTYPE_TARGET_GREATERTHANOREQUAL.- Returns:
- The assertion value that will be used to locate the beginning of
the results page, or
nullif 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
nullif 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:
writeValuein classControl- 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.
-
-