/// <summary>
        /// Initializes a new instance of the <see cref="ClientConnection"/> class.
        /// </summary>
        /// <param name="hosts">The hosts.</param>
        /// <param name="sessionTimeout">The session timeout.</param>
        /// <param name="zooKeeper">The zoo keeper.</param>
        /// <param name="watcher">The watch manager.</param>
        /// <param name="sessionId">The session id.</param>
        /// <param name="sessionPasswd">The session passwd.</param>
        public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd)
        {
            ConnectString = hosts;

            this.zooKeeper  = zooKeeper;
            this.watcher    = watcher;
            SessionTimeout  = sessionTimeout;
            SessionId       = sessionId;
            SessionPassword = sessionPasswd;

            SetTimeouts(sessionTimeout);
            CreateConsumer();
            CreateProducer();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientConnection"/> class.
        /// </summary>
        /// <param name="hosts">The hosts.</param>
        /// <param name="sessionTimeout">The session timeout.</param>
        /// <param name="zooKeeper">The zoo keeper.</param>
        /// <param name="watcher">The watch manager.</param>
        /// <param name="sessionId">The session id.</param>
        /// <param name="sessionPasswd">The session passwd.</param>
        public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd)
        {
            this.hosts      = hosts;
            this.zooKeeper  = zooKeeper;
            this.watcher    = watcher;
            SessionTimeout  = sessionTimeout;
            SessionId       = sessionId;
            SessionPassword = sessionPasswd;

            // parse out chroot, if any
            hosts = SetChrootPath();
            GetHosts(hosts);
            SetTimeouts(sessionTimeout);
            CreateConsumer();
            CreateProducer();
        }
Exemple #3
0
 public ChildWatchRegistration(ZKWatchManager watchManager, IWatcher watcher, string clientPath)
     : base(watcher, clientPath)
 {
     this.watchManager = watchManager;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientConnection"/> class.
        /// </summary>
        /// <param name="hosts">The hosts.</param>
        /// <param name="sessionTimeout">The session timeout.</param>
        /// <param name="zooKeeper">The zoo keeper.</param>
        /// <param name="watcher">The watch manager.</param>
        /// <param name="sessionId">The session id.</param>
        /// <param name="sessionPasswd">The session passwd.</param>
        /// <param name="connectTimeout">Connection Timeout.</param>
        public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd, TimeSpan connectTimeout)
        {
            this.hosts = hosts;
            this.zooKeeper = zooKeeper;
            this.watcher = watcher;
            SessionTimeout = sessionTimeout;
            SessionId = sessionId;
            SessionPassword = sessionPasswd;
            ConnectionTimeout = connectTimeout;

            // parse out chroot, if any
            hosts = SetChrootPath();
            GetHosts(hosts);
            SetTimeouts(sessionTimeout);
            CreateConsumer();
            CreateProducer();
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientConnection"/> class.
 /// </summary>
 /// <param name="hosts">The hosts.</param>
 /// <param name="sessionTimeout">The session timeout.</param>
 /// <param name="zooKeeper">The zoo keeper.</param>
 /// <param name="watcher">The watch manager.</param>
 /// <param name="sessionId">The session id.</param>
 /// <param name="sessionPasswd">The session passwd.</param>
 public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd)
     : this(hosts, sessionTimeout, zooKeeper, watcher, 0, new byte[16], DefaultConnectTimeout)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientConnection"/> class.
 /// </summary>
 /// <param name="connectionString">The connection string.</param>
 /// <param name="sessionTimeout">The session timeout.</param>
 /// <param name="zooKeeper">The zoo keeper.</param>
 /// <param name="watcher">The watch manager.</param>
 /// <param name="connectTimeout">Connection Timeout.</param>
 public ClientConnection(string connectionString, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, TimeSpan connectTimeout) :
     this(connectionString, sessionTimeout, zooKeeper, watcher, 0, new byte[16], connectTimeout)
 {
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientConnection"/> class.
 /// </summary>
 /// <param name="hosts">The hosts.</param>
 /// <param name="sessionTimeout">The session timeout.</param>
 /// <param name="zooKeeper">The zoo keeper.</param>
 /// <param name="watcher">The watch manager.</param>
 /// <param name="sessionId">The session id.</param>
 /// <param name="sessionPasswd">The session passwd.</param>
 public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd)
     : this(hosts, sessionTimeout, zooKeeper, watcher, 0, new byte[16], DefaultConnectTimeout)
 {
 }
Exemple #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientConnection"/> class.
 /// </summary>
 /// <param name="connectionString">The connection string.</param>
 /// <param name="sessionTimeout">The session timeout.</param>
 /// <param name="zooKeeper">The zoo keeper.</param>
 /// <param name="watcher">The watch manager.</param>
 /// <param name="connectTimeout">Connection Timeout.</param>
 public ClientConnection(string connectionString, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, TimeSpan connectTimeout) :
     this(connectionString, sessionTimeout, zooKeeper, watcher, 0, new byte[16], connectTimeout)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientConnection"/> class.
 /// </summary>
 /// <param name="hosts">The hosts.</param>
 /// <param name="sessionTimeout">The session timeout.</param>
 /// <param name="zooKeeper">The zoo keeper.</param>
 /// <param name="watcher">The watch manager.</param>
 /// <param name="sessionId">The session id.</param>
 /// <param name="sessionPasswd">The session passwd.</param>
 /// <param name="connectTimeout">Connection Timeout.</param>
 public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd, TimeSpan connectTimeout) :
     this(hosts, sessionTimeout, zooKeeper, watcher, null, sessionId, sessionPasswd, connectTimeout)
 {
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientConnection"/> class.
        /// </summary>
        /// <param name="hosts">The hosts.</param>
        /// <param name="sessionTimeout">The session timeout.</param>
        /// <param name="zooKeeper">The zoo keeper.</param>
        /// <param name="watcher">The watch manager.</param>
        /// <param name="sessionId">The session id.</param>
        /// <param name="sessionPasswd">The session passwd.</param>
        public ClientConnection(string hosts, TimeSpan sessionTimeout, ZooKeeper zooKeeper, ZKWatchManager watcher, long sessionId, byte[] sessionPasswd)
        {
            ConnectString = hosts;

            this.zooKeeper = zooKeeper;
            this.watcher = watcher;
            SessionTimeout = sessionTimeout;
            SessionId = sessionId;
            SessionPassword = sessionPasswd;

            SetTimeouts(sessionTimeout);
            CreateConsumer();
            CreateProducer();
        }