org.apache.directory.shared.ldap.codec.search.controls.persistentSearch
Class PersistentSearchControl

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.controls.AbstractControl
          extended by org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl
All Implemented Interfaces:
Asn1Object, CodecControl, Control

public class PersistentSearchControl
extends AbstractControl

A persistence search object

Version:
$Rev: 912399 $, $Date: 2010-02-21 21:52:31 +0100 (Sun, 21 Feb 2010) $,
Author:
Apache Directory Project

Field Summary
static int CHANGE_TYPE_ADD
          Definition of the change types
static int CHANGE_TYPE_DELETE
           
static int CHANGE_TYPE_MODDN
           
static int CHANGE_TYPE_MODIFY
           
static int CHANGE_TYPES_MAX
           
static int CHANGE_TYPES_MIN
          Min and Max values for the possible combined change types
static java.lang.String CONTROL_OID
          This control OID
 
Fields inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
decoder, value, valueLength
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
PersistentSearchControl()
          Default constructor
 
Method Summary
 int computeLength()
          Compute the PagedSearchControl length, which is the sum of the control length and the value length.
 void enableNotification(ChangeType changeType)
           
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encodes the persistent search control.
 int getChangeTypes()
           
 byte[] getValue()
          Get the control value
 boolean isChangesOnly()
           
 boolean isNotificationEnabled(ChangeType changeType)
           
 boolean isReturnECs()
           
 void setChangesOnly(boolean changesOnly)
           
 void setChangeTypes(int changeTypes)
           
 void setReturnECs(boolean returnECs)
           
 java.lang.String toString()
          Return a String representing this PSearchControl.
 
Methods inherited from class org.apache.directory.shared.ldap.codec.controls.AbstractControl
computeLength, getDecoder, getOid, hasValue, isCritical, setCritical, setValue
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONTROL_OID

public static final java.lang.String CONTROL_OID
This control OID

See Also:
Constant Field Values

CHANGE_TYPE_ADD

public static final int CHANGE_TYPE_ADD
Definition of the change types

See Also:
Constant Field Values

CHANGE_TYPE_DELETE

public static final int CHANGE_TYPE_DELETE
See Also:
Constant Field Values

CHANGE_TYPE_MODIFY

public static final int CHANGE_TYPE_MODIFY
See Also:
Constant Field Values

CHANGE_TYPE_MODDN

public static final int CHANGE_TYPE_MODDN
See Also:
Constant Field Values

CHANGE_TYPES_MIN

public static final int CHANGE_TYPES_MIN
Min and Max values for the possible combined change types

See Also:
Constant Field Values

CHANGE_TYPES_MAX

public static final int CHANGE_TYPES_MAX
See Also:
Constant Field Values
Constructor Detail

PersistentSearchControl

public PersistentSearchControl()
Default constructor

Method Detail

setChangesOnly

public void setChangesOnly(boolean changesOnly)

isChangesOnly

public boolean isChangesOnly()

setReturnECs

public void setReturnECs(boolean returnECs)

isReturnECs

public boolean isReturnECs()

setChangeTypes

public void setChangeTypes(int changeTypes)

getChangeTypes

public int getChangeTypes()

computeLength

public int computeLength()
Compute the PagedSearchControl length, which is the sum of the control length and the value length.
 PersistentSearchControl value length :
 
 0x30 L1 
   | 
   +--> 0x02 0x0(1-4) [0..2^31-1] (changeTypes) 
   +--> 0x01 0x01 [0x00 | 0xFF] (changeOnly) 
   +--> 0x01 0x01 [0x00 | 0xFF] (returnRCs)
 

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in interface CodecControl
Overrides:
computeLength in class AbstractControl
Returns:
The object's computed length

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws EncoderException
Encodes the persistent search control.

Specified by:
encode in interface Asn1Object
Specified by:
encode in interface CodecControl
Overrides:
encode in class AbstractControl
Parameters:
buffer - The encoded sink
Returns:
A ByteBuffer that contains the encoded PDU
Throws:
EncoderException - If anything goes wrong.

getValue

public byte[] getValue()
Get the control value

Specified by:
getValue in interface Control
Overrides:
getValue in class AbstractControl
Returns:
The control value

isNotificationEnabled

public boolean isNotificationEnabled(ChangeType changeType)

enableNotification

public void enableNotification(ChangeType changeType)

toString

public java.lang.String toString()
Return a String representing this PSearchControl.

Overrides:
toString in class AbstractControl


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.