Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

LDAPQuery.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * LDAPQuery.h
00004  *
00005  * Copyright (c) 2002 INFN, CERN on behalf of the EU DataGrid.
00006  * For license conditions see LICENSE file or 
00007  * http://www.edg.org/license.html
00008  * 
00009  */
00010 
00011 #ifndef EDGReplicaManager_LDAPQuery_H
00012 #define EDGReplicaManager_LDAPQuery_H
00013 
00014 /*
00015  * @author <a href="mailto:Heinz.Stockinger@cern.ch">Giuseppe Andronico</a>
00016  * @author <a href="mailto:Giuseppe.Andronico@ct.infn.it">Heinz Stockinger</a>
00017  * @author <a href="mailto:Peter.Kunszt@cern.ch">Peter Kunszt</a>
00018  * @version $Id: LDAPQuery.h,v 1.3 2004/06/14 12:01:17 jamesc Exp $
00019  */
00020 
00021 #include <sys/time.h>
00022 
00023 #include <string>
00024 #include <vector>
00025 #include <map>
00026 #include <list>
00027 
00028 //LDAP includes
00029 #include "lber.h"
00030 #include "ldap.h"
00031 
00032 #include "EdgReplicaManager/ReplicaManagerExceptions.h"
00033 
00034 namespace EdgReplicaManager {
00035 
00039     class LDAPQuery {
00040     public: 
00041         LDAPQuery(const std::string& baseDN, const std::string& hostname) throw(LDAPException);
00042 
00043         ~LDAPQuery();
00044 
00046         const std::vector<std::string>& query(const std::string& constraint,
00047                                               const std::string& attr) throw(LDAPException);
00048 
00049 
00050     private:
00051 
00053         const std::string m_baseDN;
00055         std::string m_hostname;
00057         int m_port;
00059         LDAP* m_handle;
00061         struct timeval m_timeout;
00063         std::vector<std::string> m_buffer;
00065         LDAPMessage* m_result;
00066 
00067     };
00068 
00069 };
00070 
00071 #endif
The EU DataGrid Project. All rights reserved.