Search in sources :

Example 1 with HasStoragePoolValidator

use of org.ovirt.engine.core.bll.validator.HasStoragePoolValidator in project ovirt-engine by oVirt.

the class UpdateNetworkCommand method validate.

@Override
protected boolean validate() {
    if (onlyPermittedFieldsChanged() && allowedNetworkLabelManipulation()) {
        return true;
    }
    final HasStoragePoolValidator hasStoragePoolValidator = new HasStoragePoolValidator(getNetwork());
    final NetworkValidator validatorNew = new NetworkValidator(vmDao, getNetwork());
    final UpdateNetworkValidator validatorOld = new UpdateNetworkValidator(getOldNetwork(), vmDao, interfaceDao);
    return validate(hasStoragePoolValidator.storagePoolExists()) && validate(validatorNew.stpForVmNetworkOnly()) && validate(validatorNew.mtuValid()) && validate(validatorNew.networkPrefixValid()) && validate(validatorNew.qosExistsInDc()) && validate(validatorOld.networkIsSet(getNetwork().getId())) && validate(validatorOld.notChangingDataCenterId(getNetwork().getDataCenterId())) && validate(validatorNew.networkNameNotUsed()) && validate(validatorNew.networkNameNotUsedAsVdsmName()) && validate(validatorOld.nonVmNetworkNotUsedByVms(getNetwork())) && validate(validatorOld.nonVmNetworkNotUsedByTemplates(getNetwork())) && validate(validatorOld.notRenamingUsedNetwork(getNetworkName())) && validate(validatorOld.notRenamingLabel(getNetwork().getLabel())) && (oldAndNewNetworkIsNotExternal() || validate(validatorOld.externalNetworkDetailsUnchanged(getNetwork())));
}
Also used : NetworkValidator(org.ovirt.engine.core.bll.validator.NetworkValidator) HasStoragePoolValidator(org.ovirt.engine.core.bll.validator.HasStoragePoolValidator)

Example 2 with HasStoragePoolValidator

use of org.ovirt.engine.core.bll.validator.HasStoragePoolValidator in project ovirt-engine by oVirt.

the class AddClusterCommand method validate.

@Override
protected boolean validate() {
    HasStoragePoolValidator hspValidator = new HasStoragePoolValidator(getCluster());
    final ClusterValidator validator = new ClusterValidator(dbFacade, getCluster(), getCpuFlagsManagerHandler());
    return validate(validator.nameNotUsed()) && validate(validator.cpuTypeSupportsVirtService()) && validate(validator.versionSupported()) && validate(validator.dataCenterVersionMismatch()) && validate(hspValidator.storagePoolExists()) && validate(validator.localStoragePoolAttachedToSingleCluster()) && validate(validator.clusterServiceDefined()) && validate(validator.mixedClusterServicesSupported()) && validate(validator.attestationServerConfigured()) && validate(validator.migrationSupported(getArchitecture())) && validate(validator.rngSourcesAllowed()) && validateClusterPolicy(null) && validateManagementNetwork() && validate(validator.memoryOptimizationConfiguration()) && validateDefaultNetworkProvider() && validate(validator.supportedFirewallTypeForClusterVersion());
}
Also used : ClusterValidator(org.ovirt.engine.core.bll.validator.ClusterValidator) HasStoragePoolValidator(org.ovirt.engine.core.bll.validator.HasStoragePoolValidator)

Example 3 with HasStoragePoolValidator

use of org.ovirt.engine.core.bll.validator.HasStoragePoolValidator in project ovirt-engine by oVirt.

the class AddNetworkCommand method validate.

@Override
protected boolean validate() {
    HasStoragePoolValidator hasStoragePoolValidator = new HasStoragePoolValidator(getNetwork());
    AddNetworkValidator validator = getNetworkValidator();
    return validate(hasStoragePoolValidator.storagePoolExists()) && validate(validator.stpForVmNetworkOnly()) && validate(validator.mtuValid()) && validate(validator.networkPrefixValid()) && validate(validator.networkNameNotUsed()) && validate(validator.networkNameNotUsedAsVdsmName()) && validate(validator.qosExistsInDc()) && (!getNetwork().isExternal() || externalNetworkValid(validator));
}
Also used : HasStoragePoolValidator(org.ovirt.engine.core.bll.validator.HasStoragePoolValidator)

Aggregations

HasStoragePoolValidator (org.ovirt.engine.core.bll.validator.HasStoragePoolValidator)3 ClusterValidator (org.ovirt.engine.core.bll.validator.ClusterValidator)1 NetworkValidator (org.ovirt.engine.core.bll.validator.NetworkValidator)1