applicationPolicy = new ApplicationPolicy(securityDomain);
ACLInfo aclInfo = new ACLInfo(securityDomain);
modules = node.asList();
for (ModelNode module : modules) {
String codeName = module.require(CODE).asString();
ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
Map<String, Object> options = new HashMap<String, Object>();
if (module.hasDefined(MODULE_OPTIONS)) {
for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
options.put(prop.getName(), prop.getValue().asString());
}
}
ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
entry.setControlFlag(controlFlag);
aclInfo.add(entry);
}
applicationPolicy.setAclInfo(aclInfo);
}
// audit
node = operation.get(AUDIT);
if (node.isDefined()) {
if (applicationPolicy == null)
applicationPolicy = new ApplicationPolicy(securityDomain);
AuditInfo auditInfo = new AuditInfo(securityDomain);
modules = node.asList();
for (ModelNode module : modules) {
String codeName = module.require(CODE).asString();
Map<String, Object> options = new HashMap<String, Object>();
if (module.hasDefined(MODULE_OPTIONS)) {
for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
options.put(prop.getName(), prop.getValue().asString());
}
}
AuditProviderEntry entry = new AuditProviderEntry(codeName, options);
auditInfo.add(entry);
}
applicationPolicy.setAuditInfo(auditInfo);
}
// authorization
node = operation.get(AUTHORIZATION);
if (node.isDefined()) {
if (applicationPolicy == null)
applicationPolicy = new ApplicationPolicy(securityDomain);
AuthorizationInfo authorizationInfo = new AuthorizationInfo(securityDomain);
modules = node.asList();
for (ModelNode module : modules) {
String codeName = module.require(CODE).asString();
if (ModulesMap.AUTHORIZATION_MAP.containsKey(codeName))
codeName = ModulesMap.AUTHORIZATION_MAP.get(codeName);
ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
Map<String, Object> options = new HashMap<String, Object>();
if (module.hasDefined(MODULE_OPTIONS)) {
for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
options.put(prop.getName(), prop.getValue().asString());
}
}
AuthorizationModuleEntry entry = new AuthorizationModuleEntry(codeName, options);
entry.setControlFlag(controlFlag);
authorizationInfo.add(entry);
}
applicationPolicy.setAuthorizationInfo(authorizationInfo);
}
// identity trust
node = operation.get(IDENTITY_TRUST);
if (node.isDefined()) {
if (applicationPolicy == null)
applicationPolicy = new ApplicationPolicy(securityDomain);
IdentityTrustInfo identityTrustInfo = new IdentityTrustInfo(securityDomain);
modules = node.asList();
for (ModelNode module : modules) {
String codeName = module.require(CODE).asString();
ControlFlag controlFlag = ControlFlag.valueOf(module.require(FLAG).asString());
Map<String, Object> options = new HashMap<String, Object>();
if (module.hasDefined(MODULE_OPTIONS)) {
for (Property prop : module.get(MODULE_OPTIONS).asPropertyList()) {
options.put(prop.getName(), prop.getValue().asString());
}