Package org.ldaptive.control
Class GenericControl
- java.lang.Object
-
- org.ldaptive.control.AbstractControl
-
- org.ldaptive.control.GenericControl
-
- All Implemented Interfaces:
Control
,RequestControl
,ResponseControl
public class GenericControl extends AbstractControl implements RequestControl, ResponseControl
LDAP control defined as:Control ::= SEQUENCE { controlType LDAPOID, criticality BOOLEAN DEFAULT FALSE, controlValue OCTET STRING OPTIONAL }
-
-
Field Summary
Fields Modifier and Type Field Description private static int
HASH_CODE_SEED
hash code seed.private byte[]
value
control value.-
Fields inherited from class org.ldaptive.control.AbstractControl
logger
-
-
Constructor Summary
Constructors Constructor Description GenericControl(String oid, boolean critical, byte[] encoded)
Creates a new generic control.GenericControl(String oid, boolean critical, DERBuffer encoded)
Creates a new generic control.GenericControl(String oid, byte[] encoded)
Creates a new generic control.GenericControl(String oid, DERBuffer encoded)
Creates a new generic control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
decode(DERBuffer encoded)
Initializes this response control with the supplied BER encoded data.byte[]
encode()
Provides the BER encoding of this control.boolean
equals(Object o)
int
hashCode()
Returns the hash code for this object.boolean
hasValue()
Returns whether the control has a value associated with it.String
toString()
-
Methods inherited from class org.ldaptive.control.AbstractControl
getCriticality, getOID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.control.Control
getCriticality, getOID
-
-
-
-
Field Detail
-
HASH_CODE_SEED
private static final int HASH_CODE_SEED
hash code seed.- See Also:
- Constant Field Values
-
value
private byte[] value
control value.
-
-
Constructor Detail
-
GenericControl
public GenericControl(String oid, byte[] encoded)
Creates a new generic control.- Parameters:
oid
- control OIDencoded
- control value
-
GenericControl
public GenericControl(String oid, DERBuffer encoded)
Creates a new generic control.- Parameters:
oid
- control OIDencoded
- control value
-
GenericControl
public GenericControl(String oid, boolean critical, byte[] encoded)
Creates a new generic control.- Parameters:
oid
- control OIDcritical
- whether this control is criticalencoded
- control value
-
-
Method Detail
-
hasValue
public boolean hasValue()
Description copied from interface:RequestControl
Returns whether the control has a value associated with it.- Specified by:
hasValue
in interfaceRequestControl
- Returns:
- whether the control has a value
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classAbstractControl
-
hashCode
public int hashCode()
Description copied from class:AbstractControl
Returns the hash code for this object.- Specified by:
hashCode
in classAbstractControl
- Returns:
- hash code
-
toString
public String toString()
- Overrides:
toString
in classAbstractControl
-
encode
public byte[] encode()
Description copied from interface:RequestControl
Provides the BER encoding of this control.- Specified by:
encode
in interfaceRequestControl
- Returns:
- BER encoded request control
-
decode
public void decode(DERBuffer encoded)
Description copied from interface:ResponseControl
Initializes this response control with the supplied BER encoded data.- Specified by:
decode
in interfaceResponseControl
- Parameters:
encoded
- BER encoded response control
-
-