home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / client / opers / JDAPResult.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-13  |  4.1 KB  |  146 lines

  1. package netscape.ldap.client.opers;
  2.  
  3. import java.io.IOException;
  4. import netscape.ldap.ber.stream.BERConstruct;
  5. import netscape.ldap.ber.stream.BERElement;
  6. import netscape.ldap.ber.stream.BEREnumerated;
  7. import netscape.ldap.ber.stream.BEROctetString;
  8. import netscape.ldap.ber.stream.BERSequence;
  9. import netscape.ldap.ber.stream.BERTag;
  10.  
  11. public class JDAPResult {
  12.    public static final int SUCCESS = 0;
  13.    public static final int OPERATION_ERROR = 1;
  14.    public static final int PROTOCOL_ERROR = 2;
  15.    public static final int TIME_LIMIT_EXCEEDED = 3;
  16.    public static final int SIZE_LIMIT_EXCEEDED = 4;
  17.    public static final int COMPARE_FALSE = 5;
  18.    public static final int COMPARE_TRUE = 6;
  19.    public static final int AUTH_METHOD_NOT_SUPPORTED = 7;
  20.    public static final int STRONG_AUTH_REQUIRED = 8;
  21.    public static final int LDAP_PARTIAL_RESULTS = 9;
  22.    public static final int REFERRAL = 10;
  23.    public static final int ADMIN_LIMIT_EXCEEDED = 11;
  24.    public static final int UNAVAILABLE_CRITICAL_EXTENSION = 12;
  25.    public static final int CONFIDENTIALITY_REQUIRED = 13;
  26.    public static final int SASL_BIND_IN_PROGRESS = 14;
  27.    public static final int NO_SUCH_ATTRIBUTE = 16;
  28.    public static final int UNDEFINED_ATTRIBUTE_TYPE = 17;
  29.    public static final int INAPPROPRIATE_MATCHING = 18;
  30.    public static final int CONSTRAINT_VIOLATION = 19;
  31.    public static final int ATTRIBUTE_OR_VALUE_EXISTS = 20;
  32.    public static final int INVALID_ATTRIBUTE_SYNTAX = 21;
  33.    public static final int NO_SUCH_OBJECT = 32;
  34.    public static final int ALIAS_PROBLEM = 33;
  35.    public static final int INVALID_DN_SYNTAX = 34;
  36.    public static final int IS_LEAF = 35;
  37.    public static final int ALIAS_DEREFERENCING_PROBLEM = 36;
  38.    public static final int INAPPROPRIATE_AUTHENTICATION = 48;
  39.    public static final int INVALID_CREDENTIALS = 49;
  40.    public static final int INSUFFICIENT_ACCESS_RIGHTS = 50;
  41.    public static final int BUSY = 51;
  42.    public static final int UNAVAILABLE = 52;
  43.    public static final int UNWILLING_TO_PERFORM = 53;
  44.    public static final int LOOP_DETECT = 54;
  45.    public static final int NAMING_VIOLATION = 64;
  46.    public static final int OBJECT_CLASS_VIOLATION = 65;
  47.    public static final int NOT_ALLOWED_ON_NONLEAF = 66;
  48.    public static final int NOT_ALLOWED_ON_RDN = 67;
  49.    public static final int ENTRY_ALREADY_EXISTS = 68;
  50.    public static final int OBJECT_CLASS_MODS_PROHIBITED = 69;
  51.    public static final int AFFECTS_MULTIPLE_DSAS = 71;
  52.    public static final int OTHER = 80;
  53.    public static final int SERVER_DOWN = 81;
  54.    public static final int PARAM_ERROR = 89;
  55.    public static final int CONNECT_ERROR = 91;
  56.    public static final int LDAP_NOT_SUPPORTED = 92;
  57.    public static final int CONTROL_NOT_FOUND = 93;
  58.    public static final int NO_RESULTS_RETURNED = 94;
  59.    public static final int MORE_RESULTS_TO_RETURN = 95;
  60.    public static final int CLIENT_LOOP = 96;
  61.    public static final int REFERRAL_LIMIT_EXCEEDED = 97;
  62.    protected BERElement m_element;
  63.    protected int m_result_code;
  64.    protected String m_matched_dn;
  65.    protected String m_error_message;
  66.    protected String[] m_referrals;
  67.  
  68.    public JDAPResult(BERElement var1) throws IOException {
  69.       this.m_element = var1;
  70.       BERSequence var2 = (BERSequence)var1;
  71.       BERElement var3 = ((BERConstruct)var2).elementAt(0);
  72.       if (var3.getType() == 48) {
  73.          var2 = (BERSequence)var3;
  74.       }
  75.  
  76.       this.m_result_code = ((BEREnumerated)((BERConstruct)var2).elementAt(0)).getValue();
  77.       Object var4 = null;
  78.       byte[] var12 = ((BEROctetString)((BERConstruct)var2).elementAt(1)).getValue();
  79.       if (var12 == null) {
  80.          this.m_matched_dn = null;
  81.       } else {
  82.          try {
  83.             this.m_matched_dn = new String(var12, "UTF8");
  84.          } catch (Throwable var11) {
  85.          }
  86.       }
  87.  
  88.       var12 = ((BEROctetString)((BERConstruct)var2).elementAt(2)).getValue();
  89.       if (var12 == null) {
  90.          this.m_error_message = null;
  91.       } else {
  92.          try {
  93.             this.m_error_message = new String(var12, "UTF8");
  94.          } catch (Throwable var10) {
  95.          }
  96.       }
  97.  
  98.       if (((BERConstruct)var2).size() >= 4) {
  99.          BERTag var5 = (BERTag)((BERConstruct)var2).elementAt(3);
  100.          BERElement var6 = var5.getValue();
  101.          if (var6.getType() != 2 && var6 instanceof BERSequence) {
  102.             BERSequence var7 = (BERSequence)var6;
  103.             if (((BERConstruct)var7).size() > 0) {
  104.                this.m_referrals = new String[((BERConstruct)var7).size()];
  105.  
  106.                for(int var8 = 0; var8 < ((BERConstruct)var7).size(); ++var8) {
  107.                   try {
  108.                      this.m_referrals[var8] = new String(((BEROctetString)((BERConstruct)var7).elementAt(var8)).getValue(), "UTF8");
  109.                   } catch (Throwable var9) {
  110.                   }
  111.                }
  112.             }
  113.          }
  114.       }
  115.  
  116.    }
  117.  
  118.    public int getResultCode() {
  119.       return this.m_result_code;
  120.    }
  121.  
  122.    public String getMatchedDN() {
  123.       return this.m_matched_dn;
  124.    }
  125.  
  126.    public String getErrorMessage() {
  127.       return this.m_error_message;
  128.    }
  129.  
  130.    public String[] getReferrals() {
  131.       return this.m_referrals;
  132.    }
  133.  
  134.    public BERElement getBERElement() {
  135.       return this.m_element;
  136.    }
  137.  
  138.    public String getParamString() {
  139.       return "{resultCode=" + this.m_result_code + ", matcheDN=" + this.m_matched_dn + ", errorMessage=" + this.m_error_message + "}";
  140.    }
  141.  
  142.    public String toString() {
  143.       return "JDAPResult " + this.getParamString();
  144.    }
  145. }
  146.