private <O extends ObjectType> boolean checkAttempt(String generatedValue, ValuePolicyType policy, AbstractValuePolicyOriginResolver<O> originResolver, String shortDesc, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, ExpressionEvaluationException, CommunicationException, ConfigurationException, SecurityViolationException {
StringPolicyType stringPolicy = policy.getStringPolicy();
if (stringPolicy != null) {
LimitationsType limitationsType = stringPolicy.getLimitations();
if (limitationsType != null) {
List<CheckExpressionType> checkExpressionTypes = limitationsType.getCheckExpression();
if (!checkExpressions(generatedValue, checkExpressionTypes, originResolver, shortDesc, task, result)) {
LOGGER.trace("Check expression returned false for generated value in {}", shortDesc);
return false;
}
}
}
if (!checkProhibitedValues(generatedValue, policy.getProhibitedValues(), originResolver, null, shortDesc, task, result)) {
LOGGER.trace("Generated value is prohibited in {}", shortDesc);
return false;
}
return true;
}