Package org.ldaptive.control
Class PagedResultsControl
java.lang.Object
org.ldaptive.control.AbstractControl
org.ldaptive.control.AbstractResponseControl
org.ldaptive.control.PagedResultsControl
- All Implemented Interfaces:
Control,RequestControl,ResponseControl,Freezable
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
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classParse handler implementation for the cookie.private static classParse handler implementation for the size. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]server generated cookie.private static final byte[]Empty byte array used for null cookies.private static final inthash code seed.static final StringOID of this control.private intpaged results size.Fields inherited from class org.ldaptive.control.AbstractControl
logger -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PagedResultsControl(boolean critical) Creates a new paged results control.PagedResultsControl(int size) Creates a new paged results control.PagedResultsControl(int size, boolean critical) Creates a new paged results control.PagedResultsControl(int size, byte[] value, boolean critical) Creates a new paged results control. -
Method Summary
Modifier and TypeMethodDescriptionvoidInitializes this response control with the supplied BER encoded data.byte[]encode()Provides the BER encoding of this control.booleanbyte[]Returns the paged results cookie.intgetSize()Returns the paged results size.inthashCode()Returns the hash code for this object.booleanhasValue()Returns whether the control has a value associated with it.voidsetCookie(byte[] value) Sets the paged results cookie.voidsetSize(int size) Sets the paged results size.toString()Methods inherited from class org.ldaptive.control.AbstractResponseControl
assertMutable, freeze, freezeAndAssertMutable, isFrozenMethods inherited from class org.ldaptive.control.AbstractControl
getCriticality, getOIDMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ldaptive.control.Control
getCriticality, getOID
-
Field Details
-
OID
OID of this control.- See Also:
-
HASH_CODE_SEED
private static final int HASH_CODE_SEEDhash code seed.- See Also:
-
EMPTY_COOKIE
private static final byte[] EMPTY_COOKIEEmpty byte array used for null cookies. -
resultSize
private int resultSizepaged results size. -
cookie
private byte[] cookieserver generated cookie.
-
-
Constructor Details
-
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 sizecritical- whether this control is critical
-
PagedResultsControl
public PagedResultsControl(int size, byte[] value, boolean critical) Creates a new paged results control.- Parameters:
size- paged results sizevalue- paged results cookiecritical- whether this control is critical
-
-
Method Details
-
hasValue
public boolean hasValue()Description copied from interface:RequestControlReturns whether the control has a value associated with it.- Specified by:
hasValuein interfaceRequestControl- 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
-
equals
- Overrides:
equalsin classAbstractControl
-
hashCode
public int hashCode()Description copied from class:AbstractControlReturns the hash code for this object.- Specified by:
hashCodein classAbstractControl- Returns:
- hash code
-
toString
- Overrides:
toStringin classAbstractControl
-
encode
public byte[] encode()Description copied from interface:RequestControlProvides the BER encoding of this control.- Specified by:
encodein interfaceRequestControl- Returns:
- BER encoded request control
-
decode
Description copied from interface:ResponseControlInitializes this response control with the supplied BER encoded data.- Specified by:
decodein interfaceResponseControl- Parameters:
encoded- BER encoded response control
-