Package netscape.ldap

Class LDAPModification

java.lang.Object
netscape.ldap.LDAPModification
All Implemented Interfaces:
Serializable

public class LDAPModification extends Object implements Serializable
Specifies changes to be made to the values of an attribute. The change is specified in terms of the following aspects:

  • the type of modification (add, replace, or delete the value of an attribute)
  • the type of value being modified (string or binary)
  • the name of the attribute being modified
  • the actual value

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.

Version:
1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Specifies that a value should be added to an attribute.
    static final int
    Specifies that a value should be removed from an attribute.
    static final int
    Specifies that a value should replace the existing value in an attribute.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Specifies a modification to be made to an attribute.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the attribute (possibly with values) to be modified.
    Retrieves the BER (Basic Encoding Rules) representation of the current modification.
    int
    Returns the type of modification specified by this object.
    Retrieves the string representation of the current modification.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • ADD

      public static final int ADD
      Specifies that a value should be added to an attribute.
      See Also:
    • DELETE

      public static final int DELETE
      Specifies that a value should be removed from an attribute.
      See Also:
    • REPLACE

      public static final int REPLACE
      Specifies that a value should replace the existing value in an attribute.
      See Also:
  • Constructor Details

    • LDAPModification

      public LDAPModification(int op, LDAPAttribute attr)
      Specifies a modification to be made to an attribute.
      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)

      attr - the attribute (possibly with values) to modify
      See Also:
  • Method Details

    • getOp

      public int getOp()
      Returns the type of modification specified by this object.
      Returns:
      one of the following types of modifications:

      • 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)

    • getAttribute

      public LDAPAttribute getAttribute()
      Returns the attribute (possibly with values) to be modified.
      Returns:
      the attribute to be modified.
      See Also:
    • getBERElement

      public BERElement getBERElement()
      Retrieves the BER (Basic Encoding Rules) representation of the current modification.
      Returns:
      BER representation of the modification.
    • toString

      public String toString()
      Retrieves the string representation of the current modification. For example:
       LDAPModification: REPLACE, LDAPAttribute {type='mail', values='babs@ace.com'}
       LDAPModification: ADD, LDAPAttribute {type='description', values='This entry was modified with the modattrs program'}
       
      Overrides:
      toString in class Object
      Returns:
      string representation of the current modification.