if (name == null)
{
throw new IllegalArgumentException("Queue name is null");
}
QueueQueryResult response;
Binding binding = postOffice.getBinding(name);
if (binding != null && binding.getType() == BindingType.LOCAL_QUEUE)
{
Queue queue = (Queue)binding.getBindable();
Filter filter = queue.getFilter();
SimpleString filterString = filter == null ? null : filter.getFilterString();
response = new QueueQueryResult(name,
binding.getAddress(),
queue.isDurable(),
queue.isTemporary(),
filterString,
queue.getConsumerCount(),
queue.getMessageCount());
}
// make an exception for the management address (see HORNETQ-29)
else if (name.equals(managementAddress))
{
response = new QueueQueryResult(name, managementAddress, true, false, null, -1, -1);
}
else
{
response = new QueueQueryResult();
}
return response;
}