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);
}
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));
}
}
}
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;
}
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;
}
Aggregations