|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.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. |
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. |
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(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. |
static java.lang.Object |
readDSML(java.io.InputStream input)
This method is used to deserialize the DSML encoded representation of this class. |
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
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(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:
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.public java.lang.String toString()
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |