1 | <?php |
||
15 | class Exchange implements ExchangeInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var Channel |
||
19 | */ |
||
20 | protected $channel; |
||
21 | /** |
||
22 | * @var AMQPExchange |
||
23 | */ |
||
24 | protected $resource; |
||
25 | /** |
||
26 | * @var Options\ExchangeOptions |
||
27 | */ |
||
28 | protected $options; |
||
29 | |||
30 | /** |
||
31 | * @return Options\ExchangeOptions |
||
32 | */ |
||
33 | 11 | public function getOptions() |
|
37 | |||
38 | /** |
||
39 | * @param Options\ExchangeOptions $exchangeOptions |
||
40 | * @return $this |
||
41 | */ |
||
42 | 11 | public function setOptions(Options\ExchangeOptions $exchangeOptions) |
|
48 | |||
49 | /** |
||
50 | * @return AMQPExchange |
||
51 | */ |
||
52 | 11 | public function getResource() |
|
56 | |||
57 | /** |
||
58 | * @param AMQPExchange $resource |
||
59 | * @return $this |
||
60 | */ |
||
61 | 11 | public function setResource(AMQPExchange $resource) |
|
66 | |||
67 | /** |
||
68 | * @return $this |
||
69 | */ |
||
70 | 11 | protected function configureExchange() |
|
99 | |||
100 | /** |
||
101 | * Declare a new exchange on the broker. |
||
102 | * |
||
103 | * @return $this |
||
104 | * @throws Exception\RuntimeException |
||
105 | * @throws \AMQPExchangeException |
||
106 | * @throws \AMQPChannelException |
||
107 | * @throws \AMQPConnectionException |
||
108 | */ |
||
109 | 1 | public function declareExchange() |
|
115 | |||
116 | /** |
||
117 | * Delete the exchange from the broker. |
||
118 | * |
||
119 | * @param bool $ifUnused Optional if the exchange should not be |
||
120 | * deleted until no clients are connected to |
||
121 | * it. |
||
122 | * @param bool $noWait No wait for a reply |
||
123 | * |
||
124 | * @return $this |
||
125 | * @throws \AMQPExchangeException |
||
126 | * @throws \AMQPChannelException |
||
127 | * @throws \AMQPConnectionException |
||
128 | */ |
||
129 | 4 | public function delete($ifUnused = false, $noWait = false) |
|
143 | |||
144 | /** |
||
145 | * Bind to another exchange. |
||
146 | * |
||
147 | * Bind an exchange to another exchange using the specified routing key. |
||
148 | * |
||
149 | * @param string $exchangeName Name of the exchange to bind. |
||
150 | * @param string $routingKey The routing key to use for binding. |
||
151 | * @param bool $noWait No wait for a reply |
||
152 | * @param array $arguments Additional binding arguments. |
||
153 | * |
||
154 | * @return $this |
||
155 | * @throws \AMQPExchangeException |
||
156 | * @throws \AMQPChannelException |
||
157 | * @throws \AMQPConnectionException |
||
158 | */ |
||
159 | 1 | public function bind($exchangeName, $routingKey = null, $noWait = false, array $arguments = []) |
|
165 | |||
166 | /** |
||
167 | * Remove binding to another exchange. |
||
168 | * |
||
169 | * Remove a routing key binding on an another exchange from the given exchange. |
||
170 | * |
||
171 | * @param string $exchangeName Name of the exchange to bind. |
||
172 | * @param string $routingKey The routing key to use for binding. |
||
173 | * @param array $arguments Additional binding arguments. |
||
174 | * |
||
175 | * @return $this |
||
176 | * @throws \AMQPExchangeException |
||
177 | * @throws \AMQPChannelException |
||
178 | * @throws \AMQPConnectionException |
||
179 | */ |
||
180 | 1 | public function unbind($exchangeName, $routingKey = null, array $arguments = []) |
|
186 | |||
187 | /** |
||
188 | * Publish a message to an exchange. |
||
189 | * |
||
190 | * Publish a message to the exchange represented by the Exchange object. |
||
191 | * |
||
192 | * @param string $message The message to publish. |
||
193 | * @param string $routingKey The optional routing key to which to |
||
194 | * publish to. |
||
195 | * @param bool $mandatory Mandatory |
||
196 | * @param bool $immediate Immediate |
||
197 | * @param array $attributes One of content_type, content_encoding, |
||
198 | * message_id, user_id, app_id, delivery_mode, |
||
199 | * priority, timestamp, expiration, type |
||
200 | * or reply_to, headers. |
||
201 | * |
||
202 | * @return $this |
||
203 | * @throws \AMQPExchangeException |
||
204 | * @throws \AMQPChannelException |
||
205 | * @throws \AMQPConnectionException |
||
206 | */ |
||
207 | 4 | public function publish( |
|
226 | |||
227 | /** |
||
228 | * Get the Connection object in use |
||
229 | * |
||
230 | * @return Connection |
||
231 | */ |
||
232 | public function getConnection() |
||
236 | |||
237 | /** |
||
238 | * @param Channel $channel |
||
239 | * @return $this |
||
240 | */ |
||
241 | public function setChannel(Channel $channel) |
||
246 | |||
247 | /** |
||
248 | * Get the Channel object in use |
||
249 | * |
||
250 | * @return Channel |
||
251 | */ |
||
252 | public function getChannel() |
||
256 | } |
||
257 |