File: AMQPConnection.php

package info (click to toggle)
php-amqp 2.1.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,536 kB
  • sloc: ansic: 7,295; xml: 1,162; php: 690; pascal: 49; makefile: 2
file content (472 lines) | stat: -rw-r--r-- 12,873 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
<?php

/**
 * stub class representing AMQPConnection from pecl-amqp
 */
class AMQPConnection
{
    private string $login;

    private string $password;

    private string $host;

    private string $vhost;

    private int $port;

    private float $readTimeout;

    private float $writeTimeout;

    private float $connectTimeout;

    private float $rpcTimeout;

    private int $channelMax;

    private int $frameMax;

    private int $heartbeat;

    private ?string $cacert;

    private ?string $key;

    private ?string $cert;

    private bool $verify = true;

    private int $saslMethod = AMQP_SASL_METHOD_PLAIN;

    private ?string $connectionName;

    /**
     * Create an instance of AMQPConnection.
     *
     * Creates an AMQPConnection instance representing a connection to an AMQP
     * broker. A connection will not be established until
     * AMQPConnection::connect() is called.
     *
     *  $credentials = array(
     *      'host'  => amqp.host The host to connect too. Note: Max 1024 characters.
     *      'port'  => amqp.port Port on the host.
     *      'vhost' => amqp.vhost The virtual host on the host. Note: Max 128 characters.
     *      'login' => amqp.login The login name to use. Note: Max 128 characters.
     *      'password' => amqp.password Password. Note: Max 128 characters.
     *      'read_timeout'  => Timeout in for consume. Note: 0 or greater seconds. May be fractional.
     *      'write_timeout' => Timeout in for publish. Note: 0 or greater seconds. May be fractional.
     *      'connect_timeout' => Connection timeout. Note: 0 or greater seconds. May be fractional.
     *      'rpc_timeout' => Timeout for RPC-style AMQP methods. Note: 0 or greater seconds. May be fractional.
     *
     *      Connection tuning options (see http://www.rabbitmq.com/amqp-0-9-1-reference.html#connection.tune for details):
     *      'channel_max' => Specifies highest channel number that the server permits. 0 means standard extension limit
     *                       (see PHP_AMQP_MAX_CHANNELS constant)
     *      'frame_max'   => The largest frame size that the server proposes for the connection, including frame header
     *                       and end-byte. 0 means standard extension limit (depends on librabbimq default frame size limit)
     *      'heartbeat'   => The delay, in seconds, of the connection heartbeat that the server wants.
     *                       0 means the server does not want a heartbeat. Note, librabbitmq has limited heartbeat support,
     *                       which means heartbeats checked only during blocking calls.
     *
     *      TLS support (see https://www.rabbitmq.com/ssl.html for details):
     *      'cacert' => Path to the CA cert file in PEM format..
     *      'cert'   => Path to the client certificate in PEM foramt.
     *      'key'    => Path to the client key in PEM format.
     *      'verify' => Enable or disable peer verification. If peer verification is enabled then the common name in the
     *                  server certificate must match the server name. Peer verification is enabled by default.
     *
     *      'connection_name' => A user determined name for the connection
     * )
     *
     * @param array $credentials Optional array of credential information for
     *                           connecting to the AMQP broker.
     */
    public function __construct(array $credentials = [])
    {
    }

    /**
     * Check whether the connection to the AMQP broker is still valid.
     *
     * Cannot reliably detect dropped connections or unusual socket errors, as it does not actively
     * engage the socket.
     *
     * @return boolean TRUE if connected, FALSE otherwise.
     */
    public function isConnected(): bool
    {
    }

    /**
     * Whether connection persistent.
     *
     * When no connection is established, it will always return FALSE. The same disclaimer as for
     * {@see AMQPConnection::isConnected()} applies.
     *
     * @return boolean TRUE if persistently connected, FALSE otherwise.
     */
    public function isPersistent(): bool
    {
    }

    /**
     * Establish a transient connection with the AMQP broker.
     *
     * This method will initiate a connection with the AMQP broker.
     *
     * @throws AMQPConnectionException
     */
    public function connect(): void
    {
    }

    /**
     * Closes the transient connection with the AMQP broker.
     *
     * This method will close an open connection with the AMQP broker.
     *
     * @throws AMQPConnectionException When attempting to disconnect a persistent connection
     */
    public function disconnect(): void
    {
    }

    /**
     * Close any open transient connections and initiate a new one with the AMQP broker.
     *
     * @throws AMQPConnectionException
     */
    public function reconnect(): void
    {
    }

    /**
     * Establish a persistent connection with the AMQP broker.
     *
     * This method will initiate a connection with the AMQP broker
     * or reuse an existing one if present.
     *
     * @throws AMQPConnectionException
     */
    public function pconnect(): void
    {
    }

    /**
     * Closes a persistent connection with the AMQP broker.
     *
     * This method will close an open persistent connection with the AMQP
     * broker.
     *
     * @throws AMQPConnectionException When attempting to disconnect a transient connection
     */
    public function pdisconnect(): void
    {
    }

    /**
     * Close any open persistent connections and initiate a new one with the AMQP broker.
     *
     * @throws AMQPConnectionException
     */
    public function preconnect(): void
    {
    }

    /**
     * Get the configured host.
     *
     * @return string The configured hostname of the broker
     */
    public function getHost(): string
    {
    }

    /**
     * Get the configured login.
     *
     * @return string The configured login as a string.
     */
    public function getLogin(): string
    {
    }

    /**
     * Get the configured password.
     *
     * @return string The configured password as a string.
     */
    public function getPassword(): string
    {
    }

    /**
     * Get the configured port.
     *
     * @return int The configured port as an integer.
     */
    public function getPort(): int
    {
    }

    /**
     * Get the configured vhost.
     *
     * @return string The configured virtual host as a string.
     */
    public function getVhost(): string
    {
    }

    /**
     * Set the hostname used to connect to the AMQP broker.
     *
     * @param string $host The hostname of the AMQP broker.
     *
     * @throws AMQPConnectionException If host is longer then 1024 characters.
     */
    public function setHost(string $host): void
    {
    }

    /**
     * Set the login string used to connect to the AMQP broker.
     *
     * @param string $login The login string used to authenticate
     *                      with the AMQP broker.
     *
     * @throws AMQPConnectionException If login is longer then 32 characters.
     */
    public function setLogin(string $login): void
    {
    }

    /**
     * Set the password string used to connect to the AMQP broker.
     *
     * @param string $password The password string used to authenticate
     *                         with the AMQP broker.
     *
     * @throws AMQPConnectionException If password is longer then 32characters.
     */
    public function setPassword(string $password): void
    {
    }

    /**
     * Set the port used to connect to the AMQP broker.
     *
     * @param integer $port The port used to connect to the AMQP broker.
     *
     * @throws AMQPConnectionException If port is longer not between
     *                                 1 and 65535.
     */
    public function setPort(int $port): void
    {
    }

    /**
     * Sets the virtual host to which to connect on the AMQP broker.
     *
     * @param string $vhost The virtual host to use on the AMQP
     *                      broker.
     *
     * @throws AMQPConnectionException If host is longer then 32 characters.
     */
    public function setVhost(string $vhost): void
    {
    }

    /**
     * Sets the interval of time to wait for income activity from AMQP broker
     *
     * @deprecated use AMQPConnection::setReadTimeout($timeout) instead
     *
     * @throws AMQPConnectionException If timeout is less than 0.
     */
    public function setTimeout(float $timeout): void
    {
    }

    /**
     * Get the configured interval of time to wait for income activity
     * from AMQP broker
     *
     * @deprecated use AMQPConnection::getReadTimeout() instead
     */
    public function getTimeout(): float
    {
    }

    /**
     * Sets the interval of time (in seconds) to wait for income activity from AMQP broker
     *
     * @throws AMQPConnectionException If timeout is less than 0.
     */
    public function setReadTimeout(float $timeout): void
    {
    }

    /**
     * Get the configured interval of time (in seconds) to wait for income activity
     * from AMQP broker
     */
    public function getReadTimeout(): float
    {
    }

    /**
     * Sets the interval of time (in seconds) to wait for outcome activity to AMQP broker
     *
     * @throws AMQPConnectionException If timeout is less than 0.
     */
    public function setWriteTimeout(float $timeout): void
    {
    }

    /**
     * Get the configured interval of time (in seconds) to wait for outcome activity
     * to AMQP broker
     */
    public function getWriteTimeout(): float
    {
    }

    /**
     * Get the configured timeout (in seconds) for connecting to the AMQP broker
     */
    public function getConnectTimeout(): float
    {
    }

    /**
     * Sets the interval of time to wait (in seconds) for RPC activity to AMQP broker
     *
     * @throws AMQPConnectionException If timeout is less than 0.
     */
    public function setRpcTimeout(float $timeout): void
    {
    }

    /**
     * Get the configured interval of time (in seconds) to wait for RPC activity
     * to AMQP broker
     */
    public function getRpcTimeout(): float
    {
    }

    /**
     * Return last used channel id during current connection session.
     */
    public function getUsedChannels(): int
    {
    }

    /**
     * Get the maximum number of channels the connection can handle.
     *
     * When connection is connected, effective connection value returned, which is normally the same as original
     * correspondent value passed to constructor, otherwise original value passed to constructor returned.
     */
    public function getMaxChannels(): int
    {
    }

    /**
     * Get max supported frame size per connection in bytes.
     *
     * When connection is connected, effective connection value returned, which is normally the same as original
     * correspondent value passed to constructor, otherwise original value passed to constructor returned.
     */
    public function getMaxFrameSize(): int
    {
    }

    /**
     * Get number of seconds between heartbeats of the connection in seconds.
     *
     * When connection is connected, effective connection value returned, which is normally the same as original
     * correspondent value passed to constructor, otherwise original value passed to constructor returned.
     */
    public function getHeartbeatInterval(): int
    {
    }

    /**
     * Get path to the CA cert file in PEM format
     */
    public function getCACert(): ?string
    {
    }

    /**
     * Set path to the CA cert file in PEM format
     */
    public function setCACert(?string $cacert): void
    {
    }

    /**
     * Get path to the client certificate in PEM format
     */
    public function getCert(): ?string
    {
    }

    /**
     * Set path to the client certificate in PEM format
     */
    public function setCert(?string $cert): void
    {
    }

    /**
     * Get path to the client key in PEM format
     */
    public function getKey(): ?string
    {
    }

    /**
     * Set path to the client key in PEM format
     */
    public function setKey(?string $key): void
    {
    }

    /**
     * Get whether peer verification enabled or disabled
     */
    public function getVerify(): bool
    {
    }

    /**
     * Enable or disable peer verification
     */
    public function setVerify(bool $verify): void
    {
    }

    /**
     * set authentication method
     *
     * @param int $saslMethod AMQP_SASL_METHOD_PLAIN | AMQP_SASL_METHOD_EXTERNAL
     */
    public function setSaslMethod(int $saslMethod): void
    {
    }

    public function getSaslMethod(): int
    {
    }

    public function setConnectionName(?string $connectionName): void
    {
    }

    public function getConnectionName(): ?string
    {
    }
}