Search in sources :

Example 11 with VDSStatus

use of org.ovirt.engine.core.common.businessentities.VDSStatus in project ovirt-engine by oVirt.

the class VdsHandler method init.

/**
 * Initialize list containers, for identity and permission check. The initialization should be executed
 * before calling ObjectIdentityChecker.
 *
 * @see Backend#initHandlers
 */
@PostConstruct
public void init() {
    Class<?>[] inspectedClasses = new Class<?>[] { VDS.class, VdsStatic.class, VdsDynamic.class };
    updateVdsStatic = new ObjectIdentityChecker(VdsHandler.class, Arrays.asList(inspectedClasses));
    updateVdsStatic.setContainer(this);
    for (Pair<EditableVdsField, Field> pair : extractAnnotatedFields(EditableVdsField.class, inspectedClasses)) {
        List<VDSStatus> statusList = Arrays.asList(pair.getFirst().onStatuses());
        String fieldName = pair.getSecond().getName();
        if (statusList.isEmpty()) {
            updateVdsStatic.addPermittedFields(fieldName);
        } else {
            updateVdsStatic.addField(statusList, fieldName);
        }
    }
}
Also used : VdsStatic(org.ovirt.engine.core.common.businessentities.VdsStatic) VDS(org.ovirt.engine.core.common.businessentities.VDS) EditableVdsField(org.ovirt.engine.core.common.businessentities.EditableVdsField) Field(java.lang.reflect.Field) EditableVdsField(org.ovirt.engine.core.common.businessentities.EditableVdsField) VDSStatus(org.ovirt.engine.core.common.businessentities.VDSStatus) VdsDynamic(org.ovirt.engine.core.common.businessentities.VdsDynamic) ObjectIdentityChecker(org.ovirt.engine.core.utils.ObjectIdentityChecker) PostConstruct(javax.annotation.PostConstruct)

Aggregations

VDSStatus (org.ovirt.engine.core.common.businessentities.VDSStatus)11 VDS (org.ovirt.engine.core.common.businessentities.VDS)3 ImageResource (com.google.gwt.resources.client.ImageResource)1 SafeHtml (com.google.gwt.safehtml.shared.SafeHtml)1 Field (java.lang.reflect.Field)1 PostConstruct (javax.annotation.PostConstruct)1 Test (org.junit.Test)1 ValidationResult (org.ovirt.engine.core.bll.ValidationResult)1 FenceVdsActionParameters (org.ovirt.engine.core.common.action.FenceVdsActionParameters)1 MaintenanceNumberOfVdssParameters (org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters)1 VdsActionParameters (org.ovirt.engine.core.common.action.VdsActionParameters)1 VdsPowerDownParameters (org.ovirt.engine.core.common.action.VdsPowerDownParameters)1 EditableVdsField (org.ovirt.engine.core.common.businessentities.EditableVdsField)1 NonOperationalReason (org.ovirt.engine.core.common.businessentities.NonOperationalReason)1 VdsDynamic (org.ovirt.engine.core.common.businessentities.VdsDynamic)1 VdsStatic (org.ovirt.engine.core.common.businessentities.VdsStatic)1 FenceOperationResult (org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult)1 EngineException (org.ovirt.engine.core.common.errors.EngineException)1 Guid (org.ovirt.engine.core.compat.Guid)1 AuditLogable (org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable)1