Package org.apache.zookeeper.test.system
Class SimpleClient
java.lang.Object
org.apache.zookeeper.test.system.SimpleClient
- All Implemented Interfaces:
AsyncCallback
,AsyncCallback.DataCallback
,AsyncCallback.StatCallback
,AsyncCallback.StringCallback
,Instance
,Watcher
public class SimpleClient
extends Object
implements Instance, Watcher, AsyncCallback.DataCallback, AsyncCallback.StringCallback, AsyncCallback.StatCallback
The client that gets spawned for the SimpleSysTest
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.zookeeper.AsyncCallback
AsyncCallback.ACLCallback, AsyncCallback.AllChildrenNumberCallback, AsyncCallback.Children2Callback, AsyncCallback.ChildrenCallback, AsyncCallback.Create2Callback, AsyncCallback.DataCallback, AsyncCallback.EphemeralsCallback, AsyncCallback.MultiCallback, AsyncCallback.StatCallback, AsyncCallback.StringCallback, AsyncCallback.VoidCallback
Nested classes/interfaces inherited from interface org.apache.zookeeper.test.system.Instance
Instance.Reporter
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
Watcher.Event, Watcher.WatcherType
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
This will be the second method invoked by the InstanceContainer.void
process
(WatchedEvent event) void
processResult
(int rc, String path, Object ctx, byte[] data, Stat stat) Process the result of asynchronous calls.void
processResult
(int rc, String path, Object ctx, String name) Process the result of the asynchronous call.void
processResult
(int rc, String path, Object ctx, Stat stat) Process the result of the asynchronous call.void
This will be the first method invoked by the InstanceContainer after an instance of this interface has been constructed.void
start()
Starts this instance.void
stop()
Stops this instance.toString()
-
Constructor Details
-
SimpleClient
public SimpleClient()
-
-
Method Details
-
configure
Description copied from interface:Instance
This will be the second method invoked by the InstanceContainer. It may be invoked again if the configuration changes. -
start
public void start()Description copied from interface:Instance
Starts this instance. -
stop
public void stop()Description copied from interface:Instance
Stops this instance. -
process
-
processResult
Description copied from interface:AsyncCallback.DataCallback
Process the result of asynchronous calls.On success, rc is
KeeperException.Code.OK
.On failure, rc is set to the corresponding failure code in
KeeperException
.KeeperException.Code.NONODE
- The node on given path doesn't exist for some API calls.
- Specified by:
processResult
in interfaceAsyncCallback.DataCallback
- Parameters:
rc
- The return code or the result of the call.path
- The path that we passed to asynchronous calls.ctx
- Whatever context object that we passed to asynchronous calls.data
- The data of the node.stat
-Stat
object of the node on given path.- See Also:
-
processResult
Description copied from interface:AsyncCallback.StringCallback
Process the result of the asynchronous call.On success, rc is
KeeperException.Code.OK
.On failure, rc is set to the corresponding failure code in
KeeperException
.KeeperException.Code.NODEEXISTS
- The node on give path already exists for some API calls.KeeperException.Code.NONODE
- The node on given path doesn't exist for some API calls.KeeperException.Code.NOCHILDRENFOREPHEMERALS
- An ephemeral node cannot have children. There is discussion in community. It might be changed in the future.
- Specified by:
processResult
in interfaceAsyncCallback.StringCallback
- Parameters:
rc
- The return code or the result of the call.path
- The path that we passed to asynchronous calls.ctx
- Whatever context object that we passed to asynchronous calls.name
- The name of the znode that was created. On success, name and path are usually equal, unless a sequential node has been created.- See Also:
-
processResult
Description copied from interface:AsyncCallback.StatCallback
Process the result of the asynchronous call.On success, rc is
KeeperException.Code.OK
.On failure, rc is set to the corresponding failure code in
KeeperException
.-
KeeperException.Code.NONODE
- The node on given path doesn't exist for some API calls. -
KeeperException.Code.BADVERSION
- The given version doesn't match the node's version for some API calls.
- Specified by:
processResult
in interfaceAsyncCallback.StatCallback
- Parameters:
rc
- The return code or the result of the call.path
- The path that we passed to asynchronous calls.ctx
- Whatever context object that we passed to asynchronous calls.stat
-Stat
object of the node on given path.- See Also:
-
-
toString
-
setReporter
Description copied from interface:Instance
This will be the first method invoked by the InstanceContainer after an instance of this interface has been constructed. It will only be invoked once.- Specified by:
setReporter
in interfaceInstance
- Parameters:
r
- a handle to use to report on status changes.
-