# 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 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 Instance

`Instance.Reporter`

### Nested classes/interfaces inherited from interface Watcher

`Watcher.Event, Watcher.WatcherType`

## Constructor Summary

Constructors
Constructor
Description
`SimpleClient()`

## Method Summary

Modifier and Type
Method
Description
`void`
`configure(String params)`
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`
`setReporter(Instance.Reporter r)`
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.
`String`
`toString()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SimpleClient

public SimpleClient()

## Method Details

### configure

public void configure(String params)
Description copied from interface: `Instance`
This will be the second method invoked by the InstanceContainer. It may be invoked again if the configuration changes.

Specified by:
  `configure` in interface `Instance`
Parameters:
  `params` - parameters that were passed to the InstanceManager when this instance was scheduled.

### start

public void start()
Description copied from interface: `Instance`
Starts this instance.

Specified by:
  `start` in interface `Instance`

### stop

public void stop()
Description copied from interface: `Instance`
Stops this instance.

Specified by:
  `stop` in interface `Instance`

### process

public void process(WatchedEvent event)

Specified by:
  `process` in interface `Watcher`

### processResult

public void processResult(int rc, String path, Object ctx, byte[] data, Stat stat)
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 interface `AsyncCallback.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:
  - `ZooKeeper.getData(String, boolean, AsyncCallback.DataCallback, Object)`
  - `ZooKeeper.getData(String, Watcher, AsyncCallback.DataCallback, Object)`
  - `ZooKeeper.getConfig(boolean, AsyncCallback.DataCallback, Object)`
  - `ZooKeeper.getConfig(Watcher, AsyncCallback.DataCallback, Object)`

### processResult

public void processResult(int rc, String path, Object ctx, String name)
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 interface `AsyncCallback.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:
  - `ZooKeeper.create(String, byte[], List, CreateMode, AsyncCallback.StringCallback, Object)`

### processResult

public void processResult(int rc, String path, Object ctx, Stat stat)
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 interface `AsyncCallback.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:
  - `ZooKeeper.exists(String, boolean, AsyncCallback.StatCallback, Object)`
  - `ZooKeeper.exists(String, Watcher, AsyncCallback.StatCallback, Object)`
  - `ZooKeeper.setData(String, byte[], int, AsyncCallback.StatCallback, Object)`
  - `ZooKeeper.setACL(String, List, int, AsyncCallback.StatCallback, Object)`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### setReporter

public void setReporter(Instance.Reporter r)
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 interface `Instance`
Parameters:
  `r` - a handle to use to report on status changes.