private boolean processIdentityTrust(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy)
throws OperationFailedException {
node = peek(node, IDENTITY_TRUST, CLASSIC, TRUST_MODULE);
if (node == null) { return false; }
IdentityTrustInfo identityTrustInfo = new IdentityTrustInfo(securityDomain);
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = LoginModuleResourceDefinition.CODE.resolveModelAttribute(context, module).asString();
String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
ControlFlag controlFlag = ControlFlag.valueOf(flag);
Map<String, Object> options = extractOptions(context, module);
IdentityTrustModuleEntry entry = new IdentityTrustModuleEntry(codeName, options);
entry.setControlFlag(controlFlag);
identityTrustInfo.add(entry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && moduleName.asString().length() > 0) {
identityTrustInfo.setJBossModuleName(moduleName.asString());
}
}
applicationPolicy.setIdentityTrustInfo(identityTrustInfo);
return true;
}