Class PersistentSearchDecorator
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<PersistentSearch>
-
- org.apache.directory.api.ldap.codec.controls.search.persistentSearch.PersistentSearchDecorator
-
- All Implemented Interfaces:
Asn1Object
,CodecControl<PersistentSearch>
,Decorator<PersistentSearch>
,Control
,PersistentSearch
public class PersistentSearchDecorator extends ControlDecorator<PersistentSearch> implements PersistentSearch
A persistence search object- Author:
- Apache Directory Project
-
-
Field Summary
-
Fields inherited from interface org.apache.directory.api.ldap.model.message.controls.PersistentSearch
CHANGE_TYPES_MAX, CHANGE_TYPES_MIN, OID
-
-
Constructor Summary
Constructors Constructor Description PersistentSearchDecorator(LdapApiService codec)
Default constructor creates a PersistentSearch Control automatically wrapped in a decorator object inside this container.PersistentSearchDecorator(LdapApiService codec, PersistentSearch control)
Creates a PersistentSearch Control wrapping a supplied PersistentSearch Control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
computeLength()
Compute the PagedSearchControl length, which is the sum of the control length and the value length.Asn1Object
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.void
disableNotification(ChangeType changeType)
Unsets the notification for a given changeTypevoid
enableNotification(ChangeType changeType)
Sets the notification for a given changeTypeByteBuffer
encode(ByteBuffer buffer)
Encodes the persistent search control.int
getChangeTypes()
byte[]
getValue()
Get the control valueboolean
isChangesOnly()
boolean
isNotificationEnabled(ChangeType changeType)
For each changeType, tells if the notification is enabledboolean
isReturnECs()
void
setChangesOnly(boolean changesOnly)
Sets the ChangesOnly flagvoid
setChangeTypes(int changeTypes)
Set the changeType value we want to get back ( a combinaison of Add, Delete, Modify and ModifyDN)void
setReturnECs(boolean returnECs)
Sets the return entry changes flag-
Methods inherited from class org.apache.directory.api.ldap.codec.api.ControlDecorator
equals, getCodecService, getDecorated, getOid, hashCode, hasValue, isCritical, setCritical, setDecorated, setValue, toString
-
Methods inherited from interface org.apache.directory.api.ldap.model.message.Control
getOid, isCritical, setCritical
-
-
-
-
Constructor Detail
-
PersistentSearchDecorator
public PersistentSearchDecorator(LdapApiService codec)
Default constructor creates a PersistentSearch Control automatically wrapped in a decorator object inside this container.- Parameters:
codec
- The LDAP service instance
-
PersistentSearchDecorator
public PersistentSearchDecorator(LdapApiService codec, PersistentSearch control)
Creates a PersistentSearch Control wrapping a supplied PersistentSearch Control.- Parameters:
codec
- The LDAP service instancecontrol
- The PersistentSearch Control to wrap.
-
-
Method Detail
-
computeLength
public int computeLength()
Compute the PagedSearchControl length, which is the sum of the control length and the value length.PersistentSearchDecorator 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 interfaceAsn1Object
- Returns:
- the control length.
-
encode
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
Encodes the persistent search control.- Specified by:
encode
in interfaceAsn1Object
- 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 interfaceCodecControl<PersistentSearch>
- Overrides:
getValue
in classControlDecorator<PersistentSearch>
- Returns:
- The control value
-
setChangesOnly
public void setChangesOnly(boolean changesOnly)
Sets the ChangesOnly flag- Specified by:
setChangesOnly
in interfacePersistentSearch
- Parameters:
changesOnly
- The ChangesOnly flag
-
isChangesOnly
public boolean isChangesOnly()
- Specified by:
isChangesOnly
in interfacePersistentSearch
- Returns:
- TRUE if the changesOnly flag is set
-
setReturnECs
public void setReturnECs(boolean returnECs)
Sets the return entry changes flag- Specified by:
setReturnECs
in interfacePersistentSearch
- Parameters:
returnECs
- the return entry changes flag
-
isReturnECs
public boolean isReturnECs()
- Specified by:
isReturnECs
in interfacePersistentSearch
- Returns:
- TRUE if the return entry changes flag is set
-
setChangeTypes
public void setChangeTypes(int changeTypes)
Set the changeType value we want to get back ( a combinaison of Add, Delete, Modify and ModifyDN)- Specified by:
setChangeTypes
in interfacePersistentSearch
- Parameters:
changeTypes
- The changeType values (Add, Modify, Delete and ModifyDn)
-
getChangeTypes
public int getChangeTypes()
- Specified by:
getChangeTypes
in interfacePersistentSearch
- Returns:
- The changeTypes value
-
isNotificationEnabled
public boolean isNotificationEnabled(ChangeType changeType)
For each changeType, tells if the notification is enabled- Specified by:
isNotificationEnabled
in interfacePersistentSearch
- Parameters:
changeType
- The ChnageType we are interested in- Returns:
- TRUE if the notification is set for this ChangeType
-
enableNotification
public void enableNotification(ChangeType changeType)
Sets the notification for a given changeType- Specified by:
enableNotification
in interfacePersistentSearch
- Parameters:
changeType
- The chnageType we want some notification to be set
-
disableNotification
public void disableNotification(ChangeType changeType)
Unsets the notification for a given changeType- Specified by:
disableNotification
in interfacePersistentSearch
- Parameters:
changeType
- The chnageType we want some notification to be unset
-
decode
public Asn1Object decode(byte[] controlBytes) throws DecoderException
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.- Specified by:
decode
in interfaceCodecControl<PersistentSearch>
- Parameters:
controlBytes
- the encoded control bytes- Returns:
- the decoded Asn1Object for the control
- Throws:
DecoderException
- if anything goes wrong
-
-