All LDAP Classes
Internal LDAP Classes

com.novell.ldap
Class LDAPControl

java.lang.Object
  extended by com.novell.ldap.LDAPControl
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
LDAPControl, LDAPEffectivePrivilegesControl, LDAPEntryChangeControl, LDAPPersistSearchControl, LDAPSortControl, LDAPSortResponse, LDAPVirtualListControl, LDAPVirtualListResponse

public class LDAPControl
extends java.lang.Object
implements java.lang.Cloneable, java.io.Externalizable

Encapsulates optional additional parameters or constraints to be applied to an LDAP operation.

When included with LDAPConstraints or LDAPSearchConstraints on an LDAPConnection or with a specific operation request, it is sent to the server along with operation requests.

See Also:
LDAPConnection.getResponseControls(), LDAPConstraints.getControls(), LDAPConstraints.setControls(com.novell.ldap.LDAPControl), Serialized Form

Field Summary
private  RfcControl control
           
private static RespControlVector registeredControls
           
 
Constructor Summary
  LDAPControl()
          This constructor was added to support default Serialization
protected LDAPControl(RfcControl control)
          Create an LDAPControl from an existing control.
  LDAPControl(java.lang.String oid, boolean critical, byte[] values)
          Constructs a new LDAPControl object using the specified values.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the current LDAPControl object.
(package private)  RfcControl getASN1Object()
          Returns the RFC 2251 Control object.
 java.lang.String getID()
          Returns the identifier of the control.
(package private) static RespControlVector getRegisteredControls()
           
 byte[] getValue()
          Returns the control-specific data of the object.
(package private) static LDAPXMLHandler getXMLHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
          This method return the LDAPHandler which handles the XML (DSML) tags for this class
 boolean isCritical()
          Returns whether the control is critical for the operation.
(package private)  void newLine(int indentTabs, java.io.Writer out)
           
static java.lang.Object readDSML(java.io.InputStream input)
          This method is used to deserialize the DSML encoded representation of this class.
 void readExternal(java.io.ObjectInput in)
          Reads the serialized object from the underlying input stream.
static void register(java.lang.String oid, java.lang.Class controlClass)
          Registers a class to be instantiated on receipt of a control with the given OID.
protected  void setValue(byte[] controlValue)
          Sets the control-specific data of the object.
 java.lang.String toString()
          Returns a string representation of this class.
 void writeDSML(java.io.OutputStream oout)
          This method does DSML serialization of the instance.
 void writeExternal(java.io.ObjectOutput out)
          Writes the object state to a stream in XML format
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

registeredControls

private static RespControlVector registeredControls

control

private RfcControl control
Constructor Detail

LDAPControl

public LDAPControl()
This constructor was added to support default Serialization


LDAPControl

public LDAPControl(java.lang.String oid,
                   boolean critical,
                   byte[] values)
Constructs a new LDAPControl object using the specified values.

Parameters:
oid - The OID of the control, as a dotted string.

critical - True if the LDAP operation should be discarded if the control is not supported. False if the operation can be processed without the control.

values - The control-specific data.

LDAPControl

protected LDAPControl(RfcControl control)
Create an LDAPControl from an existing control.

Method Detail

clone

public java.lang.Object clone()
Returns a copy of the current LDAPControl object.

Overrides:
clone in class java.lang.Object
Returns:
A copy of the current LDAPControl object.

getID

public java.lang.String getID()
Returns the identifier of the control.

Returns:
The object ID of the control.

getValue

public byte[] getValue()
Returns the control-specific data of the object.

Returns:
The control-specific data of the object as a byte array, or null if the control has no data.

setValue

protected void setValue(byte[] controlValue)
Sets the control-specific data of the object. This method is for use by an extension of LDAPControl.


isCritical

public boolean isCritical()
Returns whether the control is critical for the operation.

Returns:
Returns true if the control must be supported for an associated operation to be executed, and false if the control is not required for the operation.

register

public static void register(java.lang.String oid,
                            java.lang.Class controlClass)
Registers a class to be instantiated on receipt of a control with the given OID.

Any previous registration for the OID is overridden. The controlClass must be an extension of LDAPControl.

Parameters:
oid - The object identifier of the control.

controlClass - A class which can instantiate an LDAPControl.

getRegisteredControls

static RespControlVector getRegisteredControls()

getASN1Object

final RfcControl getASN1Object()
Returns the RFC 2251 Control object.

Returns:
An ASN.1 RFC 2251 Control.

newLine

void newLine(int indentTabs,
             java.io.Writer out)
       throws java.io.IOException
Throws:
java.io.IOException

writeDSML

public void writeDSML(java.io.OutputStream oout)
               throws java.io.IOException
This method does DSML serialization of the instance.

Parameters:
oout - Outputstream where the serialzed data has to be written
Throws:
java.io.IOException - if write fails on OutputStream

readDSML

public static java.lang.Object readDSML(java.io.InputStream input)
                                 throws java.io.IOException
This method is used to deserialize the DSML encoded representation of this class.

Parameters:
input - InputStream for the DSML formatted data.
Returns:
Deserialized form of this class.
Throws:
java.io.IOException - when serialization fails.

getXMLHandler

static LDAPXMLHandler getXMLHandler(java.lang.String tagname,
                                    LDAPXMLHandler parenthandler)
This method return the LDAPHandler which handles the XML (DSML) tags for this class

Parameters:
tagname - Name of the Root tag used to represent this class.
parenthandler - Parent LDAPXMLHandler for this tag.
Returns:
LDAPXMLHandler to handle this element.

toString

public java.lang.String toString()
Returns a string representation of this class.

Overrides:
toString in class java.lang.Object
Returns:
The string representation of this class.

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes the object state to a stream in XML format

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - The ObjectOutput stream where the Object in XML format is being written to
Throws:
java.io.IOException - - If I/O errors occur

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the serialized object from the underlying input stream.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - The ObjectInput stream where the Serialized Object is being read from
Throws:
java.io.IOException - - If I/O errors occur
java.lang.ClassNotFoundException - - If the class for an object being restored cannot be found.

All LDAP Classes
Internal LDAP Classes

Copyright ? 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000