// security
List<Property> secProps = model.get("security-setting").asPropertyList();
List<SecurityPattern> secPatterns = new ArrayList<SecurityPattern>(secProps.size());
for(Property prop : secProps)
{
SecurityPattern pattern = factory.messagingSecurity().as();
pattern.setPattern(prop.getName());
Property principalProp= prop.getValue().asProperty();
pattern.setPrincipal(principalProp.getName());
ModelNode propValue = principalProp.getValue().asObject();
pattern.setSend(propValue.get("send").asBoolean());
pattern.setConsume(propValue.get("consume").asBoolean());
pattern.setManage(propValue.get("manage").asBoolean());
pattern.setCreateDurableQueue(propValue.get("createDurableQueue").asBoolean());
pattern.setDeleteDurableQueue(propValue.get("deleteDurableQueue").asBoolean());
pattern.setCreateNonDurableQueue(propValue.get("createNonDurableQueue").asBoolean());
pattern.setDeleteNonDurableQueue(propValue.get("deleteNonDurableQueue").asBoolean());
secPatterns.add(pattern);
}
provider.setSecurityPatterns(secPatterns);
// addressing
List<Property> addrProps = model.get("address-setting").asPropertyList();
List<AddressingPattern> addrPatterns = new ArrayList<AddressingPattern>(addrProps.size());
for(Property prop : addrProps)
{
AddressingPattern pattern = factory.messagingAddress().as();
pattern.setPattern(prop.getName());
ModelNode propValue = prop.getValue().asObject();
pattern.setDeadLetterQueue(propValue.get("dead-letter-address").asString());
pattern.setExpiryQueue(propValue.get("expiry-address").asString());
pattern.setRedeliveryDelay(propValue.get("redelivery-delay").asInt());
addrPatterns.add(pattern);
}
provider.setAddressPatterns(addrPatterns);