|
1
|
|
|
<?php |
|
2
|
|
|
namespace InfluxDB\Adapter\Http; |
|
3
|
|
|
|
|
4
|
|
|
class Options |
|
5
|
|
|
{ |
|
6
|
|
|
private $host; |
|
7
|
|
|
private $port; |
|
8
|
|
|
private $username; |
|
9
|
|
|
private $password; |
|
10
|
|
|
private $protocol; |
|
11
|
|
|
private $database; |
|
12
|
|
|
private $retentionPolicy; |
|
13
|
|
|
private $tags; |
|
14
|
|
|
private $prefix; |
|
15
|
|
|
|
|
16
|
13 |
|
public function __construct() |
|
17
|
|
|
{ |
|
18
|
13 |
|
$this->setHost("localhost"); |
|
19
|
13 |
|
$this->setPort(8086); |
|
20
|
13 |
|
$this->setUsername("root"); |
|
21
|
13 |
|
$this->setPassword("root"); |
|
22
|
13 |
|
$this->setProtocol("http"); |
|
23
|
13 |
|
$this->setPrefix(""); |
|
24
|
|
|
|
|
25
|
13 |
|
$this->setRetentionPolicy("default"); |
|
26
|
13 |
|
$this->setTags([]); |
|
27
|
13 |
|
} |
|
28
|
|
|
|
|
29
|
30 |
|
public function getPrefix() |
|
30
|
|
|
{ |
|
31
|
30 |
|
return $this->prefix; |
|
32
|
|
|
} |
|
33
|
|
|
|
|
34
|
13 |
|
public function setPrefix($prefix) |
|
35
|
|
|
{ |
|
36
|
13 |
|
$this->prefix = $prefix; |
|
37
|
13 |
|
return $this; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
16 |
|
public function getTags() |
|
41
|
|
|
{ |
|
42
|
16 |
|
return $this->tags; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
13 |
|
public function setTags($tags) |
|
46
|
|
|
{ |
|
47
|
13 |
|
$this->tags = $tags; |
|
48
|
13 |
|
return $this; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
16 |
|
public function getRetentionPolicy() |
|
52
|
|
|
{ |
|
53
|
16 |
|
return $this->retentionPolicy; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
13 |
|
public function setRetentionPolicy($retentionPolicy) |
|
57
|
|
|
{ |
|
58
|
13 |
|
$this->retentionPolicy = $retentionPolicy; |
|
59
|
13 |
|
return $this; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
30 |
|
public function getProtocol() |
|
63
|
|
|
{ |
|
64
|
30 |
|
return $this->protocol; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
13 |
|
public function setProtocol($protocol) |
|
68
|
|
|
{ |
|
69
|
13 |
|
$this->protocol = $protocol; |
|
70
|
13 |
|
return $this; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
30 |
|
public function getHost() |
|
74
|
|
|
{ |
|
75
|
30 |
|
return $this->host; |
|
76
|
|
|
} |
|
77
|
|
|
|
|
78
|
13 |
|
public function setHost($host) |
|
79
|
|
|
{ |
|
80
|
13 |
|
$this->host = $host; |
|
81
|
13 |
|
return $this; |
|
82
|
|
|
} |
|
83
|
|
|
|
|
84
|
30 |
|
public function getPort() |
|
85
|
|
|
{ |
|
86
|
30 |
|
return $this->port; |
|
87
|
|
|
} |
|
88
|
|
|
|
|
89
|
13 |
|
public function setPort($port) |
|
90
|
|
|
{ |
|
91
|
13 |
|
$this->port = $port; |
|
92
|
13 |
|
return $this; |
|
93
|
|
|
} |
|
94
|
|
|
|
|
95
|
24 |
|
public function getUsername() |
|
96
|
|
|
{ |
|
97
|
24 |
|
return $this->username; |
|
98
|
|
|
} |
|
99
|
|
|
|
|
100
|
13 |
|
public function setUsername($username) |
|
101
|
|
|
{ |
|
102
|
13 |
|
$this->username = $username; |
|
103
|
13 |
|
return $this; |
|
104
|
|
|
} |
|
105
|
|
|
|
|
106
|
24 |
|
public function getPassword() |
|
107
|
|
|
{ |
|
108
|
24 |
|
return $this->password; |
|
109
|
|
|
} |
|
110
|
|
|
|
|
111
|
13 |
|
public function setPassword($password) |
|
112
|
|
|
{ |
|
113
|
13 |
|
$this->password = $password; |
|
114
|
13 |
|
return $this; |
|
115
|
|
|
} |
|
116
|
|
|
|
|
117
|
24 |
|
public function getDatabase() |
|
118
|
|
|
{ |
|
119
|
24 |
|
return $this->database; |
|
120
|
|
|
} |
|
121
|
|
|
|
|
122
|
7 |
|
public function setDatabase($database) |
|
123
|
|
|
{ |
|
124
|
7 |
|
$this->database = $database; |
|
125
|
7 |
|
return $this; |
|
126
|
|
|
} |
|
127
|
|
|
} |
|
128
|
|
|
|