LDAP Classes
Implements Java LDAP

com.novell.ldap
Class LDAPControl

java.lang.Object
  extended bycom.novell.ldap.LDAPControl
All Implemented Interfaces:
java.lang.Cloneable, java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
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

Constructor Summary
  LDAPControl()
          This constructor was added to support default Serialization
protected LDAPControl(com.novell.ldap.rfc2251.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.
 java.lang.String getID()
          Returns the identifier of the control.
 byte[] getValue()
          Returns the control-specific data of the object.
 boolean isCritical()
          Returns whether the control is critical for the operation.
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
 

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(com.novell.ldap.rfc2251.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.

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.

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.

toString

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

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.

LDAP Classes
Implements Java LDAP

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