コード例 #1
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)
        {
            ConnectString = hosts;

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

            SetTimeouts(sessionTimeout);
            CreateConsumer();
            CreateProducer();
        }
コード例 #2
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      = 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();
        }
コード例 #3
0
 public ChildWatchRegistration(ZKWatchManager watchManager, IWatcher watcher, string clientPath)
     : base(watcher, clientPath)
 {
     this.watchManager = watchManager;
 }
コード例 #4
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>
        /// <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();
        }
コード例 #5
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)
 {
 }
コード例 #6
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)
 {
 }
コード例 #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)
 {
 }
コード例 #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)
 {
 }
コード例 #9
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>
 /// <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)
 {
 }
コード例 #10
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)
        {
            ConnectString = hosts;

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

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