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