HCE Project PHP language client API bindings OOP style  1.1.1
Hierarchical Cluster Engine PHP Client Interface API OOP style
 All Classes Namespaces Files Functions Variables Pages
Node.inc.php
Go to the documentation of this file.
1 <?php
2 
14 namespace HCE\admin {
15  require_once __DIR__ . '/../transport/Constants.inc.php';
20  class Node {
24  protected $host =\HCE\transport\PROTOCOL_HOST_DEFAULT;
25 
29  protected $port = \HCE\transport\PROTOCOL_PORT_ADMIN_DEFAULT;
30 
34  protected $timeout = NODE_TIMEOUT;
35 
39  protected $error = 0;
40 
48  public function setHost($hostName) {
49  $this->host = $hostName;
50  }
51 
57  public function getHost() {
58  return $this->host;
59  }
60 
68  public function setPort($port) {
69  $this->port = $port;
70  }
71 
77  public function getPort() {
78  return $this->port;
79  }
80 
88  public function setTimeout($timeout) {
89  $this->timeout = $timeout;
90  }
91 
97  public function getTimeout() {
98  return $this->timeout;
99  }
100 
108  public function setErrorCode($errorCode) {
109  $this->error = $errorCode;
110  }
111 
117  public function getErrorCode() {
118  return $this->error;
119  }
120 
134  public function __construct($host = null, $port = null, $timeout = null) {
135  // Init host
136  if ($host !== null) {
137  $this->setHost ( $host );
138  }
139  // Init port
140  if ($port !== null) {
141  $this->setPort ( $port );
142  }
143  // Init timeout
144  if ($timeout !== null) {
145  $this->setTimeout ( $timeout );
146  }
147  }
148 
152  public function __destruct() {
153  }
154  }
155 }
156 
157 ?>