Class ControlDecorator<E extends Control>
- java.lang.Object
-
- org.apache.directory.api.ldap.codec.api.ControlDecorator<E>
-
- Type Parameters:
E
- The control type
- All Implemented Interfaces:
Asn1Object
,CodecControl<E>
,Decorator<E>
,Control
- Direct Known Subclasses:
AdDirSyncDecorator
,AdPolicyHintsDecorator
,AdShowDeletedDecorator
,BasicControlDecorator
,CascadeDecorator
,ChangeNotificationsDecorator
,EntryChangeDecorator
,ManageDsaITDecorator
,PagedResultsDecorator
,PasswordPolicyDecorator
,PermissiveModifyDecorator
,PersistentSearchDecorator
,ProxiedAuthzDecorator
,SortRequestDecorator
,SortResponseDecorator
,SubentriesDecorator
,SyncDoneValueDecorator
,SyncRequestValueDecorator
,SyncStateValueDecorator
,TransactionSpecificationDecorator
,VirtualListViewRequestDecorator
,VirtualListViewResponseDecorator
public abstract class ControlDecorator<E extends Control> extends Object implements CodecControl<E>
Decorates Control objects by wrapping them, and enabling them as CodecControls so the codec to store transient information associated with the Control in the decorator while processing.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description ControlDecorator(LdapApiService codec, E decoratedControl)
Creates a ControlDecorator to codec enable it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
LdapApiService
getCodecService()
Gets the codec service responsible for managing the encoding and decoding of the decorated objects.E
getDecorated()
Gets the object being decorated by this IDecorator.String
getOid()
Get the OIDbyte[]
getValue()
Get the control valueint
hashCode()
boolean
hasValue()
Checks to see if a value is set for thisCodecControl
.boolean
isCritical()
Get the criticalityvoid
setCritical(boolean criticality)
Set the criticalityvoid
setDecorated(E decorated)
Set the control to be decorated.void
setValue(byte[] value)
Set the encoded control valueString
toString()
Return a String representing a Control-
Methods inherited from interface org.apache.directory.api.asn1.Asn1Object
computeLength, encode
-
Methods inherited from interface org.apache.directory.api.ldap.codec.api.CodecControl
decode
-
-
-
-
Constructor Detail
-
ControlDecorator
public ControlDecorator(LdapApiService codec, E decoratedControl)
Creates a ControlDecorator to codec enable it.- Parameters:
codec
- The Ldap service to usedecoratedControl
- The Control to decorate.
-
-
Method Detail
-
getDecorated
public E getDecorated()
Gets the object being decorated by this IDecorator.- Specified by:
getDecorated
in interfaceDecorator<E extends Control>
- Returns:
- The decorated object
-
setDecorated
public void setDecorated(E decorated)
Set the control to be decorated.- Parameters:
decorated
- The decorated control
-
getCodecService
public LdapApiService getCodecService()
Gets the codec service responsible for managing the encoding and decoding of the decorated objects.- Specified by:
getCodecService
in interfaceDecorator<E extends Control>
- Returns:
- the codec service
-
hasValue
public boolean hasValue()
Checks to see if a value is set for thisCodecControl
.- Specified by:
hasValue
in interfaceCodecControl<E extends Control>
- Returns:
- true, if this control has a value, false otherwise
-
getValue
public byte[] getValue()
Get the control value- Specified by:
getValue
in interfaceCodecControl<E extends Control>
- Returns:
- The control value
-
setValue
public void setValue(byte[] value)
Set the encoded control value- Specified by:
setValue
in interfaceCodecControl<E extends Control>
- Parameters:
value
- The encoded control value to store
-
isCritical
public boolean isCritical()
Get the criticality- Specified by:
isCritical
in interfaceControl
- Returns:
true
if the criticality flag is true.
-
setCritical
public void setCritical(boolean criticality)
Set the criticality- Specified by:
setCritical
in interfaceControl
- Parameters:
criticality
- The criticality value
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classObject
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classObject
- See Also:
Object.equals(Object)
-
-