ROOT logo
// @(#)root/ldap:$Id$
// Author: Oleksandr Grebenyuk   21/09/2001

/*************************************************************************
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TLDAPServer
#define ROOT_TLDAPServer

#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_CintLDAP
#include "CintLDAP.h"
#endif

class TList;
class TLDAPResult;
class TLDAPEntry;


class TLDAPServer : public TObject {

private:
   LDAP         *fLd;           // LDAP handle of current connection
   TString       fBinddn;       // Bind name
   TString       fPassword;     // Password
   Bool_t        fIsConnected;  // Current connection state

   Int_t         Bind();
   void          Unbind();

   static void   DeleteMods(LDAPMod **mods);

protected:
   TLDAPServer(const TLDAPServer&);
   TLDAPServer& operator=(const TLDAPServer&);

public:
   TLDAPServer(const char *host, Int_t port = LDAP_PORT,
               const char *binddn = 0, const char *password = 0,
               Int_t version = LDAP_VERSION2);

   virtual ~TLDAPServer();

   Bool_t        IsConnected() const { return fIsConnected; };
   TLDAPResult  *Search(const char *base = "",
                        Int_t scope = LDAP_SCOPE_BASE,
                        const char *filter = 0,
                        TList *attrs = 0,
                        Bool_t attrsonly = 0);
   const char   *GetNamingContexts();
   const char   *GetSubschemaSubentry();
   TLDAPResult  *GetObjectClasses();
   TLDAPResult  *GetAttributeTypes();

   Int_t         AddEntry(TLDAPEntry &entry);
   Int_t         ModifyEntry(TLDAPEntry &entry, Int_t mode = LDAP_MOD_REPLACE);
   Int_t         DeleteEntry(const char *dn);
   Int_t         RenameEntry(const char *dn, const char *newrdn,
                             Bool_t removeattr = kFALSE);

   ClassDef(TLDAPServer, 0)  // Connection to LDAP server
};

#endif
 TLDAPServer.h:1
 TLDAPServer.h:2
 TLDAPServer.h:3
 TLDAPServer.h:4
 TLDAPServer.h:5
 TLDAPServer.h:6
 TLDAPServer.h:7
 TLDAPServer.h:8
 TLDAPServer.h:9
 TLDAPServer.h:10
 TLDAPServer.h:11
 TLDAPServer.h:12
 TLDAPServer.h:13
 TLDAPServer.h:14
 TLDAPServer.h:15
 TLDAPServer.h:16
 TLDAPServer.h:17
 TLDAPServer.h:18
 TLDAPServer.h:19
 TLDAPServer.h:20
 TLDAPServer.h:21
 TLDAPServer.h:22
 TLDAPServer.h:23
 TLDAPServer.h:24
 TLDAPServer.h:25
 TLDAPServer.h:26
 TLDAPServer.h:27
 TLDAPServer.h:28
 TLDAPServer.h:29
 TLDAPServer.h:30
 TLDAPServer.h:31
 TLDAPServer.h:32
 TLDAPServer.h:33
 TLDAPServer.h:34
 TLDAPServer.h:35
 TLDAPServer.h:36
 TLDAPServer.h:37
 TLDAPServer.h:38
 TLDAPServer.h:39
 TLDAPServer.h:40
 TLDAPServer.h:41
 TLDAPServer.h:42
 TLDAPServer.h:43
 TLDAPServer.h:44
 TLDAPServer.h:45
 TLDAPServer.h:46
 TLDAPServer.h:47
 TLDAPServer.h:48
 TLDAPServer.h:49
 TLDAPServer.h:50
 TLDAPServer.h:51
 TLDAPServer.h:52
 TLDAPServer.h:53
 TLDAPServer.h:54
 TLDAPServer.h:55
 TLDAPServer.h:56
 TLDAPServer.h:57
 TLDAPServer.h:58
 TLDAPServer.h:59
 TLDAPServer.h:60
 TLDAPServer.h:61
 TLDAPServer.h:62
 TLDAPServer.h:63
 TLDAPServer.h:64
 TLDAPServer.h:65
 TLDAPServer.h:66
 TLDAPServer.h:67
 TLDAPServer.h:68
 TLDAPServer.h:69
 TLDAPServer.h:70
 TLDAPServer.h:71