ZK-1931/javazab — pull request #11 by EasonLiao (2014-06-13 17:10:25+00:00)
Title: Define the client facing interface to ZAB

Define the interface that will be used by the client to interact with ZAB. ZOOKEEPER-30 defines the interface pretty nicely, so we can use that as a reference.

https://issues.apache.org/jira/browse/ZOOKEEPER-30

It might look something like this:
```
// all the callback methods are invoked by a single thread.
interface ZabCallback {
// called after the message has been committed.
void deliver(Zxid zxid, byte[] message, Object context);

// called when the server state (looking/following/leading) changes
void serverStateChanged(state newState, string leaderServerId);
}

abstract class Zab {
Zab(ZabCallback callback) {
this.callback = callback;
}

// send a message. This method returns immediately after enqueuing
// the message. context is an optional parameter (could be null) that
// will be passed back in the deliver callback.
void send(byte[] message, Object context);
}
```