3737import com .rabbitmq .client .AMQP .Exchange ;
3838import com .rabbitmq .client .AMQP .Queue ;
3939import com .rabbitmq .client .AMQP .Tx ;
40+ import com .rabbitmq .client .AMQP .Basic ;
4041import com .rabbitmq .client .AMQP .Channel .FlowOk ;
4142
4243/**
@@ -91,10 +92,10 @@ public interface Channel extends ShutdownNotifier {
9192 * @throws java.io.IOException if an error is encountered
9293 */
9394 void close (int closeCode , String closeMessage ) throws IOException ;
94-
95+
9596 /**
9697 * Set flow on the channel
97- *
98+ *
9899 * @param active if true, the server is asked to start sending. If false, the server is asked to stop sending.
99100 * @throws IOException
100101 */
@@ -183,38 +184,17 @@ public interface Channel extends ShutdownNotifier {
183184 void basicPublish (String exchange , String routingKey , boolean mandatory , boolean immediate , BasicProperties props , byte [] body )
184185 throws IOException ;
185186
186- /**
187- * Delete an exchange, without regard for whether it is in use or not
188- * @see com.rabbitmq.client.AMQP.Exchange.Delete
189- * @see com.rabbitmq.client.AMQP.Exchange.DeleteOk
190- * @param exchange the name of the exchange
191- * @return a deletion-confirm method to indicate the exchange was successfully deleted
192- * @throws java.io.IOException if an error is encountered
193- */
194- Exchange .DeleteOk exchangeDelete (String exchange ) throws IOException ;
195-
196187 /**
197188 * Actively declare a non-autodelete, non-durable exchange with no extra arguments
198189 * @see com.rabbitmq.client.AMQP.Exchange.Declare
199190 * @see com.rabbitmq.client.AMQP.Exchange.DeclareOk
200191 * @param exchange the name of the exchange
201192 * @param type the exchange type
202- * @return a deletion -confirm method to indicate the exchange was successfully deleted
193+ * @return a declaration -confirm method to indicate the exchange was successfully declared
203194 * @throws java.io.IOException if an error is encountered
204195 */
205196 Exchange .DeclareOk exchangeDeclare (String exchange , String type ) throws IOException ;
206197
207- /**
208- * Delete an exchange
209- * @see com.rabbitmq.client.AMQP.Exchange.Delete
210- * @see com.rabbitmq.client.AMQP.Exchange.DeleteOk
211- * @param exchange the name of the exchange
212- * @param ifUnused true to indicate that the exchange is only to be deleted if it is unused
213- * @return a deletion-confirm method to indicate the exchange was successfully deleted
214- * @throws java.io.IOException if an error is encountered
215- */
216- Exchange .DeleteOk exchangeDelete (String exchange , boolean ifUnused ) throws IOException ;
217-
218198 /**
219199 * Actively declare a non-autodelete exchange with no extra arguments
220200 * @see com.rabbitmq.client.AMQP.Exchange.Declare
@@ -228,70 +208,88 @@ void basicPublish(String exchange, String routingKey, boolean mandatory, boolean
228208 Exchange .DeclareOk exchangeDeclare (String exchange , String type , boolean durable ) throws IOException ;
229209
230210 /**
231- * Declare an exchange, via an interface that allows the complete set of arguments
232- * The name of the new queue is held in the "queue" field of the {@link com.rabbitmq.client.AMQP.Queue.DeclareOk} result.
211+ * Declare an exchange, via an interface that allows the complete set of arguments.
233212 * @see com.rabbitmq.client.AMQP.Exchange.Declare
234213 * @see com.rabbitmq.client.AMQP.Exchange.DeclareOk
235214 * @param exchange the name of the exchange
236215 * @param type the exchange type
237- * @param passive true if we are passively declaring a exchange (asserting the exchange already exists)
238216 * @param durable true if we are declaring a durable exchange (the exchange will survive a server restart)
239217 * @param autoDelete true if the server should delete the exchange when it is no longer in use
240218 * @param arguments other properties (construction arguments) for the exchange
241219 * @return a declaration-confirm method to indicate the exchange was successfully declared
242220 * @throws java.io.IOException if an error is encountered
243221 */
244- Exchange .DeclareOk exchangeDeclare (String exchange , String type , boolean passive , boolean durable , boolean autoDelete ,
222+ Exchange .DeclareOk exchangeDeclare (String exchange , String type , boolean durable , boolean autoDelete ,
245223 Map <String , Object > arguments ) throws IOException ;
246224
247225 /**
248- * Actively declare a server-named exclusive, autodelete, non-durable queue.
249- * The name of the new queue is held in the "queue" field of the {@link com.rabbitmq.client.AMQP.Queue.DeclareOk} result.
250- * @see com.rabbitmq.client.AMQP.Queue.Declare
251- * @see com.rabbitmq.client.AMQP.Queue.DeclareOk
252- * @return a declaration-confirm method to indicate the exchange was successfully declared
226+ * Declare an exchange passively; that is, check if the named exchange exists.
227+ * @param name check the existence of an exchange named this
228+ * @param type the exchange type
229+ * @throws IOException the server will raise a 404 channel exception if the named exchange does not exist.
230+ */
231+ Exchange .DeclareOk exchangeDeclarePassive (String name , String type ) throws IOException ;
232+
233+ /**
234+ * Delete an exchange
235+ * @see com.rabbitmq.client.AMQP.Exchange.Delete
236+ * @see com.rabbitmq.client.AMQP.Exchange.DeleteOk
237+ * @param exchange the name of the exchange
238+ * @param ifUnused true to indicate that the exchange is only to be deleted if it is unused
239+ * @return a deletion-confirm method to indicate the exchange was successfully deleted
253240 * @throws java.io.IOException if an error is encountered
254241 */
255- Queue . DeclareOk queueDeclare ( ) throws IOException ;
242+ Exchange . DeleteOk exchangeDelete ( String exchange , boolean ifUnused ) throws IOException ;
256243
257244 /**
258- * Actively declare a non-exclusive, non-autodelete, non-durable queue
259- * @see com.rabbitmq.client.AMQP.Queue.Declare
260- * @see com.rabbitmq.client.AMQP.Queue.DeclareOk
261- * @param queue the name of the queue
262- * @return a declaration -confirm method to indicate the queue was successfully declared
245+ * Delete an exchange, without regard for whether it is in use or not
246+ * @see com.rabbitmq.client.AMQP.Exchange.Delete
247+ * @see com.rabbitmq.client.AMQP.Exchange.DeleteOk
248+ * @param exchange the name of the exchange
249+ * @return a deletion -confirm method to indicate the exchange was successfully deleted
263250 * @throws java.io.IOException if an error is encountered
264251 */
265- Queue . DeclareOk queueDeclare (String queue ) throws IOException ;
252+ Exchange . DeleteOk exchangeDelete (String exchange ) throws IOException ;
266253
267254 /**
268- * Actively declare a non- exclusive, non-autodelete queue
255+ * Actively declare a server-named exclusive, autodelete, non-durable queue.
269256 * The name of the new queue is held in the "queue" field of the {@link com.rabbitmq.client.AMQP.Queue.DeclareOk} result.
270257 * @see com.rabbitmq.client.AMQP.Queue.Declare
271258 * @see com.rabbitmq.client.AMQP.Queue.DeclareOk
272- * @param queue the name of the queue
273- * @param durable true if we are declaring a durable exchange (the exchange will survive a server restart)
274- * @return a declaration-confirm method to indicate the exchange was successfully declared
259+ * @return a declaration-confirm method to indicate the queue was successfully declared
275260 * @throws java.io.IOException if an error is encountered
276261 */
277- Queue .DeclareOk queueDeclare (String queue , boolean durable ) throws IOException ;
262+ Queue .DeclareOk queueDeclare () throws IOException ;
278263
279264 /**
280265 * Declare a queue
281266 * @see com.rabbitmq.client.AMQP.Queue.Declare
282267 * @see com.rabbitmq.client.AMQP.Queue.DeclareOk
283268 * @param queue the name of the queue
284- * @param passive true if we are passively declaring a queue (asserting the queue already exists)
285269 * @param durable true if we are declaring a durable queue (the queue will survive a server restart)
286- * @param exclusive true if we are declaring an exclusive queue
270+ * @param exclusive true if we are declaring an exclusive queue (restricted to this connection)
287271 * @param autoDelete true if we are declaring an autodelete queue (server will delete it when no longer in use)
288272 * @param arguments other properties (construction arguments) for the queue
289273 * @return a declaration-confirm method to indicate the queue was successfully declared
290274 * @throws java.io.IOException if an error is encountered
291275 */
292- Queue .DeclareOk queueDeclare (String queue , boolean passive , boolean durable , boolean exclusive , boolean autoDelete ,
276+ Queue .DeclareOk queueDeclare (String queue , boolean durable , boolean exclusive , boolean autoDelete ,
293277 Map <String , Object > arguments ) throws IOException ;
294278
279+ /**
280+ * Declare a queue passively; i.e., check if it exists. In AMQP
281+ * 0-9-1, all arguments aside from nowait are ignored; and sending
282+ * nowait makes this method a no-op, so we default it to false.
283+ * @see com.rabbitmq.client.AMQP.Queue.Declare
284+ * @see com.rabbitmq.client.AMQP.Queue.DeclareOk
285+ * @param queue the name of the queue
286+ * @return a declaration-confirm method to indicate the queue exists
287+ * @throws java.io.IOException if an error is encountered,
288+ * including if the queue does not exist and if the queue is
289+ * exclusively owned by another connection.
290+ */
291+ Queue .DeclareOk queueDeclarePassive (String queue ) throws IOException ;
292+
295293 /**
296294 * Delete a queue, without regard for whether it is in use or has messages on it
297295 * @see com.rabbitmq.client.AMQP.Queue.Delete
0 commit comments