public class PasswordPolicyDecorator extends ControlDecorator<PasswordPolicy> implements PasswordPolicy
value
OID
Constructor and Description |
---|
PasswordPolicyDecorator(LdapApiService codec) |
PasswordPolicyDecorator(LdapApiService codec,
boolean hasResponse) |
PasswordPolicyDecorator(LdapApiService codec,
PasswordPolicy policy) |
Modifier and Type | Method and Description |
---|---|
int |
computeLength()
Compute the object length, which is the sum of all inner length.
|
Asn1Object |
decode(byte[] controlBytes)
Decodes raw ASN.1 encoded bytes into an Asn1Object for the control.
|
ByteBuffer |
encode(ByteBuffer buffer)
Encode the object to a PDU.
|
PasswordPolicyResponse |
getResponse()
Get's the response component of this control if this control carries a
response.
|
boolean |
hasResponse()
Checks whether this Control is the password policy request or the response
by carrying with it an IPasswordPolicyResponse object.
|
PasswordPolicyResponse |
setResponse(boolean hasResponse)
If true sets the response to a default newly initialized response object.
|
void |
setResponse(PasswordPolicyResponse response)
Sets the response.
|
void |
setValue(byte[] value)
Set the encoded control value
|
String |
toString()
Return a String representing a Control
|
equals, getCodecService, getDecorated, getOid, getValue, hashCode, hasValue, isCritical, setCritical, setDecorated
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getOid, isCritical, setCritical
public PasswordPolicyDecorator(LdapApiService codec)
public PasswordPolicyDecorator(LdapApiService codec, boolean hasResponse)
public PasswordPolicyDecorator(LdapApiService codec, PasswordPolicy policy)
public void setValue(byte[] value)
setValue
in interface CodecControl<PasswordPolicy>
setValue
in class ControlDecorator<PasswordPolicy>
value
- The encoded control value to storepublic int computeLength()
ControlDecorator
computeLength
in interface Asn1Object
computeLength
in interface Decorator<PasswordPolicy>
computeLength
in class ControlDecorator<PasswordPolicy>
public ByteBuffer encode(ByteBuffer buffer) throws EncoderException
AbstractAsn1Object
encode
in interface Asn1Object
encode
in interface Decorator<PasswordPolicy>
encode
in class AbstractAsn1Object
buffer
- The buffer where to put the PDUEncoderException
- if the buffer can't be encodedpublic String toString()
ControlDecorator
toString
in class ControlDecorator<PasswordPolicy>
public Asn1Object decode(byte[] controlBytes) throws DecoderException
decode
in interface CodecControl<PasswordPolicy>
controlBytes
- the encoded control bytesDecoderException
- if anything goes wrongpublic boolean hasResponse()
hasResponse
in interface PasswordPolicy
public void setResponse(PasswordPolicyResponse response)
setResponse
in interface PasswordPolicy
response
- a valid response object, or null to make this a requestpublic PasswordPolicyResponse setResponse(boolean hasResponse)
setResponse
in interface PasswordPolicy
hasResponse
- true to create default response, false to clear itpublic PasswordPolicyResponse getResponse()
PasswordPolicy.hasResponse()
returns true, this will return a non-null
policy response object.getResponse
in interface PasswordPolicy
PasswordPolicy.hasResponse()
returns falseCopyright © 2003-2014 The Apache Software Foundation. All Rights Reserved.