Search in sources :

Example 1 with AuditProviderEntry

use of org.jboss.security.audit.config.AuditProviderEntry 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;
}
Also used : AuditInfo(org.jboss.security.config.AuditInfo) ModelNode(org.jboss.dmr.ModelNode) Property(org.jboss.dmr.Property) AuditProviderEntry(org.jboss.security.audit.config.AuditProviderEntry)

Aggregations

ModelNode (org.jboss.dmr.ModelNode)1 Property (org.jboss.dmr.Property)1 AuditProviderEntry (org.jboss.security.audit.config.AuditProviderEntry)1 AuditInfo (org.jboss.security.config.AuditInfo)1