lib/server_zookeeper.js
function(connectString, options, root, prefix) {
    EventEmitter.call(this);

    if(util.isArray(connectString)) {
        connectString = connectString.join(",");
    }

    this.connectString = connectString;
    this.options = options;
    this.root = root || "/illyria";
    this.prefix = prefix || "/HB_";
    this.path = null;

    this.root = this.root.trim();
    this.prefix = this.prefix.trim();

    if(!this.root.length) this.root = "/illyria";
    if(!this.prefix.length) this.prefix = "/HB_";
    if(this.root[0] !== "/") this.root = "/" + this.root;
    if(this.prefix[0] !== "/") this.prefix = "/" + this.prefix;

    this.client = zookeeper.createClient(this.connectString, options);
    this.server = {
        host: "127.0.0.1",
        port: 3721,

        clients: 0
    };

    this.clientStatus = ZK_STATUS.NOT_CONNECTED;

    this._setup();
}
function(connectString, options, root, prefix) {
    EventEmitter.call(this);

    if(util.isArray(connectString)) {
        connectString = connectString.join(",");
    }

    this.connectString = connectString;
    this.options = options;
    this.root = root || "/illyria";
    this.prefix = prefix || "/HB_";
    this.path = null;

    this.root = this.root.trim();
    this.prefix = this.prefix.trim();

    if(!this.root.length) this.root = "/illyria";
    if(!this.prefix.length) this.prefix = "/HB_";
    if(this.root[0] !== "/") this.root = "/" + this.root;
    if(this.prefix[0] !== "/") this.prefix = "/" + this.prefix;

    this.client = zookeeper.createClient(this.connectString, options);
    this.server = {
        host: "127.0.0.1",
        port: 3721,

        clients: 0
    };

    this.clientStatus = ZK_STATUS.NOT_CONNECTED;

    this._setup();
}
function ( connectString , options , root , prefix ) { EventEmitter . call ( this ) ; if ( util . isArray ( connectString ) ) { connectString = connectString . join ( "," ) ; } this . connectString = connectString ; this . options = options ; this . root = root || "/illyria" ; this . prefix = prefix || "/HB_" ; this . path = null ; this . root = this . root . trim ( ) ; this . prefix = this . prefix . trim ( ) ; if ( ! this . root . length ) this . root = "/illyria" ; if ( ! this . prefix . length ) this . prefix = "/HB_" ; if ( this . root [ 0 ] !== "/" ) this . root = "/" + this . root ; if ( this . prefix [ 0 ] !== "/" ) this . prefix = "/" + this . prefix ; this . client = zookeeper . createClient ( this . connectString , options ) ; this . server = { host : "127.0.0.1" , port : 3721 , clients : 0 } ; this . clientStatus = ZK_STATUS . NOT_CONNECTED ; this . _setup ( ) ; }
illyria zookeeper wrapper
@param {String|Array} connectString the connect string(s)
@param {Object} options the connect options, refer to
https://github.com/alexguan/node-zookeeper-client
#client-createclientconnectionstring-options
@param {String} [root] the root path
@param {String} [prefix] the path's prefix
@constructor
illyria zookeeper wrapper