}
public boolean isExchangeExist(AMQDestination dest,ExchangeNode node,boolean assertNode)
{
boolean match = true;
ExchangeQueryResult result = getQpidSession().exchangeQuery(dest.getAddressName(), Option.NONE).get();
match = !result.getNotFound();
if (match)
{
if (assertNode)
{
match = (result.getDurable() == node.isDurable()) &&
(node.getExchangeType() != null &&
node.getExchangeType().equals(result.getType())) &&
(matchProps(result.getArguments(),node.getDeclareArgs()));
}
else if (node.getExchangeType() != null)
{
// even if assert is false, better to verify this
match = node.getExchangeType().equals(result.getType());
if (!match)
{
_logger.debug("Exchange type doesn't match. Expected : " + node.getExchangeType() +
" actual " + result.getType());
}
}
else
{
_logger.debug("Setting Exchange type " + result.getType());
node.setExchangeType(result.getType());
dest.setExchangeClass(new AMQShortString(result.getType()));
}
}
return match;
}