Package org.apache.directory.api.dsmlv2
Class DsmlControl<C extends Control>
- java.lang.Object
-
- org.apache.directory.api.dsmlv2.DsmlControl<C>
-
- Type Parameters:
C- The decorated Control
- All Implemented Interfaces:
DsmlDecorator<C>,Control
public class DsmlControl<C extends Control> extends Object implements Control, DsmlDecorator<C>
A DSML decorator for aControl.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description protected byte[]valueThe encoded value of the control.
-
Constructor Summary
Constructors Constructor Description DsmlControl(LdapApiService codec, C decorated)Creates a new instance of DsmlControl
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LdapApiServicegetCodecService()CgetDecorated()Gets the Message this DsmlDecorator decorates.StringgetOid()byte[]getValue()Gets the control valuebooleanhasValue()Checks to see if this DSML control decorator has a value.booleanisCritical()Tells if the control is critical or not.voidsetCritical(boolean isCritical)Sets the critical flag which determines whether or not this control is critical for the correct operation of a request or response message.voidsetValue(byte[] value)Sets the encoded control valueElementtoDsml(Element root)Converts the request/reponse to its XML representation in the DSMLv2 format
-
-
-
Constructor Detail
-
DsmlControl
public DsmlControl(LdapApiService codec, C decorated)
Creates a new instance of DsmlControl- Parameters:
codec- The Codec used to encode/decode the Controldecorated- The decorated control
-
-
Method Detail
-
getCodecService
public LdapApiService getCodecService()
- Returns:
- The LDAP codec service.
-
hasValue
public boolean hasValue()
Checks to see if this DSML control decorator has a value.- Returns:
- true if the DSML control has a value, false otherwise.
-
getValue
public byte[] getValue()
Gets the control value- Returns:
- The control value
-
setValue
public void setValue(byte[] value)
Sets the encoded control value- Parameters:
value- The encoded control value to store
-
isCritical
public boolean isCritical()
Tells if the control is critical or not.- Specified by:
isCriticalin interfaceControl- Returns:
trueif the control is critical,falseotherwise
-
setCritical
public void setCritical(boolean isCritical)
Sets the critical flag which determines whether or not this control is critical for the correct operation of a request or response message. The default for this value should be false.- Specified by:
setCriticalin interfaceControl- Parameters:
isCritical- true if the control is critical false otherwise.
-
toDsml
public Element toDsml(Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format- Specified by:
toDsmlin interfaceDsmlDecorator<C extends Control>- Parameters:
root- the root dom4j Element- Returns:
- the dom4j Element corresponding to the entry.
-
getDecorated
public C getDecorated()
Gets the Message this DsmlDecorator decorates.- Specified by:
getDecoratedin interfaceDsmlDecorator<C extends Control>- Returns:
- The decorated Message instance
-
-