public abstract class AbstractControl extends AbstractAsn1Object implements Control, CodecControl
Modifier and Type | Field and Description |
---|---|
protected ControlDecoder |
decoder |
protected byte[] |
value
Optional control value
|
protected int |
valueLength
The encoded value length
|
parent
Constructor and Description |
---|
AbstractControl(String oid)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
computeLength()
Compute the object length, which is the sum of all inner length.
|
int |
computeLength(int valueLength) |
ByteBuffer |
encode(ByteBuffer buffer)
Encode the object to a PDU.
|
ControlDecoder |
getDecoder()
Get the associated decoder
|
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
|
String |
toString()
Return a String representing a Control
|
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
protected byte[] value
protected int valueLength
protected ControlDecoder decoder
public AbstractControl(String oid)
public String getOid()
public byte[] getValue()
public void setValue(byte[] value)
public boolean isCritical()
isCritical
in interface Control
true
if the criticality flag is true.public void setCritical(boolean criticality)
setCritical
in interface Control
criticality
- The criticality valuepublic int computeLength()
computeLength
in interface Asn1Object
computeLength
in interface CodecControl
computeLength
in class AbstractAsn1Object
public int computeLength(int valueLength)
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
encode
in interface Asn1Object
encode
in interface CodecControl
encode
in class AbstractAsn1Object
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic boolean hasValue()
public ControlDecoder getDecoder()
CodecControl
getDecoder
in interface CodecControl
Copyright © 2003–2013 The Apache Software Foundation. All rights reserved.