|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.shared.asn1.AbstractAsn1Object
org.apache.directory.shared.ldap.codec.controls.AbstractControl
public abstract class AbstractControl
A Asn1Object to store a Control.
| Field Summary | |
|---|---|
protected ControlDecoder |
decoder
|
protected byte[] |
value
Optional control value |
protected int |
valueLength
The encoded value length |
| Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
|---|
parent |
| Constructor Summary | |
|---|---|
AbstractControl(java.lang.String oid)
Default constructor. |
|
| Method Summary | |
|---|---|
int |
computeLength()
Compute the Control length |
int |
computeLength(int valueLength)
|
java.nio.ByteBuffer |
encode(java.nio.ByteBuffer buffer)
Generate the PDU which contains the Control. |
ControlDecoder |
getDecoder()
Get the associated decoder |
java.lang.String |
getOid()
Get the OID |
byte[] |
getValue()
Get the control value |
boolean |
hasValue()
Tells if the Control has a value or not |
boolean |
isCritical()
Get the criticality |
void |
setCritical(boolean criticality)
Set the criticality |
void |
setValue(byte[] value)
Set the encoded control value |
java.lang.String |
toString()
Return a String representing a Control |
| Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object |
|---|
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected byte[] value
protected int valueLength
protected ControlDecoder decoder
| Constructor Detail |
|---|
public AbstractControl(java.lang.String oid)
| Method Detail |
|---|
public java.lang.String getOid()
getOid in interface Controlpublic byte[] getValue()
getValue in interface Controlpublic void setValue(byte[] value)
setValue in interface ControlencodedValue - The encoded control value to storepublic boolean isCritical()
isCritical in interface Controltrue if the criticality flag is true.public void setCritical(boolean criticality)
setCritical in interface Controlcriticality - The criticality valuepublic int computeLength()
Control :
0x30 L1
|
+--> 0x04 L2 controlType
[+--> 0x01 0x01 criticality]
[+--> 0x04 L3 controlValue]
Control length = Length(0x30) + length(L1)
+ Length(0x04) + Length(L2) + L2
[+ Length(0x01) + 1 + 1]
[+ Length(0x04) + Length(L3) + L3]
computeLength in interface Asn1ObjectcomputeLength in interface CodecControlcomputeLength in class AbstractAsn1Objectpublic int computeLength(int valueLength)
public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
throws EncoderException
Control : 0x30 LL 0x04 LL type [0x01 0x01 criticality] [0x04 LL value]
encode in interface Asn1Objectencode in interface CodecControlencode in class AbstractAsn1Objectbuffer - The encoded PDU
EncoderException - If anything goes wrong.public boolean hasValue()
hasValue in interface Controltrue if th Control has a value, even containing no bytes.public ControlDecoder getDecoder()
CodecControl
getDecoder in interface CodecControlpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||