org.apache.directory.api.ldap.model.message.controls
Class OpaqueControl

java.lang.Object
  extended by org.apache.directory.api.ldap.model.message.controls.AbstractControl
      extended by org.apache.directory.api.ldap.model.message.controls.OpaqueControl
All Implemented Interfaces:
Control

public final class OpaqueControl
extends AbstractControl
implements Control

A final Control implementation intended specifically for handling controls who's values cannot be encoded or decoded by the codec service. This situation results when no Control factory is found to be registered for this control's OID. Hence additional opaque value handling methods are included to manage the opaque control value.

Author:
Apache Directory Project

Constructor Summary
OpaqueControl(String oid)
          Creates a Control with a specific OID.
OpaqueControl(String oid, boolean criticality)
          Creates a Control with a specific OID, and criticality set.
 
Method Summary
 byte[] getEncodedValue()
           
 boolean hasEncodedValue()
          Tells if the control has a stored value.
 void setEncodedValue(byte[] value)
          Stores an opaque value into the control.
 
Methods inherited from class org.apache.directory.api.ldap.model.message.controls.AbstractControl
equals, getOid, hashCode, isCritical, setCritical, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.api.ldap.model.message.Control
getOid, isCritical, setCritical
 

Constructor Detail

OpaqueControl

public OpaqueControl(String oid)
Creates a Control with a specific OID.

Parameters:
oid - The OID of this Control.

OpaqueControl

public OpaqueControl(String oid,
                     boolean criticality)
Creates a Control with a specific OID, and criticality set.

Parameters:
oid - The OID of this Control.
criticality - true if this Control is critical, false otherwise.
Method Detail

getEncodedValue

public byte[] getEncodedValue()
Returns:
The encoded value

setEncodedValue

public void setEncodedValue(byte[] value)
Stores an opaque value into the control.

Parameters:
value - The opaque value to store

hasEncodedValue

public boolean hasEncodedValue()
Tells if the control has a stored value. Note that if the control has an empty value, this method will return true.

Returns:
true if the control has a value


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.