/** * Returns true if this exchange has at least one binding associated with it. * @return */ @DoOnConfigThread boolean hasBindings();
/** * Determines whether a message is routing to any queue using a specific _routing key * @param bindingKey * @return */ @DoOnConfigThread boolean isBound(@Param(name = "bindingKey") String bindingKey);
@DoOnConfigThread boolean isBound(@Param(name = "queue") Queue<?> queue);
@DoOnConfigThread boolean isBound(@Param(name = "arguments") Map<String, Object> arguments);
/** * Determines whether a message would be isBound to a particular queue using a specific routing key * @param bindingKey * @param queue * @return */ @DoOnConfigThread boolean isBound(@Param(name = "bindingKey") String bindingKey, @Param(name = "queue") Queue<?> queue);
@DoOnConfigThread boolean hasBinding(@Param(name = "bindingKey") String bindingKey, @Param(name = "queue") Queue<?> queue);
@DoOnConfigThread boolean deleteBinding(@Param(name = "bindingKey") String bindingKey, @Param(name = "queue") Queue<?> queue);
@DoOnConfigThread boolean isBound(@Param(name = "bindingKey") String bindingKey, @Param(name = "arguments") Map<String, Object> arguments);
@DoOnConfigThread boolean isBound(@Param(name = "arguments") Map<String, Object> arguments, @Param(name = "queue") Queue<?> queue);
/** * Determines whether a message would be isBound to a particular queue using a specific routing key and arguments * @param bindingKey * @param arguments * @param queue * @return */ @DoOnConfigThread boolean isBound(@Param(name = "bindingKey") String bindingKey, @Param(name = "arguments") Map<String, Object> arguments, @Param(name = "queue") Queue<?> queue);
@DoOnConfigThread boolean addBinding(@Param(name = "bindingKey") String bindingKey, @Param(name = "queue") Queue<?> queue, @Param(name = "arguments") Map<String, Object> arguments) throws AMQInvalidArgumentException;
@DoOnConfigThread void replaceBinding(@Param(name = "bindingKey") String bindingKey, @Param(name = "queue") Queue<?> queue, @Param(name = "arguments") Map<String, Object> arguments) throws AMQInvalidArgumentException;
@Override @DoOnConfigThread public void removeSubscriptionQueue(@Param(name = "queueName", mandatory = true) final String queueName) throws NotFoundException { Queue<?> queue = findConfiguredObject(Queue.class, queueName); if (queue == null) { throw new NotFoundException(String.format("Queue '%s' was not found", queueName)); } if (queue.getConsumers().isEmpty()) { queue.delete(); } else { throw new IllegalStateException("There are consumers on Queue '" + queueName + "'"); } }
@Override @DoOnConfigThread public Queue<?> getSubscriptionQueue(@Param(name = "exchangeName", mandatory = true) final String exchangeName, @Param(name = "attributes", mandatory = true) final Map<String, Object> attributes,
@Override @DoOnConfigThread public void destinationRemoved(@Param(name="destination") final MessageDestination destination) { Iterator<Binding> bindingIterator = _bindings.iterator(); while(bindingIterator.hasNext()) { Binding b = bindingIterator.next(); if(b.getDestination().equals(destination.getName())) { final Map<String, Object> bindArguments = UNBIND_ARGUMENTS_CREATOR.createMap(b.getBindingKey(), destination); getEventLogger().message(_logSubject, BindingMessages.DELETED(String.valueOf(bindArguments))); onUnbind(new BindingIdentifier(b.getBindingKey(), destination)); _bindings.remove(b); } } if(!autoDeleteIfNecessary()) { if (destination.isDurable() && isDurable()) { final Collection<Binding> durableBindings = getDurableBindings(); attributeSet(DURABLE_BINDINGS, durableBindings, durableBindings); } } }