use of org.apache.nifi.redis.RedisType in project nifi by apache.
the class RedisStateProvider method customValidate.
@Override
protected Collection<ValidationResult> customValidate(ValidationContext validationContext) {
final List<ValidationResult> results = new ArrayList<>(RedisUtils.validate(validationContext));
final RedisType redisType = RedisType.fromDisplayName(validationContext.getProperty(RedisUtils.REDIS_MODE).getValue());
if (redisType != null && redisType == RedisType.CLUSTER) {
results.add(new ValidationResult.Builder().subject(RedisUtils.REDIS_MODE.getDisplayName()).valid(false).explanation(RedisUtils.REDIS_MODE.getDisplayName() + " is configured in clustered mode, and this service requires a non-clustered Redis").build());
}
return results;
}
use of org.apache.nifi.redis.RedisType in project nifi by apache.
the class RedisDistributedMapCacheClientService method customValidate.
@Override
protected Collection<ValidationResult> customValidate(ValidationContext validationContext) {
final List<ValidationResult> results = new ArrayList<>();
final RedisConnectionPool redisConnectionPool = validationContext.getProperty(REDIS_CONNECTION_POOL).asControllerService(RedisConnectionPool.class);
if (redisConnectionPool != null) {
final RedisType redisType = redisConnectionPool.getRedisType();
if (redisType != null && redisType == RedisType.CLUSTER) {
results.add(new ValidationResult.Builder().subject(REDIS_CONNECTION_POOL.getDisplayName()).valid(false).explanation(REDIS_CONNECTION_POOL.getDisplayName() + " is configured in clustered mode, and this service requires a non-clustered Redis").build());
}
}
return results;
}
Aggregations