}
}
}
ModelNode parsePolicyElement(XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException {
final ModelNode policy = new ModelNode();
policy.get(OP).set(ADD);
policy.get(OP_ADDR).set(address).add(SaslPolicyResource.SASL_POLICY_CONFIG_PATH.getKey(), SaslPolicyResource.SASL_POLICY_CONFIG_PATH.getValue());
list.add(policy);
if (reader.getAttributeCount() > 0) {
throw ParseUtils.unexpectedAttribute(reader, 0);
}
// Handle nested elements.
final EnumSet<Element> visited = EnumSet.noneOf(Element.class);
while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
switch (Namespace.forUri(reader.getNamespaceURI())) {
case REMOTING_1_0: {
final Element element = Element.forName(reader.getLocalName());
if (visited.contains(element)) {
throw ParseUtils.unexpectedElement(reader);
}
visited.add(element);
switch (element) {
case FORWARD_SECRECY: {
policy.get(FORWARD_SECRECY).set(readBooleanAttributeElement(reader, "value"));
break;
}
case NO_ACTIVE: {
policy.get(NO_ACTIVE).set(readBooleanAttributeElement(reader, "value"));
break;
}
case NO_ANONYMOUS: {
policy.get(NO_ANONYMOUS).set(readBooleanAttributeElement(reader, "value"));
break;
}
case NO_DICTIONARY: {
policy.get(NO_DICTIONARY).set(readBooleanAttributeElement(reader, "value"));
break;
}
case NO_PLAIN_TEXT: {
policy.get(NO_PLAIN_TEXT).set(readBooleanAttributeElement(reader, "value"));
break;
}
case PASS_CREDENTIALS: {
policy.get(PASS_CREDENTIALS).set(readBooleanAttributeElement(reader, "value"));
break;
}
default: {
throw unexpectedElement(reader);
}