use of org.jboss.dmr.Property in project wildfly by wildfly.
the class DiscoveryGroupAdd method addDiscoveryGroupConfigs.
static void addDiscoveryGroupConfigs(final OperationContext context, final Configuration configuration, final ModelNode model) throws OperationFailedException {
if (model.hasDefined(CommonAttributes.DISCOVERY_GROUP)) {
Map<String, DiscoveryGroupConfiguration> configs = configuration.getDiscoveryGroupConfigurations();
if (configs == null) {
configs = new HashMap<String, DiscoveryGroupConfiguration>();
configuration.setDiscoveryGroupConfigurations(configs);
}
for (Property prop : model.get(CommonAttributes.DISCOVERY_GROUP).asPropertyList()) {
configs.put(prop.getName(), createDiscoveryGroupConfiguration(context, prop.getName(), prop.getValue()));
}
}
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class SecurityDomainAdd method processAuthorization.
private boolean processAuthorization(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
node = peek(node, AUTHORIZATION, CLASSIC, POLICY_MODULE);
if (node == null) {
return false;
}
AuthorizationInfo authzInfo = new AuthorizationInfo(securityDomain);
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = extractCode(context, module, ModulesMap.AUTHORIZATION_MAP);
String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
ControlFlag controlFlag = ControlFlag.valueOf(flag);
Map<String, Object> options = extractOptions(context, module);
AuthorizationModuleEntry authzModuleEntry = new AuthorizationModuleEntry(codeName, options);
authzModuleEntry.setControlFlag(controlFlag);
authzInfo.add(authzModuleEntry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
authzInfo.addJBossModuleName(moduleName.asString());
} else {
authzInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
applicationPolicy.setAuthorizationInfo(authzInfo);
return true;
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class SecurityDomainAdd method processACL.
private boolean processACL(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
node = peek(node, ACL, CLASSIC, ACL_MODULE);
if (node == null) {
return false;
}
ACLInfo aclInfo = new ACLInfo(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);
ACLProviderEntry entry = new ACLProviderEntry(codeName, options);
entry.setControlFlag(controlFlag);
aclInfo.add(entry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
aclInfo.addJBossModuleName(moduleName.asString());
} else {
aclInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
applicationPolicy.setAclInfo(aclInfo);
return true;
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class SecurityDomainAdd method processLoginModules.
private void processLoginModules(OperationContext context, ModelNode node, BaseAuthenticationInfo authInfo, LoginModuleContainer container) throws OperationFailedException {
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = extractCode(context, module, ModulesMap.AUTHENTICATION_MAP);
String flag = LoginModuleResourceDefinition.FLAG.resolveModelAttribute(context, module).asString();
LoginModuleControlFlag controlFlag = getControlFlag(flag);
Map<String, Object> options = extractOptions(context, module);
AppConfigurationEntry entry = new AppConfigurationEntry(codeName, controlFlag, options);
container.addAppConfigurationEntry(entry);
ModelNode moduleName = LoginModuleResourceDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
authInfo.addJBossModuleName(moduleName.asString());
} else {
authInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
}
use of org.jboss.dmr.Property in project wildfly by wildfly.
the class SecurityDomainAdd method processAudit.
private boolean processAudit(OperationContext context, String securityDomain, ModelNode node, ApplicationPolicy applicationPolicy) throws OperationFailedException {
node = peek(node, AUDIT, CLASSIC, PROVIDER_MODULE);
if (node == null) {
return false;
}
AuditInfo auditInfo = new AuditInfo(securityDomain);
for (Property moduleProperty : node.asPropertyList()) {
ModelNode module = moduleProperty.getValue();
String codeName = MappingProviderModuleDefinition.CODE.resolveModelAttribute(context, module).asString();
Map<String, Object> options = extractOptions(context, module);
AuditProviderEntry entry = new AuditProviderEntry(codeName, options);
auditInfo.add(entry);
ModelNode moduleName = MappingProviderModuleDefinition.MODULE.resolveModelAttribute(context, module);
if (moduleName.isDefined() && !moduleName.asString().isEmpty()) {
auditInfo.addJBossModuleName(moduleName.asString());
} else {
auditInfo.addJBossModuleName(DEFAULT_MODULE);
}
}
applicationPolicy.setAuditInfo(auditInfo);
return true;
}
Aggregations