Search in sources :

Example 1 with ValidationResult

use of org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.validation.ValidationResult in project opennms by OpenNMS.

the class MBeansController method validate.

private ValidationResult validate() {
    ValidationResult result = validationManager.validate(mbeansContainer);
    updateValidState(result);
    return result;
}
Also used : ValidationResult(org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.validation.ValidationResult)

Example 2 with ValidationResult

use of org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.validation.ValidationResult in project opennms by OpenNMS.

the class MBeansController method updateValidState.

private void updateValidState(final ValidationResult result) {
    Collection<ValidationResult.ValidationError> validationErrors = result.getValidationErrors(Mbean.class);
    for (ValidationResult.ValidationError eachError : validationErrors) {
        updateValidState(eachError.getErrorObject(), false);
    }
    validationErrors = result.getValidationErrors(Attrib.class);
    for (ValidationResult.ValidationError eachError : validationErrors) {
        Mbean parent = (Mbean) attributesContainerCacheMap.get(Attrib.class).getParentFor(eachError.getErrorObject());
        updateValidState(parent, false);
    }
    validationErrors = result.getValidationErrors(CompMember.class);
    for (ValidationResult.ValidationError eachError : validationErrors) {
        CompAttrib parent = (CompAttrib) attributesContainerCacheMap.get(CompMember.class).getParentFor(eachError.getErrorObject());
        updateValidState(parent, false);
    }
    mbeansTree.markAsDirtyRecursive();
}
Also used : Mbean(org.opennms.xmlns.xsd.config.jmx_datacollection.Mbean) CompAttrib(org.opennms.xmlns.xsd.config.jmx_datacollection.CompAttrib) ValidationResult(org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.validation.ValidationResult) CompAttrib(org.opennms.xmlns.xsd.config.jmx_datacollection.CompAttrib) Attrib(org.opennms.xmlns.xsd.config.jmx_datacollection.Attrib) CompMember(org.opennms.xmlns.xsd.config.jmx_datacollection.CompMember)

Aggregations

ValidationResult (org.opennms.features.vaadin.jmxconfiggenerator.ui.mbeans.validation.ValidationResult)2 Attrib (org.opennms.xmlns.xsd.config.jmx_datacollection.Attrib)1 CompAttrib (org.opennms.xmlns.xsd.config.jmx_datacollection.CompAttrib)1 CompMember (org.opennms.xmlns.xsd.config.jmx_datacollection.CompMember)1 Mbean (org.opennms.xmlns.xsd.config.jmx_datacollection.Mbean)1