Search in sources :

Example 1 with ValidationVisitor

use of io.strimzi.operator.common.model.ValidationVisitor in project strimzi by strimzi.

the class AbstractConnectOperator method validate.

public Set<Condition> validate(Reconciliation reconciliation, KafkaConnector resource) {
    if (resource != null) {
        Set<Condition> warningConditions = new LinkedHashSet<>(0);
        ResourceVisitor.visit(reconciliation, resource, new ValidationVisitor(resource, LOGGER, warningConditions));
        return warningConditions;
    }
    return Collections.emptySet();
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) LinkedHashSet(java.util.LinkedHashSet) ValidationVisitor(io.strimzi.operator.common.model.ValidationVisitor)

Example 2 with ValidationVisitor

use of io.strimzi.operator.common.model.ValidationVisitor in project strimzi-kafka-operator by strimzi.

the class AbstractConnectOperator method validate.

public Set<Condition> validate(Reconciliation reconciliation, KafkaConnector resource) {
    if (resource != null) {
        Set<Condition> warningConditions = new LinkedHashSet<>(0);
        ResourceVisitor.visit(reconciliation, resource, new ValidationVisitor(resource, LOGGER, warningConditions));
        return warningConditions;
    }
    return Collections.emptySet();
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) LinkedHashSet(java.util.LinkedHashSet) ValidationVisitor(io.strimzi.operator.common.model.ValidationVisitor)

Example 3 with ValidationVisitor

use of io.strimzi.operator.common.model.ValidationVisitor in project strimzi by strimzi.

the class AbstractOperator method validate.

/**
 * Validate the Custom Resource.
 * This should log at the WARN level (rather than throwing)
 * if the resource can safely be reconciled (e.g. it merely using deprecated API).
 * @param reconciliation The reconciliation
 * @param resource The custom resource
 * @throws InvalidResourceException if the resource cannot be safely reconciled.
 * @return set of conditions
 */
/*test*/
public Set<Condition> validate(Reconciliation reconciliation, T resource) {
    if (resource != null) {
        Set<Condition> warningConditions = new LinkedHashSet<>(0);
        ResourceVisitor.visit(reconciliation, resource, new ValidationVisitor(resource, LOGGER, warningConditions));
        return warningConditions;
    }
    return Collections.emptySet();
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) LinkedHashSet(java.util.LinkedHashSet) ValidationVisitor(io.strimzi.operator.common.model.ValidationVisitor)

Example 4 with ValidationVisitor

use of io.strimzi.operator.common.model.ValidationVisitor in project strimzi-kafka-operator by strimzi.

the class AbstractOperator method validate.

/**
 * Validate the Custom Resource.
 * This should log at the WARN level (rather than throwing)
 * if the resource can safely be reconciled (e.g. it merely using deprecated API).
 * @param reconciliation The reconciliation
 * @param resource The custom resource
 * @throws InvalidResourceException if the resource cannot be safely reconciled.
 * @return set of conditions
 */
/*test*/
public Set<Condition> validate(Reconciliation reconciliation, T resource) {
    if (resource != null) {
        Set<Condition> warningConditions = new LinkedHashSet<>(0);
        ResourceVisitor.visit(reconciliation, resource, new ValidationVisitor(resource, LOGGER, warningConditions));
        return warningConditions;
    }
    return Collections.emptySet();
}
Also used : Condition(io.strimzi.api.kafka.model.status.Condition) LinkedHashSet(java.util.LinkedHashSet) ValidationVisitor(io.strimzi.operator.common.model.ValidationVisitor)

Aggregations

Condition (io.strimzi.api.kafka.model.status.Condition)4 ValidationVisitor (io.strimzi.operator.common.model.ValidationVisitor)4 LinkedHashSet (java.util.LinkedHashSet)4