ROOT  6.06/09
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 #ifndef ROOT_TObject
13 #include "TObject.h"
14 #endif
15 #ifndef ROOT_TString
16 #include "TString.h"
17 #endif
18 #ifndef ROOT_CintLDAP
19 #include "CintLDAP.h"
20 #endif
21 
22 class TList;
23 class TLDAPResult;
24 class TLDAPEntry;
25 
26 
27 class TLDAPServer : public TObject {
28 
29 private:
30  LDAP *fLd; // LDAP handle of current connection
31  TString fBinddn; // Bind name
32  TString fPassword; // Password
33  Bool_t fIsConnected; // Current connection state
34 
35  Int_t Bind();
36  void Unbind();
37 
38  static void DeleteMods(LDAPMod **mods);
39 
40 protected:
41  TLDAPServer(const TLDAPServer&);
43 
44 public:
45  TLDAPServer(const char *host, Int_t port = LDAP_PORT,
46  const char *binddn = 0, const char *password = 0,
47  Int_t version = LDAP_VERSION2);
48 
49  virtual ~TLDAPServer();
50 
51  Bool_t IsConnected() const { return fIsConnected; };
52  TLDAPResult *Search(const char *base = "",
53  Int_t scope = LDAP_SCOPE_BASE,
54  const char *filter = 0,
55  TList *attrs = 0,
56  Bool_t attrsonly = 0);
57  const char *GetNamingContexts();
58  const char *GetSubschemaSubentry();
61 
63  Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode = LDAP_MOD_REPLACE);
64  Int_t DeleteEntry(const char *dn);
65  Int_t RenameEntry(const char *dn, const char *newrdn,
66  Bool_t removeattr = kFALSE);
67 
68  ClassDef(TLDAPServer, 0) // Connection to LDAP server
69 };
70 
71 #endif
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.
TLDAPResult * GetAttributeTypes()
Calls GetSubschemaSubentry() and performs and LDAPSearch with the attribute "attributeTypes" to be re...
const char * GetSubschemaSubentry()
Performs an LDAPSearch with the attribute "subschemaSubentry" to be returned with the result...
Basic string class.
Definition: TString.h:137
const char * GetNamingContexts()
Performs an LDAPSearch with the attribute "namingContexts" to be returned with the result...
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
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...
TLDAPResult * GetObjectClasses()
Calls GetSubschemaSubentry() and performs and LDAPSearch with the attribute "objectClasses" to be ret...
Bool_t fIsConnected
Definition: TLDAPServer.h:33
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t ModifyEntry(TLDAPEntry &entry, Int_t mode=LDAP_MOD_REPLACE)
Modifies specified entry.
Int_t DeleteEntry(const char *dn)
Deletes the entry with specified DN, the base entry must exist.
A doubly linked list.
Definition: TList.h:47
virtual ~TLDAPServer()
If the object is connected to the server, it disconnects.
Definition: TLDAPServer.cxx:86
Bool_t IsConnected() const
Definition: TLDAPServer.h:51
TLDAPServer & operator=(const TLDAPServer &)
Equal operator.
Definition: TLDAPServer.cxx:72
Long64_t entry
TString fPassword
Definition: TLDAPServer.h:32
void Unbind()
Unbinds from the server with specified binddn and password.
static void DeleteMods(LDAPMod **mods)
Deletes the array of LDAPMod structures and frees its memory.
Mother of all ROOT objects.
Definition: TObject.h:58
TString fBinddn
Definition: TLDAPServer.h:31
Int_t Bind()
Binds to the server with specified binddn and password.
Definition: TLDAPServer.cxx:95
LDAP * fLd
Definition: TLDAPServer.h:30
Int_t AddEntry(TLDAPEntry &entry)
Adds entry to the LDAP tree.
TLDAPServer(const TLDAPServer &)
Copy constructor.
Definition: TLDAPServer.cxx:60