|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.LDAPModification
public class LDAPModification
A single add, delete, or replace operation to an LDAPAttribute.
An LDAPModification contains information on the type of modification
being performed, the name of the attribute to be replaced, and the new
value. Multiple modifications are expressed as an array of modifications,
i.e., LDAPModification[]
.
An LDAPModification or an LDAPModification array enable you to modify an attribute of an LDAP entry. The entire array of modifications must be performed by the server as a single atomic operation in the order they are listed. No changes are made to the directory unless all the operations succeed. If all succeed, a success result is returned to the application. It should be noted that if the connection fails during a modification, it is indeterminate whether the modification occurred or not.
There are three types of modification operations: Add, Delete, and Replace.
Add: Creates the attribute if it doesn't exist, and adds the specified values. This operation must contain at least one value, and all values of the attribute must be unique.
Delete: Deletes specified values from the attribute. If no values are specified, or if all existing values of the attribute are specified, the attribute is removed. Mandatory attributes cannot be removed.
Replace: Creates the attribute if necessary, and replaces all existing values of the attribute with the specified values. If you wish to keep any existing values of a multi-valued attribute, you must include these values in the replace operation. A replace operation with no value will remove the entire attribute if it exists, and is ignored if the attribute does not exist.
Additional information on LDAP modifications is available in section 4.6 of rfc2251.txt
Sample Code:
LDAPConnection.modify(java.lang.String, com.novell.ldap.LDAPModification)
,
LDAPAttribute
,
Serialized FormField Summary | |
---|---|
static int |
ADD
Adds the listed values to the given attribute, creating the attribute if it does not already exist. |
private LDAPAttribute |
attr
|
static int |
DELETE
Deletes the listed values from the given attribute, removing the entire attribute (1) if no values are listed or (2) if all current values of the attribute are listed for deletion. |
private int |
op
|
static int |
REPLACE
Replaces all existing values of the given attribute with the new values listed, creating the attribute if it does not already exist. |
Constructor Summary | |
---|---|
LDAPModification()
This constructor was added to support default Serialization |
|
LDAPModification(int op,
LDAPAttribute attr)
Specifies a modification to be made to an attribute. |
Method Summary | |
---|---|
LDAPAttribute |
getAttribute()
Returns the attribute to modify, with any existing values. |
int |
getOp()
Returns the type of modification specified by this 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 |
(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. |
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private int op
private LDAPAttribute attr
public static final int ADD
ADD = 0
public static final int DELETE
DELETE = 1
public static final int REPLACE
A replace with no value deletes the entire attribute if it exists, and is ignored if the attribute does not exist.
REPLACE = 2
Constructor Detail |
---|
public LDAPModification()
public LDAPModification(int op, LDAPAttribute attr)
op
- The type of modification to make, which can be
one of the following:
attr
- The attribute to modify.Method Detail |
---|
public LDAPAttribute getAttribute()
public int getOp()
The type is one of the following:
void newLine(int indentTabs, java.io.Writer out) throws java.io.IOException
java.io.IOException
public void writeDSML(java.io.OutputStream oout) throws java.io.IOException
oout
- Outputstream where the serialzed data has to be written
java.io.IOException
- if write fails on OutputStreampublic static java.lang.Object readDSML(java.io.InputStream input) throws java.io.IOException
input
- InputStream for the DSML formatted data.
java.io.IOException
- when serialization fails.static LDAPXMLHandler getXMLHandler(java.lang.String tagname, LDAPXMLHandler parenthandler)
tagname
- Name of the Root tag used to represent this class.parenthandler
- Parent LDAPXMLHandler for this tag.
public java.lang.String toString()
toString
in class java.lang.Object
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The ObjectOutput stream where the Object in XML format
is being written to
java.io.IOException
- - If I/O errors occurpublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The ObjectInput stream where the Serialized Object is being read from
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 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |