HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
Node.py
Go to the documentation of this file.
1 '''
2 Created on Feb 17, 2014
3 
4 @author: scorp
5 @link: http://hierarchical-cluster-engine.com/
6 @copyright: Copyright © 2013-2014 IOIX Ukraine
7 @license: http://hierarchical-cluster-engine.com/license/
8 @since: 0.1
9 '''
10 
11 import time
12 import Constants as CONSTANTS
13 
14 #Node class contents data data for interraction (make connection) with transport layer
15 class Node(object):
16  def __init__(self, host=CONSTANTS.HOST_DEFAULT, port=CONSTANTS.PORT_DEFAULT, timeout=CONSTANTS.NODE_TIMEOUT):
17  self.host = host
18  self.port = port
19  self.timeout = timeout
20  self.createTime = int(round(time.time() * 1000.0))
21 
22 
23  def setHost(self, host):
24  self.host = host
25 
26 
27  def setPort(self, port):
28  self.port = port
29 
30 
31  def setTimeout(self, timeout):
32  self.timeout = timeout
33 
34 
35  def getHost(self):
36  return self.host
37 
38 
39  def getPort(self):
40  return self.port
41 
42 
43  def getTimeout(self):
44  return self.timeout
45 
46 
47  def getElapsedTime(self):
48  return int(round(time.time() * 1000.0)) - self.createTime
def setTimeout(self, timeout)
Definition: Node.py:31
def setPort(self, port)
Definition: Node.py:27
def getHost(self)
Definition: Node.py:35
def getPort(self)
Definition: Node.py:39
def getElapsedTime(self)
Definition: Node.py:47
def getTimeout(self)
Definition: Node.py:43
def setHost(self, host)
Definition: Node.py:23
def __init__(self, host=CONSTANTS.HOST_DEFAULT, port=CONSTANTS.PORT_DEFAULT, timeout=CONSTANTS.NODE_TIMEOUT)
Definition: Node.py:16