Logo ROOT   6.16/01
Reference Guide
TLDAPServer.h
Go to the documentation of this file.
1// @(#)root/ldap:$Id$
2// Author: Oleksandr Grebenyuk 21/09/2001
3
4/*************************************************************************
5 * For the licensing terms see $ROOTSYS/LICENSE. *
6 * For the list of contributors see $ROOTSYS/README/CREDITS. *
7 *************************************************************************/
8
9#ifndef ROOT_TLDAPServer
10#define ROOT_TLDAPServer
11
12#include "TObject.h"
13#include "TString.h"
14#include "CintLDAP.h"
15
16class TList;
17class TLDAPResult;
18class TLDAPEntry;
19
20
21class TLDAPServer : public TObject {
22
23private:
24 LDAP *fLd; // LDAP handle of current connection
25 TString fBinddn; // Bind name
26 TString fPassword; // Password
27 Bool_t fIsConnected; // Current connection state
28
29 Int_t Bind();
30 void Unbind();
31
32 static void DeleteMods(LDAPMod **mods);
33
34protected:
37
38public:
39 TLDAPServer(const char *host, Int_t port = LDAP_PORT,
40 const char *binddn = 0, const char *password = 0,
41 Int_t version = LDAP_VERSION2);
42
43 virtual ~TLDAPServer();
44
45 Bool_t IsConnected() const { return fIsConnected; };
46 TLDAPResult *Search(const char *base = "",
47 Int_t scope = LDAP_SCOPE_BASE,
48 const char *filter = 0,
49 TList *attrs = 0,
50 Bool_t attrsonly = 0);
51 const char *GetNamingContexts();
52 const char *GetSubschemaSubentry();
55
57 Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode = LDAP_MOD_REPLACE);
58 Int_t DeleteEntry(const char *dn);
59 Int_t RenameEntry(const char *dn, const char *newrdn,
60 Bool_t removeattr = kFALSE);
61
62 ClassDef(TLDAPServer, 0) // Connection to LDAP server
63};
64
65#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:324
LDAP * fLd
Definition: TLDAPServer.h:24
virtual ~TLDAPServer()
If the object is connected to the server, it disconnects.
Definition: TLDAPServer.cxx:86
Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode=LDAP_MOD_REPLACE)
Modifies specified entry.
TLDAPResult * GetAttributeTypes()
Calls GetSubschemaSubentry() and performs and LDAPSearch with the attribute "attributeTypes" to be re...
TString fPassword
Definition: TLDAPServer.h:26
Bool_t IsConnected() const
Definition: TLDAPServer.h:45
TLDAPResult * GetObjectClasses()
Calls GetSubschemaSubentry() and performs and LDAPSearch with the attribute "objectClasses" to be ret...
const char * GetSubschemaSubentry()
Performs an LDAPSearch with the attribute "subschemaSubentry" to be returned with the result.
TString fBinddn
Definition: TLDAPServer.h:25
Bool_t fIsConnected
Definition: TLDAPServer.h:27
TLDAPServer(const TLDAPServer &)
Copy constructor.
Definition: TLDAPServer.cxx:60
void Unbind()
Unbinds from the server with specified binddn and password.
TLDAPResult * Search(const char *base="", Int_t scope=LDAP_SCOPE_BASE, const char *filter=0, TList *attrs=0, Bool_t attrsonly=0)
Performs searching at the LDAP directory.
static void DeleteMods(LDAPMod **mods)
Deletes the array of LDAPMod structures and frees its memory.
Int_t AddEntry(TLDAPEntry &entry)
Adds entry to the LDAP tree.
Int_t RenameEntry(const char *dn, const char *newrdn, Bool_t removeattr=kFALSE)
Renames the entry with specified DN, the entry must be leaf Be sure that you are bound with the write...
const char * GetNamingContexts()
Performs an LDAPSearch with the attribute "namingContexts" to be returned with the result.
TLDAPServer & operator=(const TLDAPServer &)
Equal operator.
Definition: TLDAPServer.cxx:72
Int_t DeleteEntry(const char *dn)
Deletes the entry with specified DN, the base entry must exist.
Int_t Bind()
Binds to the server with specified binddn and password.
Definition: TLDAPServer.cxx:95
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131