ldapsdk 0.0.1
|
00001 // $OpenLDAP$ 00002 /* 00003 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00004 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00005 */ 00006 00007 00008 #ifndef LDAP_RESULT_H 00009 #define LDAP_RESULT_H 00010 00011 #include<iostream> 00012 #include<ldap.h> 00013 #include <LDAPMessage.h> 00014 #include <LDAPControlSet.h> 00015 #include <LDAPUrlList.h> 00016 00017 class LDAPRequest; 00018 class LDAPAsynConnection; 00019 00030 class LDAPResult : public LDAPMsg{ 00031 public : 00032 //Error codes from RFC 2251 00033 static const int SUCCESS = 0; 00034 static const int OPERATIONS_ERROR = 1; 00035 static const int PROTOCOL_ERROR = 2; 00036 static const int TIME_LIMIT_EXCEEDED = 3; 00037 static const int SIZE_LIMIT_EXCEEDED = 4; 00038 static const int COMPARE_FALSE = 5; 00039 static const int COMPARE_TRUE = 6; 00040 static const int AUTH_METHOD_NOT_SUPPORTED = 7; 00041 static const int STRONG_AUTH_REQUIRED = 8; 00042 00043 static const int REFERRAL = 10; 00044 static const int ADMIN_LIMIT_EXCEEDED = 11; 00045 static const int UNAVAILABLE_CRITICAL_EXTENSION = 12; 00046 static const int CONFIDENTIALITY_REQUIRED = 13; 00047 static const int SASL_BIND_IN_PROGRESS = 14; 00048 00049 static const int NO_SUCH_ATTRIBUTE = 16; 00050 static const int UNDEFINED_ATTRIBUTE_TYP = 17; 00051 static const int INAPPROPRIATE_MATCHING = 18; 00052 static const int CONSTRAINT_VIOLATION = 19; 00053 static const int ATTRIBUTE_OR_VALUE_EXISTS = 20; 00054 static const int INVALID_ATTRIBUTE_SYNTAX = 21; 00055 00056 static const int NO_SUCH_OBJECT = 32; 00057 static const int ALIAS_PROBLEM = 33; 00058 static const int INVALID_DN_SYNTAX = 34; 00059 00060 static const int ALIAS_DEREFERENCING_PROBLEM = 36; 00061 00062 static const int INAPPROPRIATE_AUTENTICATION = 48; 00063 static const int INVALID_CREDENTIALS = 49; 00064 static const int INSUFFICIENT_ACCESS = 50; 00065 static const int BUSY = 51; 00066 static const int UNAVAILABLE = 52; 00067 static const int UNWILLING_TO_PERFORM = 53; 00068 static const int LOOP_DETECT = 54; 00069 00070 static const int NAMING_VIOLATION = 64; 00071 static const int OBJECT_CLASS_VIOLATION = 65; 00072 static const int NOT_ALLOWED_ON_NONLEAF = 66; 00073 static const int NOT_ALLOWED_ON_RDN = 67; 00074 static const int ENTRY_ALREADY_EXISTS = 68; 00075 static const int OBJECT_CLASS_MODS_PROHIBITED = 69; 00076 00077 static const int AFFECTS_MULTIPLE_DSAS = 71; 00078 00079 // some Errorcodes defined in the LDAP C API DRAFT 00080 static const int OTHER = 80; 00081 static const int SERVER_DOWN = 81; 00082 static const int LOCAL_ERROR = 82; 00083 static const int ENCODING_ERROR = 83; 00084 static const int DECODING_ERROR = 84; 00085 static const int TIMEOUT = 85; 00086 static const int AUTH_UNKNOWN = 86; 00087 static const int FILTER_ERROR = 87; 00088 static const int USER_CANCELLED = 88; 00089 static const int PARAM_ERROR = 89; 00090 static const int NO_MEMORY = 90; 00091 static const int CONNECT_ERROR = 91; 00092 static const int NOT_SUPPORTED = 92; 00093 static const int CONTROL_NOT_FOUND = 93; 00094 static const int NO_RESULTS_RETURNED = 94; 00095 static const int MORE_RESULTS_TO_RETURN = 95; 00096 static const int CLIENT_LOOP = 96; 00097 static const int REFERRAL_LIMIT_EXCEEDED = 97; 00098 00106 LDAPResult(const LDAPRequest *req, LDAPMessage *msg); 00107 LDAPResult(int type, int resultCode, const std::string &msg); 00108 00112 virtual ~LDAPResult(); 00113 00118 int getResultCode() const; 00119 00125 std::string resToString() const; 00126 00132 const std::string& getErrMsg() const; 00133 00141 const std::string& getMatchedDN() const; 00142 00147 const LDAPUrlList& getReferralUrls() const; 00148 00149 private : 00150 int m_resCode; 00151 std::string m_matchedDN; 00152 std::string m_errMsg; 00153 LDAPUrlList m_referrals; 00154 00159 friend std::ostream& operator<<(std::ostream &s,LDAPResult &l); 00160 }; 00161 #endif //LDAP_RESULT_H 00162