1 | <?php |
||
16 | class Exchange implements ExchangeInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var Channel |
||
20 | */ |
||
21 | protected $channel; |
||
22 | /** |
||
23 | * @var AMQPExchange |
||
24 | */ |
||
25 | protected $resource; |
||
26 | /** |
||
27 | * @var Options\ExchangeOptions |
||
28 | */ |
||
29 | protected $options; |
||
30 | |||
31 | /** |
||
32 | * @return Options\ExchangeOptions |
||
33 | */ |
||
34 | 19 | public function getOptions() |
|
38 | |||
39 | /** |
||
40 | * @param Options\ExchangeOptions|\Traversable|array $exchangeOptions |
||
41 | * @return $this |
||
42 | * @throws BaseException\BadMethodCallException |
||
43 | * @throws BaseException\InvalidArgumentException |
||
44 | */ |
||
45 | 19 | public function setOptions($exchangeOptions) |
|
54 | |||
55 | /** |
||
56 | * @return AMQPExchange |
||
57 | */ |
||
58 | 20 | public function getResource() |
|
62 | |||
63 | /** |
||
64 | * @param AMQPExchange $resource |
||
65 | * @return $this |
||
66 | */ |
||
67 | 20 | public function setResource(AMQPExchange $resource) |
|
72 | |||
73 | /** |
||
74 | * @return $this |
||
75 | */ |
||
76 | 19 | protected function configureExchange() |
|
105 | |||
106 | /** |
||
107 | * Declare a new exchange on the broker. |
||
108 | * |
||
109 | * @return $this |
||
110 | * @throws Exception\RuntimeException |
||
111 | * @throws \AMQPExchangeException |
||
112 | * @throws \AMQPChannelException |
||
113 | * @throws \AMQPConnectionException |
||
114 | */ |
||
115 | 7 | public function declareExchange() |
|
121 | |||
122 | /** |
||
123 | * Delete the exchange from the broker. |
||
124 | * |
||
125 | * @param bool $ifUnused Optional if the exchange should not be |
||
126 | * deleted until no clients are connected to |
||
127 | * it. |
||
128 | * @param bool $noWait No wait for a reply |
||
129 | * |
||
130 | * @return $this |
||
131 | * @throws \AMQPExchangeException |
||
132 | * @throws \AMQPChannelException |
||
133 | * @throws \AMQPConnectionException |
||
134 | */ |
||
135 | 4 | public function delete($ifUnused = false, $noWait = false) |
|
149 | |||
150 | /** |
||
151 | * Bind to another exchange. |
||
152 | * |
||
153 | * Bind an exchange to another exchange using the specified routing key. |
||
154 | * |
||
155 | * @param string $exchangeName Name of the exchange to bind. |
||
156 | * @param string $routingKey The routing key to use for binding. |
||
157 | * @param bool $noWait No wait for a reply |
||
158 | * @param array $arguments Additional binding arguments. |
||
159 | * |
||
160 | * @return $this |
||
161 | * @throws \AMQPExchangeException |
||
162 | * @throws \AMQPChannelException |
||
163 | * @throws \AMQPConnectionException |
||
164 | */ |
||
165 | 1 | public function bind($exchangeName, $routingKey = null, $noWait = false, array $arguments = []) |
|
171 | |||
172 | /** |
||
173 | * Remove binding to another exchange. |
||
174 | * |
||
175 | * Remove a routing key binding on an another exchange from the given exchange. |
||
176 | * |
||
177 | * @param string $exchangeName Name of the exchange to bind. |
||
178 | * @param string $routingKey The routing key to use for binding. |
||
179 | * @param array $arguments Additional binding arguments. |
||
180 | * |
||
181 | * @return $this |
||
182 | * @throws \AMQPExchangeException |
||
183 | * @throws \AMQPChannelException |
||
184 | * @throws \AMQPConnectionException |
||
185 | */ |
||
186 | 1 | public function unbind($exchangeName, $routingKey = null, array $arguments = []) |
|
192 | |||
193 | /** |
||
194 | * Publish a message to an exchange. |
||
195 | * |
||
196 | * Publish a message to the exchange represented by the Exchange object. |
||
197 | * |
||
198 | * @param string $message The message to publish. |
||
199 | * @param string $routingKey The optional routing key to which to |
||
200 | * publish to. |
||
201 | * @param bool $mandatory Mandatory |
||
202 | * @param bool $immediate Immediate |
||
203 | * @param array $attributes One of content_type, content_encoding, |
||
204 | * message_id, user_id, app_id, delivery_mode, |
||
205 | * priority, timestamp, expiration, type |
||
206 | * or reply_to, headers. |
||
207 | * |
||
208 | * @return $this |
||
209 | * @throws \AMQPExchangeException |
||
210 | * @throws \AMQPChannelException |
||
211 | * @throws \AMQPConnectionException |
||
212 | */ |
||
213 | 9 | public function publish( |
|
232 | |||
233 | /** |
||
234 | * Get the Connection object in use |
||
235 | * |
||
236 | * @return Connection |
||
237 | */ |
||
238 | 1 | public function getConnection() |
|
242 | |||
243 | /** |
||
244 | * @param Channel $channel |
||
245 | * @return $this |
||
246 | */ |
||
247 | 8 | public function setChannel(Channel $channel) |
|
252 | |||
253 | /** |
||
254 | * Get the Channel object in use |
||
255 | * |
||
256 | * @return Channel |
||
257 | */ |
||
258 | 2 | public function getChannel() |
|
262 | } |
||
263 |