File: AMQPExchange.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 (277 lines) | stat: -rw-r--r-- 8,092 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
<?php

/**
 * stub class representing AMQPExchange from pecl-amqp
 */
class AMQPExchange
{
    private AMQPConnection $connection;

    private AMQPChannel $channel;

    private ?string $name = null;

    private ?string $type = null;

    private bool $passive = false;

    private bool $durable = false;

    private bool $autoDelete = false;

    private bool $internal = false;

    private array $arguments = [];

    /**
     * Create an instance of AMQPExchange.
     *
     * Returns a new instance of an AMQPExchange object, associated with the
     * given AMQPChannel object.
     *
     * @param AMQPChannel $channel A valid AMQPChannel object, connected
     *                             to a broker.
     *
     * @throws AMQPExchangeException When amqp_channel is not connected to
     *                               a broker.
     * @throws AMQPConnectionException If the connection to the broker was
     *                                 lost.
     */
    public function __construct(AMQPChannel $channel)
    {
    }

    /**
     * Bind to another exchange.
     *
     * Bind an exchange to another exchange using the specified routing key.
     *
     * @param string $exchangeName Name of the exchange to bind.
     * @param string|null $routingKey The routing key to use for binding.
     * @param array $arguments Additional binding arguments.
     *
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     * @throws AMQPExchangeException On failure.
     */
    public function bind(string $exchangeName, ?string $routingKey = null, array $arguments = []): void
    {
    }

    /**
     * Remove binding to another exchange.
     *
     * Remove a routing key binding on an another exchange from the given exchange.
     *
     * @param string $exchangeName Name of the exchange to bind.
     * @param string|null $routingKey The routing key to use for binding.
     * @param array $arguments Additional binding arguments.
     *
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     * @throws AMQPExchangeException On failure.
     */
    public function unbind(string $exchangeName, ?string $routingKey = null, array $arguments = []): void
    {
    }

    /**
     * Declare a new exchange on the broker.
     *
     * @throws AMQPExchangeException On failure.
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     */
    public function declareExchange(): void
    {
    }

    /**
     * Declare a new exchange on the broker.
     *
     * @throws AMQPExchangeException On failure.
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     */
    public function declare(): void
    {
    }

    /**
     * Delete the exchange from the broker.
     *
     * @param string $exchangeName Optional name of exchange to delete. If not specified it uses the name of the
     *                             exchange object
     * @param integer $flags Optionally AMQP_IFUNUSED can be specified
     *                       to indicate the exchange should not be
     *                       deleted until no clients are connected to
     *                       it.
     *
     * @throws AMQPExchangeException On failure.
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     */
    public function delete(?string $exchangeName = null, ?int $flags = null): void
    {
    }

    /**
     * Get the argument associated with the given key.
     *
     * @param string $argumentName The key to look up.
     * @throws AMQPExchangeException If key does not exist
     * @return bool|int|double|string|null
     */
    public function getArgument(string $argumentName)
    {
    }

    /**
     * Check whether argument associated with the given key exists.
     *
     * @param string $argumentName The key to look up.
     *
     * @return boolean
     */
    public function hasArgument(string $argumentName): bool
    {
    }

    /**
     * Get all arguments set on the given exchange.
     *
     * @return array An array containing all the set key/value pairs.
     */
    public function getArguments(): array
    {
    }

    /**
     * Get all the flags currently set on the given exchange.
     *
     * @return int An integer bitmask of all the flags currently set on this
     *             exchange object.
     */
    public function getFlags(): int
    {
    }

    /**
     * Get the configured name.
     *
     * @return string|null The configured name as a string.
     */
    public function getName(): ?string
    {
    }

    /**
     * Get the configured type.
     *
     * @return string|null The configured type as a string.
     */
    public function getType(): ?string
    {
    }

    /**
     * Publish a message to an exchange.
     *
     * Publish a message to the exchange represented by the AMQPExchange object.
     *
     * @param string $message The message to publish.
     * @param string|null $routingKey The optional routing key to which to
     *                                publish to.
     * @param integer $flags One or more of AMQP_MANDATORY and
     *                       AMQP_IMMEDIATE.
     * @param array $headers One of content_type, content_encoding,
     *                       message_id, user_id, app_id, delivery_mode,
     *                       priority, timestamp, expiration, type
     *                       or reply_to, headers.
     * @throws AMQPChannelException If the channel is not open.
     * @throws AMQPConnectionException If the connection to the broker was lost.
     * @throws AMQPExchangeException On failure.
     */
    public function publish(
        string $message,
        ?string $routingKey = null,
        ?int $flags = null,
        array $headers = []
    ): void {
    }

    /**
     * Set the value for the given key.
     *
     * @param string $argumentName Name of the argument to set.
     * @param bool|int|double|string|null $argumentValue Value of the argument to set.
     */
    public function setArgument(string $argumentName, $argumentValue): void
    {
    }

    /**
     * Set the value for the given key.
     *
     * @param string $argumentName Name of the argument to remove.
     */
    public function removeArgument(string $argumentName): void
    {
    }

    /**
     * Set all arguments on the exchange.
     *
     * @param array $arguments An array of key/value pairs of arguments.
     */
    public function setArguments(array $arguments): void
    {
    }

    /**
     * Set the flags on an exchange.
     *
     * @param integer $flags A bitmask of flags. This call currently only
     *                       considers the following flags:
     *                       AMQP_DURABLE, AMQP_PASSIVE
     *                       (and AMQP_DURABLE, if librabbitmq version >= 0.5.3)
     */
    public function setFlags(?int $flags): void
    {
    }

    /**
     * Set the name of the exchange.
     *
     * @param string|null $exchangeName The name of the exchange to set as string.
     */
    public function setName(?string $exchangeName): void
    {
    }

    /**
     * Set the type of the exchange.
     *
     * Set the type of the exchange. This can be any of AMQP_EX_TYPE_DIRECT,
     * AMQP_EX_TYPE_FANOUT, AMQP_EX_TYPE_HEADERS or AMQP_EX_TYPE_TOPIC.
     *
     * @param string|null $exchangeType The type of exchange as a string.
     */
    public function setType(?string $exchangeType): void
    {
    }

    /**
     * Get the AMQPChannel object in use
     */
    public function getChannel(): AMQPChannel
    {
    }

    /**
     * Get the AMQPConnection object in use
     */
    public function getConnection(): AMQPConnection
    {
    }
}