Search in sources :

Example 1 with ExpressionProfiles

use of com.evolveum.midpoint.schema.expression.ExpressionProfiles in project midpoint by Evolveum.

the class SystemObjectCache method compileExpressionProfiles.

private void compileExpressionProfiles(OperationResult result) throws SchemaException {
    PrismObject<SystemConfigurationType> systemConfiguration = getSystemConfiguration(result);
    if (systemConfiguration == null) {
        // This should only happen in tests - if ever. Empty expression profiles are just fine.
        expressionProfiles = new ExpressionProfiles();
        return;
    }
    SystemConfigurationExpressionsType expressions = systemConfiguration.asObjectable().getExpressions();
    if (expressions == null) {
        // Mark that there is no need to recompile. There are no profiles.
        expressionProfiles = new ExpressionProfiles();
        return;
    }
    ExpressionProfileCompiler compiler = new ExpressionProfileCompiler();
    expressionProfiles = compiler.compile(expressions);
}
Also used : ExpressionProfileCompiler(com.evolveum.midpoint.model.common.expression.ExpressionProfileCompiler) ExpressionProfiles(com.evolveum.midpoint.schema.expression.ExpressionProfiles)

Example 2 with ExpressionProfiles

use of com.evolveum.midpoint.schema.expression.ExpressionProfiles in project midpoint by Evolveum.

the class SystemObjectCache method dumpContent.

@Override
public void dumpContent() {
    if (LOGGER_CONTENT.isInfoEnabled()) {
        PrismObject<SystemConfigurationType> cachedConfiguration = this.systemConfiguration;
        if (cachedConfiguration != null) {
            LOGGER_CONTENT.info("Cached system configuration: {} (version {}); systemConfigurationCheckTimestamp: {}", cachedConfiguration, cachedConfiguration.getVersion(), XmlTypeConverter.createXMLGregorianCalendar(systemConfigurationCheckTimestamp));
        } else {
            LOGGER_CONTENT.info("No cached system configuration");
        }
        ExpressionProfiles cachedProfiles = this.expressionProfiles;
        if (cachedProfiles != null) {
            cachedProfiles.getProfiles().forEach((k, v) -> LOGGER_CONTENT.info("Cached expression profile: {}: {}", k, v));
        }
    }
}
Also used : ExpressionProfiles(com.evolveum.midpoint.schema.expression.ExpressionProfiles)

Example 3 with ExpressionProfiles

use of com.evolveum.midpoint.schema.expression.ExpressionProfiles in project midpoint by Evolveum.

the class ExpressionProfileCompiler method compile.

public ExpressionProfiles compile(SystemConfigurationExpressionsType expressionsType) throws SchemaException {
    List<ExpressionPermissionProfile> permissionProfiles = compilePermissionProfiles(expressionsType.getPermissionProfile());
    ExpressionProfiles expressionProfiles = compileExpressionProfiles(expressionsType.getExpressionProfile(), permissionProfiles);
    return expressionProfiles;
}
Also used : ExpressionPermissionProfile(com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile) ExpressionProfiles(com.evolveum.midpoint.schema.expression.ExpressionProfiles)

Example 4 with ExpressionProfiles

use of com.evolveum.midpoint.schema.expression.ExpressionProfiles in project midpoint by Evolveum.

the class TestExpression method compileExpressionProfile.

protected ExpressionProfile compileExpressionProfile(String profileName) throws SchemaException, IOException {
    if (profileName == null) {
        return null;
    }
    PrismObject<SystemConfigurationType> systemConfig = PrismTestUtil.parseObject(getSystemConfigurationFile());
    SystemConfigurationExpressionsType expressions = systemConfig.asObjectable().getExpressions();
    if (expressions == null) {
        throw new SchemaException("No expressions in system config");
    }
    ExpressionProfileCompiler compiler = new ExpressionProfileCompiler();
    ExpressionProfiles profiles = compiler.compile(expressions);
    ExpressionProfile profile = profiles.getProfile(profileName);
    if (profile == null) {
        throw new SchemaException("Profile '" + profileName + "' not found in system config");
    }
    return profile;
}
Also used : ExpressionProfile(com.evolveum.midpoint.schema.expression.ExpressionProfile) ExpressionProfiles(com.evolveum.midpoint.schema.expression.ExpressionProfiles)

Aggregations

ExpressionProfiles (com.evolveum.midpoint.schema.expression.ExpressionProfiles)4 ExpressionProfileCompiler (com.evolveum.midpoint.model.common.expression.ExpressionProfileCompiler)1 ExpressionPermissionProfile (com.evolveum.midpoint.schema.expression.ExpressionPermissionProfile)1 ExpressionProfile (com.evolveum.midpoint.schema.expression.ExpressionProfile)1