1 | <?php |
||
12 | class ConnectionOptions |
||
13 | { |
||
14 | /** |
||
15 | * @var string The hostname or IP address of the AMQP broker. |
||
16 | */ |
||
17 | private $host; |
||
18 | |||
19 | /** |
||
20 | * @var int The TCP port of the AMQP broker. |
||
21 | */ |
||
22 | private $port; |
||
23 | |||
24 | /** |
||
25 | * @var string The username to use to authentication. |
||
26 | */ |
||
27 | private $username; |
||
28 | |||
29 | /** |
||
30 | * @var string The password to use for authentication. |
||
31 | */ |
||
32 | private $password; |
||
33 | |||
34 | /** |
||
35 | * @var string The virtual-host to use. |
||
36 | */ |
||
37 | private $vhost; |
||
38 | |||
39 | /** |
||
40 | * @var string The product name to report to the broker. |
||
41 | */ |
||
42 | private $productName; |
||
43 | |||
44 | /** |
||
45 | * @var string The product version to report to the broker. |
||
46 | */ |
||
47 | private $productVersion; |
||
48 | |||
49 | /** |
||
50 | * @var float|null The timeout in seconds (null = PHP default). |
||
51 | */ |
||
52 | private $connectionTimeout; |
||
53 | |||
54 | /** |
||
55 | * @var float|null The heartbeat interval in seconds (null = use broker suggestion). |
||
56 | */ |
||
57 | private $heartbeatInterval; |
||
58 | |||
59 | /** |
||
60 | * @param string $host The hostname or IP address of the AMQP broker. |
||
61 | * @param int $port The TCP port of the AMQP broker. |
||
62 | * @param string $username The username to use to authentication. |
||
63 | * @param string $password The password to use for authentication. |
||
64 | * @param string $vhost The virtual-host to use. |
||
65 | */ |
||
66 | public function __construct( |
||
85 | |||
86 | /** |
||
87 | * Get the hostname or IP address of the AMQP broker. |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getHost() |
||
94 | |||
95 | /** |
||
96 | * Set the hostname or IP address of the AMQP broker. |
||
97 | * @param $host |
||
98 | * @return ConnectionOptions |
||
99 | */ |
||
100 | public function setHost($host) |
||
105 | |||
106 | /** |
||
107 | * Get the TCP port of the AMQP broker. |
||
108 | * @return int |
||
109 | */ |
||
110 | public function getPort() |
||
114 | |||
115 | /** |
||
116 | * Set the TCP port of the AMQP broker. |
||
117 | * @param $port |
||
118 | * @return ConnectionOptions |
||
119 | */ |
||
120 | public function setPort($port) |
||
125 | |||
126 | /** |
||
127 | * Get the username to use for authentication. |
||
128 | * @return string |
||
129 | */ |
||
130 | public function getUsername() |
||
134 | |||
135 | /** |
||
136 | * Set the username to use for authentication. |
||
137 | * @param $username |
||
138 | * @return ConnectionOptions |
||
139 | */ |
||
140 | public function setUsername($username) |
||
145 | |||
146 | /** |
||
147 | * Get the password to use for authentication. |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getPassword() |
||
154 | |||
155 | /** |
||
156 | * Set the password to use for authentication. |
||
157 | * @param $password |
||
158 | * @return ConnectionOptions |
||
159 | */ |
||
160 | public function setPassword($password) |
||
165 | |||
166 | /** |
||
167 | * Get the AMQP virtual-host to use. |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getVhost() |
||
174 | |||
175 | /** |
||
176 | * Set the virtual-host to use. |
||
177 | * @param $vhost |
||
178 | * @return ConnectionOptions |
||
179 | */ |
||
180 | public function setVhost($vhost) |
||
185 | |||
186 | /** |
||
187 | * Get the product name to report to the broker. |
||
188 | * @return string |
||
189 | */ |
||
190 | public function getProductName() |
||
194 | |||
195 | /** |
||
196 | * Set the product name to report to the broker. |
||
197 | * @param string $name |
||
198 | * @return ConnectionOptions |
||
199 | */ |
||
200 | public function setProductName($name) |
||
205 | |||
206 | /** |
||
207 | * Get the product version to report to the broker. |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getProductVersion() |
||
214 | |||
215 | /** |
||
216 | * Set the product version to report to the broker. |
||
217 | * |
||
218 | * @param string $version The product version. |
||
219 | * @return ConnectionOptions |
||
220 | */ |
||
221 | public function setProductVersion($version) |
||
226 | |||
227 | /** |
||
228 | * Get the maximum time to allow for the connection to be established. |
||
229 | * |
||
230 | * @return float|null The timeout in seconds (null = PHP default). |
||
231 | */ |
||
232 | public function getConnectionTimeout() |
||
236 | |||
237 | /** |
||
238 | * Set the maximum time to allow for the connection to be established. |
||
239 | * |
||
240 | * @param float|null $timeout The timeout in seconds (null = PHP default). |
||
241 | * @return ConnectionOptions |
||
242 | */ |
||
243 | public function setConnectionTimeout($timeout = null) |
||
248 | |||
249 | /** |
||
250 | * Get how often the broker and client must send heartbeat frames to keep |
||
251 | * the connection alive. |
||
252 | * |
||
253 | * @return float|null The heartbeat interval in seconds (null = use broker suggestion). |
||
254 | */ |
||
255 | public function getHeartbeatInterval() |
||
259 | |||
260 | /** |
||
261 | * Set how often the broker and client must send heartbeat frames to keep |
||
262 | * the connection alive. |
||
263 | * |
||
264 | * @param float|null $interval The heartbeat interval in seconds (null = use broker suggestion). |
||
265 | * @return ConnectionOptions |
||
266 | */ |
||
267 | public function setHeartbeatInterval($interval = null) |
||
272 | } |
||
273 |