Package netscape.ldap
Class LDAPModificationSet
- java.lang.Object
-
- netscape.ldap.LDAPModificationSet
-
- All Implemented Interfaces:
java.io.Serializable
public class LDAPModificationSet extends java.lang.Object implements java.io.SerializableRepresents a set of modifications to be made to attributes in an entry. A set of modifications is made up ofLDAPModificationobjects.After you specify a change to an attribute, you can execute the change by calling the
LDAPConnection.modifymethod and specifying the DN of the entry that you want to modify.- Version:
- 1.0
- See Also:
LDAPModification,LDAPConnection.modify(java.lang.String, netscape.ldap.LDAPModificationSet), Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDAPModificationSet()Constructs a new, empty set of modifications.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int op, LDAPAttribute attr)Specifies another modification to be added to the set of modifications.LDAPModificationelementAt(int index)Retrieves a particularLDAPModificationobject at the position specified by the index.voidremove(java.lang.String name)Removes the first attribute with the specified name in the set of modifications.voidremoveElementAt(int index)Removes a particularLDAPModificationobject at the position specified by the index.intsize()Retrieves the number ofLDAPModificationobjects in this set.java.lang.StringtoString()Retrieves the string representation of the modification set.
-
-
-
Method Detail
-
size
public int size()
Retrieves the number ofLDAPModificationobjects in this set.- Returns:
- the number of
LDAPModificationobjects in this set.
-
elementAt
public LDAPModification elementAt(int index)
Retrieves a particularLDAPModificationobject at the position specified by the index.- Parameters:
index- position of theLDAPModificationobject that you want to retrieve.- Returns:
LDAPModificationobject representing a change to make to an attribute.
-
removeElementAt
public void removeElementAt(int index)
Removes a particularLDAPModificationobject at the position specified by the index.- Parameters:
index- position of theLDAPModificationobject that you want to remove
-
add
public void add(int op, LDAPAttribute attr)Specifies another modification to be added to the set of modifications.- Parameters:
op- the type of modification to make. This can be one of the following:LDAPModification.ADD(the value should be added to the attribute)LDAPModification.DELETE(the value should be removed from the attribute)LDAPModification.REPLACE(the value should replace the existing value of the attribute)
If you are working with a binary value (not a string value), you need to bitwise OR (|) the modification type with
LDAPModification.BVALUES.attr- the attribute (possibly with values) to modify
-
remove
public void remove(java.lang.String name)
Removes the first attribute with the specified name in the set of modifications.- Parameters:
name- name of the attribute to remove
-
toString
public java.lang.String toString()
Retrieves the string representation of the modification set.- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the modification set.
-
-