if (object != null)
{
org.apache.qpid.server.qmf2.agentdata.Exchange ex =
(org.apache.qpid.server.qmf2.agentdata.Exchange)object;
Exchange altEx = ex.getExchange();
attributes.put(Queue.ALTERNATE_EXCHANGE, altEx.getId());
}
}
Queue queue = vhost.createQueue(attributes);
}
else if (type.equals("binding")) // create binding.
{
Exchange exchange = nameParser.getExchange();
if (exchange == null)
{
agent.raiseException(handle, "Cannot create binding on Exchange " +
nameParser.getExchangeName());
return;
}
else
{
Map<String, Object> attributes = Collections.emptyMap();
exchange.createBinding(nameParser.getBindingKey(), nameParser.getQueue(),
properties, attributes);
}
}
agent.methodResponse(methodName, handle, outArgs, null);
}
catch (Exception e)
{
agent.raiseException(handle, e.getMessage());
}
}
else // method = delete
{
try
{
if (type.equals("exchange")) // delete exchange.
{
Exchange exchange = nameParser.getExchange();
if (exchange != null)
{
exchange.delete();
}
}
else if (type.equals("queue")) // delete queue.
{
Queue queue = nameParser.getQueue();