Line data Source code
1 : // 2 : // Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. 3 : // Copyright Contributors to the OpenSDN project 4 : // 5 : 6 : #ifndef ZOOKEEPER_ZOOKEEPER_INTERFACE_H_ 7 : #define ZOOKEEPER_ZOOKEEPER_INTERFACE_H_ 8 : 9 : #include <zookeeper/zookeeper.h> 10 : 11 : namespace zookeeper { 12 : namespace interface { 13 : 14 : class ZookeeperInterface { 15 : public: 16 6 : virtual ~ZookeeperInterface() {} 17 : virtual void ZooSetDebugLevel(ZooLogLevel logLevel) = 0; 18 : virtual zhandle_t* ZookeeperInit(const char *host, watcher_fn fn, 19 : int recv_timeout, const clientid_t *clientid, void *context, 20 : int flags) = 0; 21 : virtual int ZookeeperClose(zhandle_t *zh) = 0; 22 : virtual int ZooState(zhandle_t *zh) = 0; 23 : virtual int ZooCreate(zhandle_t *zh, const char *path, const char *value, 24 : int valuelen, const struct ACL_vector *acl, int flags, 25 : char *path_buffer, int path_buffer_len) = 0; 26 : virtual int ZooDelete(zhandle_t *zh, const char *path, int version) = 0; 27 : virtual int ZooGet(zhandle_t *zh, const char *path, int watch, 28 : char *buffer, int* buffer_len, struct Stat *stat) = 0; 29 : virtual int ZooExists(zhandle_t *zh, const char *path, int watch, 30 : struct Stat *stat) = 0; 31 : virtual void ZooSetContext(zhandle_t * zh, void *context) = 0; 32 : virtual int ZooIsUnrecoverable(zhandle_t * zh) = 0; 33 : }; 34 : 35 : } // namespace interface 36 : } // namespace zookeeper 37 : 38 : #endif // ZOOKEEPER_ZOOKEEPER_INTERFACE_H_