public class LDAPModification
extends java.lang.Object
implements java.io.Serializable
After you specify a change to an attribute, you can execute the change
by calling the LDAPConnection.modify method and specifying
the DN of the entry that you want to modify.
LDAPConnection.modify(java.lang.String, netscape.ldap.LDAPModification),
Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
ADD
Specifies that a value should be added to an attribute.
|
static int |
DELETE
Specifies that a value should be removed from an attribute.
|
static int |
INCREMENT |
static int |
REPLACE
Specifies that a value should replace the existing value in an attribute.
|
| Constructor and Description |
|---|
LDAPModification(int op,
LDAPAttribute attr)
Specifies a modification to be made to an attribute.
|
LDAPModification(LDAPModification modif)
clone constuctor
|
| Modifier and Type | Method and Description |
|---|---|
BERElement |
encodeToBERElement()
Retrieves the BER (Basic Encoding Rules) representation
of the current modification.
|
boolean |
equals(java.lang.Object obj) |
static LDAPModification |
findLDAPModification(LDAPModification[] arrayLDAPModification,
java.lang.String attrName)
find LDAPModification by its name, return null if not found.
|
LDAPAttribute |
getAttribute()
Returns the attribute (possibly with values) to be modified.
|
static int |
getDirContextModificationOp(int ldapModificationOp)
convert DirContext code to LDAPModification code
|
static int |
getLDAPModificationOp(int dirContexOp)
convert DirContext code to LDAPModification code
|
int |
getOp()
Returns the type of modification specified by this object.
|
static int |
getOPcode(java.lang.String OPstring)
Convert OP String to int code
|
int |
getOpDirContext()
code as used in DirContext is different.
|
static java.lang.String |
getOPstring(int OPcode)
Convert OP code to String
|
void |
setAttribute(LDAPAttribute attribute)
set the attribute (possibly with values) to be modified.
|
void |
setOp(int operation)
set the type of modification specified by this object.
|
java.lang.String |
toString()
Retrieves the string representation of the current
modification.
|
java.lang.String |
toString(java.lang.String entryDn) |
public static final int ADD
public static final int DELETE
public static final int REPLACE
public static final int INCREMENT
public LDAPModification(int op,
LDAPAttribute attr)
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)
LDAPModification.INCEMENT (RFC 4525)
attr - the attribute (possibly with values) to modifyLDAPAttributepublic LDAPModification(LDAPModification modif)
modif - public int getOp()
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)
LDAPModification.INCEMENT (RFC 4525)
public int getOpDirContext()
public LDAPAttribute getAttribute()
LDAPAttributepublic BERElement encodeToBERElement()
public java.lang.String toString()
LDAPModification: REPLACE, LDAPAttribute {type='mail', values='babs@ace.com'}
LDAPModification: ADD, LDAPAttribute {type='description', values='This entry was modified with the modattrs program'}
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String entryDn)
public static int getLDAPModificationOp(int dirContexOp)
dirContexOp - public static java.lang.String getOPstring(int OPcode)
public static int getOPcode(java.lang.String OPstring)
OPstring - public static int getDirContextModificationOp(int ldapModificationOp)
ldapModificationOp - public void setOp(int operation)
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)
LDAPModification.INCEMENT (RFC 4525)
public void setAttribute(LDAPAttribute attribute)
LDAPAttributepublic static LDAPModification findLDAPModification(LDAPModification[] arrayLDAPModification, java.lang.String attrName)
arrayLDAPModification - attrName - public boolean equals(java.lang.Object obj)
equals in class java.lang.Object