ldapsdk
0.0.1
Main Page
Classes
Files
File List
File Members
src
LDAPAsynConnection.h
Go to the documentation of this file.
1
// $OpenLDAP$
2
/*
3
* Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
4
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5
*/
6
7
8
#ifndef LDAP_ASYN_CONNECTION_H
9
#define LDAP_ASYN_CONNECTION_H
10
11
#include<iostream>
12
#include<string>
13
14
#include<ldap.h>
15
16
#include <
LDAPEntry.h
>
17
#include <
LDAPException.h
>
18
#include <
LDAPMessageQueue.h
>
19
#include <
LDAPConstraints.h
>
20
#include <
LDAPModification.h
>
21
#include <
LDAPModList.h
>
22
#include <
LDAPUrl.h
>
23
#include <
LDAPUrlList.h
>
24
#include <
SaslInteractionHandler.h
>
25
#include <
TlsOptions.h
>
26
27
//* Main class for an asynchronous LDAP connection
45
class
LDAPAsynConnection
{
46
public
:
51
static
const
int
SEARCH_BASE
=0;
52
57
static
const
int
SEARCH_ONE
=1;
58
63
static
const
int
SEARCH_SUB
=2;
64
71
LDAPAsynConnection
(
const
std::string& url=std::string(
"localhost"
),
72
int
port=0,
LDAPConstraints
*cons=
new
LDAPConstraints
() );
73
74
//* Destructor
75
virtual
~LDAPAsynConnection
();
87
void
init
(
const
std::string& hostname,
int
port);
88
96
void
initialize
(
const
std::string& uri);
97
105
void
start_tls
();
106
117
LDAPMessageQueue
*
bind
(
const
std::string& dn=
""
,
118
const
std::string& passwd=
""
,
119
const
LDAPConstraints
*cons=0);
120
121
LDAPMessageQueue
*
saslBind
(
const
std::string& mech,
122
const
std::string& cred,
123
const
LDAPConstraints
*cons=0);
124
125
LDAPMessageQueue
*
saslInteractiveBind
(
const
std::string& mech,
126
int
flags=0,
127
SaslInteractionHandler
*sih=0,
128
const
LDAPConstraints
*cons=0);
129
149
LDAPMessageQueue
*
search
(
const
std::string& base=
""
,
int
scope=0,
150
const
std::string& filter=
"objectClass=*"
,
151
const
StringList
& attrs=
StringList
(),
152
bool
attrsOnly=
false
,
153
const
LDAPConstraints
*cons=0);
154
165
LDAPMessageQueue
*
del
(
const
std::string& dn,
const
LDAPConstraints
*cons=0);
166
180
LDAPMessageQueue
*
compare
(
const
std::string& dn,
181
const
LDAPAttribute
& attr,
182
const
LDAPConstraints
*cons=0);
183
191
LDAPMessageQueue
*
add
(
const
LDAPEntry
* le,
192
const
LDAPConstraints
*
const
=0);
193
205
LDAPMessageQueue
*
modify
(
const
std::string& dn,
206
const
LDAPModList
*modlist,
207
const
LDAPConstraints
*cons=0);
208
223
LDAPMessageQueue
*
rename
(
const
std::string& dn,
224
const
std::string& newRDN,
225
bool
delOldRDN=
false
,
const
std::string& newParentDN=
""
,
226
const
LDAPConstraints
* cons=0);
227
239
LDAPMessageQueue
*
extOperation
(
const
std::string& oid,
240
const
std::string& value=
""
,
const
LDAPConstraints
*cons=0);
241
247
void
abandon
(
LDAPMessageQueue
*q);
248
254
void
unbind
();
255
260
LDAP*
getSessionHandle
()
const
;
261
266
const
std::string&
getHost
()
const
;
267
272
int
getPort
()
const
;
273
278
void
setConstraints
(
LDAPConstraints
*cons);
279
285
const
LDAPConstraints
*
getConstraints
()
const
;
286
TlsOptions
getTlsOptions
()
const
;
302
LDAPAsynConnection
*
referralConnect
(
const
LDAPUrlList
& urls,
303
LDAPUrlList::const_iterator
& usedUrl,
304
const
LDAPConstraints
* cons)
const
;
305
306
private
:
310
LDAPAsynConnection
(
const
LDAPAsynConnection
& lc){};
311
316
LDAP *cur_session;
317
323
LDAPConstraints
*m_constr;
324
328
LDAPUrl
m_uri;
329
330
protected
:
334
bool
m_cacheEnabled
;
335
};
336
#endif //LDAP_ASYN_CONNECTION_H
337
338
Generated by
1.8.1