LDAPConnection.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
00003  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
00004  */
00005 
00006 #ifndef LDAP_CONNECTION_H
00007 #define LDAP_CONNECTION_H
00008 
00009 #include <LDAPSearchResults.h>
00010 #include <LDAPExtResult.h>
00011 #include <LDAPAsynConnection.h> 
00012 
00020 class LDAPConnection : private LDAPAsynConnection {
00021 
00022     public :
00027         static const int SEARCH_BASE;
00028 
00033         static const int SEARCH_ONE;
00034         
00039         static const int SEARCH_SUB;
00040         
00050         LDAPConnection(const std::string& hostname="localhost", int port=389,
00051                 LDAPConstraints* cons=new LDAPConstraints());
00052         
00056         ~LDAPConnection();
00057         
00069         void init(const std::string& hostname, int port);
00070         
00078         void start_tls();
00079 
00089         void bind(const std::string& dn="", const std::string& passwd="",
00090                 LDAPConstraints* cons=0);
00091         
00097         void unbind();
00098         
00116         bool compare(const std::string& dn, const LDAPAttribute& attr,
00117                 LDAPConstraints* cons=0);
00118        
00130         void del(const std::string& dn, const LDAPConstraints* cons=0);
00131         
00142         void add(const LDAPEntry* le, const LDAPConstraints* cons=0);
00143         
00155         void modify(const std::string& dn, const LDAPModList* mods, 
00156                 const LDAPConstraints* cons=0); 
00157 
00178         void rename(const std::string& dn, const std::string& newRDN, 
00179                 bool delOldRDN=false, const std::string& newParentDN="",
00180                 const LDAPConstraints* cons=0);
00181         
00203         LDAPSearchResults* search(const std::string& base, int scope=0, 
00204                 const std::string& filter="objectClass=*", 
00205                 const StringList& attrs=StringList(), bool attrsOnly=false,
00206                 const LDAPConstraints* cons=0);
00207        
00223         LDAPExtResult* extOperation(const std::string& oid, const std::string&
00224                 value="", const LDAPConstraints *const = 0);
00225         
00226         const std::string& getHost() const;
00227 
00228         int getPort() const;
00229         
00230         void setConstraints(LDAPConstraints *cons);
00231         
00232         const LDAPConstraints* getConstraints() const ;
00233 };
00234 
00235 #endif //LDAP_CONNECTION_H

Generated on Fri Jun 16 17:48:53 2006 for ldapsdk by  doxygen 1.4.6