+// $OpenLDAP$
/*
- * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 2000-2012 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
* @param cons Default constraints to use with operations over
* this connection
*/
- LDAPConnection(const string& hostname="localhost", int port=389,
+ LDAPConnection(const std::string& hostname="localhost", int port=389,
LDAPConstraints* cons=new LDAPConstraints());
/**
* LDAP-Server
* @param port The Network Port the server is running on
*/
- void init(const string& hostname, int port);
+ void init(const std::string& hostname, int port);
/**
* Start TLS on this connection. This isn't in the constructor,
* because it could fail (i.e. server doesn't have SSL cert, client
- * api wasn't compiled against OpenSSL, etc.). If you need TLS,
- * then you should error if this call fails with an error code.
+ * api wasn't compiled against OpenSSL, etc.).
+ * @throws LDAPException if the TLS Layer could not be setup
+ * correctly
*/
- int start_tls();
+ void start_tls();
/**
* Performs a simple authentication with the server
* @param dn The name of the entry to bind as
* @param passwd The cleartext password for the entry
*/
- void bind(const string& dn="", const string& passwd="",
+ void bind(const std::string& dn="", const std::string& passwd="",
LDAPConstraints* cons=0);
+ void saslInteractiveBind(const std::string& mech,
+ int flags=0,
+ SaslInteractionHandler *sih=0,
+ const LDAPConstraints *cons=0);
/**
* Performs the UNBIND-operation on the destination server
* attr-parameter matched an Attribute of the entry. false if it
* did not match
*/
- bool compare(const string& dn, const LDAPAttribute& attr,
+ bool compare(const std::string& dn, const LDAPAttribute& attr,
LDAPConstraints* cons=0);
/**
* @param cons A set of constraints that should be used with this
* request
*/
- void del(const string& dn, const LDAPConstraints* cons=0);
+ void del(const std::string& dn, const LDAPConstraints* cons=0);
/**
* Use this method to perform the ADD-operation
* @param cons A set of constraints that should be used with this
* request
*/
- void modify(const string& dn, const LDAPModList* mods,
+ void modify(const std::string& dn, const LDAPModList* mods,
const LDAPConstraints* cons=0);
/**
* @param cons A set of constraints that should be used with this
* request
*/
- void rename(const string& dn, const string& newRDN,
- bool delOldRDN=false, const string& newParentDN="",
+ void rename(const std::string& dn, const std::string& newRDN,
+ bool delOldRDN=false, const std::string& newParentDN="",
const LDAPConstraints* cons=0);
/**
* LDAPAsynConnection::SEARCH_BASE, <BR>
* LDAPAsynConnection::SEARCH_ONE, <BR>
* LDAPAsynConnection::SEARCH_SUB
- * @param filter The string representation of a search filter to
+ * @param filter The std::string representation of a search filter to
* use with this operation
* @param attrsOnly true if only the attributes names (no values)
* should be returned
* @returns A pointer to a LDAPSearchResults-object that can be
* used to read the results of the search.
*/
- LDAPSearchResults* search(const string& base, int scope=0,
- const string& filter="objectClass=*",
+ LDAPSearchResults* search(const std::string& base, int scope=0,
+ const std::string& filter="objectClass=*",
const StringList& attrs=StringList(), bool attrsOnly=false,
const LDAPConstraints* cons=0);
* @returns The result of the Extended Operation as an
* pointer to a LDAPExtResult-object.
*/
- LDAPExtResult* extOperation(const string& oid, const string&
+ LDAPExtResult* extOperation(const std::string& oid, const std::string&
value="", const LDAPConstraints *const = 0);
- const string& getHost() const;
+ const std::string& getHost() const;
int getPort() const;
void setConstraints(LDAPConstraints *cons);
const LDAPConstraints* getConstraints() const ;
-
- /**
- * Turn on caching, maxmem is in MB and timeout is in seconds.
- * maxmem can be zero if you want to restrict caching by timeout only.
- */
- int enableCache(long timeout, long maxmem);
- /// disable caching.
- void disableCache();
- /// is cacheEnabled?
- bool getCacheEnabled();
- /// uncache a specific dn. Used internally by methods that write.
- void uncache_entry(string &dn);
- /// used to clear the cache. Probably should be used after creating
- /// an object that a cached search should find.
- void flush_cache();
-
+ TlsOptions getTlsOptions() const;
};
#endif //LDAP_CONNECTION_H