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
-
-
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 LdapApiService
getCodecService()
C
getDecorated()
Gets the Message this DsmlDecorator decorates.String
getOid()
byte[]
getValue()
Gets the control valueboolean
hasValue()
Checks to see if this DSML control decorator has a value.boolean
isCritical()
Tells if the control is critical or not.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.void
setValue(byte[] value)
Sets the encoded control valueorg.dom4j.Element
toDsml(org.dom4j.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:
isCritical
in interfaceControl
- Returns:
true
if the control is critical,false
otherwise
-
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:
setCritical
in interfaceControl
- Parameters:
isCritical
- true if the control is critical false otherwise.
-
toDsml
public org.dom4j.Element toDsml(org.dom4j.Element root)
Converts the request/reponse to its XML representation in the DSMLv2 format- Specified by:
toDsml
in 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:
getDecorated
in interfaceDsmlDecorator<C extends Control>
- Returns:
- The decorated Message instance
-
-