00001 /*************************************************************************** 00002 * filename : LDAPConnection.h 00003 * authors : Salvatore Monforte <salvatore.monforte@ct.infn.it> 00004 * copyright : (C) 2001, 2002 by INFN 00005 ***************************************************************************/ 00006 00013 // $Id: 00014 // $Date: 00015 00016 #include<string> 00017 00018 #ifndef _LDAPCONNECTION_ 00019 #define _LDAPCONNECTION_ 00020 00021 namespace edg { 00022 namespace workload { 00023 namespace common { 00024 namespace ldif2classad { 00025 00026 class LDAPQuery; 00027 class LDIFObject; 00028 00034 struct generic_result_entry_t 00035 { 00040 virtual std::string distinguished_name() const = 0; 00045 virtual bool good() const = 0; 00050 virtual bool next() = 0; 00051 virtual LDIFObject* value() = 0; 00055 virtual ~generic_result_entry_t() {} 00056 }; 00057 00063 struct generic_search_result_t 00064 { 00068 virtual ~generic_search_result_t() {} 00069 00074 virtual bool good() const = 0; 00079 virtual bool empty() const = 0; 00080 00085 virtual generic_result_entry_t* make_first_entry() const = 0; 00086 }; 00087 00093 struct LDAPConnection 00094 { 00100 virtual bool open() = 0; 00106 virtual bool close() = 0; 00112 virtual generic_search_result_t* execute( LDAPQuery* ) = 0; 00113 00118 virtual bool is_established() const = 0; 00130 virtual ~LDAPConnection() {} 00131 }; 00132 00133 } // namespace ldif2classad 00134 } // namespace common 00135 } // namespace workload 00136 } // namespace edg 00137 00138 #endif 00139 00140 /* 00141 Local Variables: 00142 mode: c++ 00143 End: 00144 */ 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154