]> git.sur5r.net Git - openldap/blobdiff - contrib/ldapc++/src/LDAPConnection.h
Added client side caching. (Commited by: Jeff Costlow <j.costlow@f5.com>)
[openldap] / contrib / ldapc++ / src / LDAPConnection.h
index 7016665fe325328ff7cf021f2686c267df1f12b5..0be90837c420284a9b4a9e2cab3237ef805ab2dd 100644 (file)
@@ -68,6 +68,14 @@ class LDAPConnection : private LDAPAsynConnection {
          */
         void init(const 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.
+         */
+        int start_tls();
+
         /** 
          * Performs a simple authentication with the server
          *
@@ -221,6 +229,22 @@ class LDAPConnection : private LDAPAsynConnection {
         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();
+
 };
 
 #endif //LDAP_CONNECTION_H