{
String match = node.getAttributes().getNamedItem("match").getNodeValue();
NodeList children = node.getChildNodes();
AddressSettings addressSettings = new AddressSettings();
Pair<String, AddressSettings> setting = new Pair<String, AddressSettings>(match, addressSettings);
for (int i = 0; i < children.getLength(); i++)
{
Node child = children.item(i);
if (FileConfigurationParser.DEAD_LETTER_ADDRESS_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
SimpleString queueName = new SimpleString(child.getTextContent());
addressSettings.setDeadLetterAddress(queueName);
}
else if (FileConfigurationParser.EXPIRY_ADDRESS_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
SimpleString queueName = new SimpleString(child.getTextContent());
addressSettings.setExpiryAddress(queueName);
}
else if (FileConfigurationParser.REDELIVERY_DELAY_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setRedeliveryDelay(Long.valueOf(child.getTextContent()));
}
else if (FileConfigurationParser.MAX_SIZE_BYTES_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setMaxSizeBytes(Long.valueOf(child.getTextContent()));
}
else if (FileConfigurationParser.PAGE_SIZE_BYTES_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setPageSizeBytes(Long.valueOf(child.getTextContent()));
}
else if (FileConfigurationParser.PAGE_MAX_CACHE_SIZE_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setPageCacheMaxSize(Integer.valueOf(child.getTextContent()));
}
else if (FileConfigurationParser.MESSAGE_COUNTER_HISTORY_DAY_LIMIT_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setMessageCounterHistoryDayLimit(Integer.valueOf(child.getTextContent()));
}
else if (FileConfigurationParser.ADDRESS_FULL_MESSAGE_POLICY_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
String value = child.getTextContent().trim();
Validators.ADDRESS_FULL_MESSAGE_POLICY_TYPE.validate(FileConfigurationParser.ADDRESS_FULL_MESSAGE_POLICY_NODE_NAME,
value);
AddressFullMessagePolicy policy = null;
if (value.equals(AddressFullMessagePolicy.BLOCK.toString()))
{
policy = AddressFullMessagePolicy.BLOCK;
}
else if (value.equals(AddressFullMessagePolicy.DROP.toString()))
{
policy = AddressFullMessagePolicy.DROP;
}
else if (value.equals(AddressFullMessagePolicy.PAGE.toString()))
{
policy = AddressFullMessagePolicy.PAGE;
}
addressSettings.setAddressFullMessagePolicy(policy);
}
else if (FileConfigurationParser.LVQ_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setLastValueQueue(Boolean.valueOf(child.getTextContent().trim()));
}
else if (FileConfigurationParser.MAX_DELIVERY_ATTEMPTS.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setMaxDeliveryAttempts(Integer.valueOf(child.getTextContent().trim()));
}
else if (FileConfigurationParser.REDISTRIBUTION_DELAY_NODE_NAME.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setRedistributionDelay(Long.valueOf(child.getTextContent().trim()));
}
else if (FileConfigurationParser.SEND_TO_DLA_ON_NO_ROUTE.equalsIgnoreCase(child.getNodeName()))
{
addressSettings.setSendToDLAOnNoRoute(Boolean.valueOf(child.getTextContent().trim()));
}
}
return setting;
}