Search in sources :

Example 16 with StringPolicyType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.StringPolicyType in project midpoint by Evolveum.

the class ValuePolicyProcessor method checkAttempt.

private <O extends ObjectType> boolean checkAttempt(String generatedValue, StringPolicyType policy, PrismObject<O> object, String shortDesc, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException {
    LimitationsType limitationsType = policy.getLimitations();
    if (limitationsType == null) {
        return true;
    }
    List<CheckExpressionType> checkExpressionTypes = limitationsType.getCheckExpression();
    if (!checkExpressions(generatedValue, checkExpressionTypes, object, shortDesc, task, result)) {
        LOGGER.trace("Check expression returned false for generated value in {}", shortDesc);
        return false;
    }
    // TODO Check pattern
    return true;
}
Also used : CheckExpressionType(com.evolveum.midpoint.xml.ns._public.common.common_3.CheckExpressionType) LimitationsType(com.evolveum.midpoint.xml.ns._public.common.common_3.LimitationsType)

Aggregations

StringPolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.StringPolicyType)8 ValuePolicyType (com.evolveum.midpoint.xml.ns._public.common.common_3.ValuePolicyType)8 PrismPropertyValue (com.evolveum.midpoint.prism.PrismPropertyValue)7 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)7 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)7 PrismPropertyDefinition (com.evolveum.midpoint.prism.PrismPropertyDefinition)6 StringPolicyResolver (com.evolveum.midpoint.repo.common.expression.StringPolicyResolver)6 File (java.io.File)6 ItemDefinition (com.evolveum.midpoint.prism.ItemDefinition)5 PrismObject (com.evolveum.midpoint.prism.PrismObject)3 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)3 ObjectDeltaObject (com.evolveum.midpoint.repo.common.expression.ObjectDeltaObject)3 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)3 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)3 MappingType (com.evolveum.midpoint.xml.ns._public.common.common_3.MappingType)3 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)3 Test (org.testng.annotations.Test)3 AbstractInternalModelIntegrationTest (com.evolveum.midpoint.model.impl.AbstractInternalModelIntegrationTest)2 PrismProperty (com.evolveum.midpoint.prism.PrismProperty)2 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)2