if (name == null)
{
throw HornetQMessageBundle.BUNDLE.queueNameIsNull();
}
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(QueueImpl.DELIVERY_TIMEOUT));
}
// 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;
}