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

  1. package netscape.ldap;
  2.  
  3. import java.io.ByteArrayOutputStream;
  4. import java.io.IOException;
  5. import netscape.ldap.ber.stream.BERConstruct;
  6. import netscape.ldap.ber.stream.BERSequence;
  7.  
  8. public class LDAPControl implements Cloneable {
  9.    public static final String MANAGEDSAIT = "2.16.840.1.113730.3.4.2";
  10.    public static final String SORTRESPONSE = "1.2.840.113556.1.4.474";
  11.    public static final String PERSISTENTSEARCH = "2.16.840.1.113730.3.4.3";
  12.    public static final String PWEXPIRED = "2.16.840.1.113730.3.4.4";
  13.    public static final String PWEXPIRING = "2.16.840.1.113730.3.4.5";
  14.    public static final String ENTRYCHANGED = "2.16.840.1.113730.3.4.7";
  15.    private String m_oid;
  16.    protected boolean m_critical = false;
  17.    protected byte[] m_value;
  18.  
  19.    public LDAPControl() {
  20.    }
  21.  
  22.    public LDAPControl(String var1, boolean var2, byte[] var3) {
  23.       this.m_oid = var1;
  24.       this.m_critical = var2;
  25.       this.m_value = var3;
  26.    }
  27.  
  28.    public String getID() {
  29.       return this.m_oid;
  30.    }
  31.  
  32.    public boolean isCritical() {
  33.       return this.m_critical;
  34.    }
  35.  
  36.    public byte[] getValue() {
  37.       return this.m_value;
  38.    }
  39.  
  40.    public Object clone() {
  41.       byte[] var1 = null;
  42.       if (this.m_value != null) {
  43.          var1 = new byte[this.m_value.length];
  44.  
  45.          for(int var2 = 0; var2 < this.m_value.length; ++var2) {
  46.             var1[var2] = this.m_value[var2];
  47.          }
  48.       }
  49.  
  50.       LDAPControl var3 = new LDAPControl(this.m_oid, this.m_critical, var1);
  51.       return var3;
  52.    }
  53.  
  54.    protected byte[] flattenBER(BERSequence var1) {
  55.       ByteArrayOutputStream var2 = new ByteArrayOutputStream();
  56.  
  57.       try {
  58.          ((BERConstruct)var1).write(var2);
  59.       } catch (IOException var3) {
  60.          return null;
  61.       }
  62.  
  63.       return var2.toByteArray();
  64.    }
  65. }
  66.