*/
public AMQShortString send0_10QueueDeclare(final AMQDestination amqd, final boolean noLocal,
final boolean nowait, boolean passive)
throws AMQException
{
AMQShortString queueName;
if (amqd.getAMQQueueName() == null)
{
// generate a name for this queue
queueName = new AMQShortString("TempQueue" + UUID.randomUUID());
amqd.setQueueName(queueName);
}
else
{
queueName = amqd.getAMQQueueName();
}
if (amqd.getDestSyntax() == DestSyntax.BURL)
{
Map<String,Object> arguments = new HashMap<String,Object>();
if (noLocal)
{
arguments.put(AddressHelper.NO_LOCAL, true);
}
getQpidSession().queueDeclare(queueName.toString(), "" , arguments,
amqd.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
amqd.isDurable() ? Option.DURABLE : Option.NONE,
amqd.isExclusive() ? Option.EXCLUSIVE : Option.NONE,
passive ? Option.PASSIVE : Option.NONE);
}
else
{
// This code is here to ensure address based destination work with the declareQueue public method in AMQSession.java
Node node = amqd.getNode();
Map<String,Object> arguments = new HashMap<String,Object>();
arguments.putAll((Map<? extends String, ? extends Object>) node.getDeclareArgs());
if (arguments == null || arguments.get(AddressHelper.NO_LOCAL) == null)
{
arguments.put(AddressHelper.NO_LOCAL, noLocal);
}
getQpidSession().queueDeclare(queueName.toString(), node.getAlternateExchange() ,
arguments,
node.isAutoDelete() ? Option.AUTO_DELETE : Option.NONE,
node.isDurable() ? Option.DURABLE : Option.NONE,
node.isExclusive() ? Option.EXCLUSIVE : Option.NONE);
}