home *** CD-ROM | disk | FTP | other *** search
/ Popular Software (Premium Edition) / mycd.iso / INTERNET / NETSCAP4.06 / CP32E406.EXE / nav40.z / ldap10.jar / netscape / ldap / LDAPModification.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-08-13  |  1.7 KB  |  52 lines

  1. package netscape.ldap;
  2.  
  3. import netscape.ldap.ber.stream.BERConstruct;
  4. import netscape.ldap.ber.stream.BERElement;
  5. import netscape.ldap.ber.stream.BEREnumerated;
  6. import netscape.ldap.ber.stream.BERSequence;
  7.  
  8. public class LDAPModification {
  9.    public static final int ADD = 0;
  10.    public static final int DELETE = 1;
  11.    public static final int REPLACE = 2;
  12.    public static final int BVALUES = 128;
  13.    private int operation;
  14.    private LDAPAttribute attribute;
  15.  
  16.    public LDAPModification(int var1, LDAPAttribute var2) {
  17.       this.operation = var1;
  18.       this.attribute = var2;
  19.    }
  20.  
  21.    public int getOp() {
  22.       return this.operation;
  23.    }
  24.  
  25.    public LDAPAttribute getAttribute() {
  26.       return this.attribute;
  27.    }
  28.  
  29.    public BERElement getBERElement() {
  30.       BERSequence var1 = new BERSequence();
  31.       ((BERConstruct)var1).addElement(new BEREnumerated(this.operation));
  32.       ((BERConstruct)var1).addElement(this.attribute.getBERElement());
  33.       return var1;
  34.    }
  35.  
  36.    public String toString() {
  37.       String var1 = "LDAPModification: ";
  38.       if (this.operation == 0) {
  39.          var1 = var1 + "ADD, ";
  40.       } else if (this.operation == 1) {
  41.          var1 = var1 + "DELETE, ";
  42.       } else if (this.operation == 2) {
  43.          var1 = var1 + "REPLACE, ";
  44.       } else {
  45.          var1 = var1 + "INVALID OP, ";
  46.       }
  47.  
  48.       var1 = var1 + this.attribute;
  49.       return var1;
  50.    }
  51. }
  52.