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:
BasicControlDecorator
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
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]valueThe encoded value of the control.protected intvalueLengthThe encoded value length
-
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 booleanequals(Object o)LdapApiServicegetCodecService()Gets the codec service responsible for managing the encoding and decoding of the decorated objects.EgetDecorated()Gets the object being decorated by this IDecorator.StringgetOid()Get the OIDbyte[]getValue()Get the control valueinthashCode()booleanhasValue()Checks to see if a value is set for thisCodecControl.booleanisCritical()Get the criticalityvoidsetCritical(boolean criticality)Set the criticalityvoidsetDecorated(E decorated)Set the control to be decorated.voidsetValue(byte[] value)Set the encoded control valueStringtoString()Return a String representing a Control-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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:
getDecoratedin 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:
getCodecServicein interfaceDecorator<E extends Control>- Returns:
- the codec service
-
getOid
public String getOid()
Get the OID
-
hasValue
public boolean hasValue()
Checks to see if a value is set for thisCodecControl.- Specified by:
hasValuein interfaceCodecControl<E extends Control>- Returns:
- true, if this control has a value, false otherwise
-
getValue
public byte[] getValue()
Get the control value- Specified by:
getValuein interfaceCodecControl<E extends Control>- Returns:
- The control value
-
setValue
public void setValue(byte[] value)
Set the encoded control value- Specified by:
setValuein interfaceCodecControl<E extends Control>- Parameters:
value- The encoded control value to store
-
isCritical
public boolean isCritical()
Get the criticality- Specified by:
isCriticalin interfaceControl- Returns:
trueif the criticality flag is true.
-
setCritical
public void setCritical(boolean criticality)
Set the criticality- Specified by:
setCriticalin interfaceControl- Parameters:
criticality- The criticality value
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- See Also:
Object.hashCode()
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classObject- See Also:
Object.equals(Object)
-
-