Search in sources :

Example 1 with SANState

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

the class GetUnregisteredBlockStorageDomainsQuery method getStorageDomainById.

/**
 * Retrieve a storage domain using a specified storage domain ID.
 *
 * @param storageDomainId the domain's ID
 * @return the storage domain
 */
@SuppressWarnings("unchecked")
protected StorageDomain getStorageDomainById(Guid storageDomainId) {
    VDSReturnValue returnValue;
    try {
        returnValue = executeHSMGetStorageDomainInfo(new HSMGetStorageDomainInfoVDSCommandParameters(getParameters().getVdsId(), storageDomainId));
    } catch (RuntimeException e) {
        log.error("Could not get info for storage domain ID: '{}': {}", storageDomainId, e.getMessage());
        log.debug("Exception", e);
        return null;
    }
    Pair<StorageDomainStatic, SANState> result = (Pair<StorageDomainStatic, SANState>) returnValue.getReturnValue();
    StorageDomainStatic storageDomainStatic = result.getFirst();
    storageDomainStatic.setStorageType(getParameters().getStorageType());
    StorageDomain storageDomain = new StorageDomain();
    storageDomain.setStorageStaticData(storageDomainStatic);
    return storageDomain;
}
Also used : StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HSMGetStorageDomainInfoVDSCommandParameters(org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters) SANState(org.ovirt.engine.core.common.businessentities.SANState) VDSReturnValue(org.ovirt.engine.core.common.vdscommands.VDSReturnValue) Pair(org.ovirt.engine.core.common.utils.Pair)

Aggregations

SANState (org.ovirt.engine.core.common.businessentities.SANState)1 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)1 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)1 Pair (org.ovirt.engine.core.common.utils.Pair)1 HSMGetStorageDomainInfoVDSCommandParameters (org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters)1 VDSReturnValue (org.ovirt.engine.core.common.vdscommands.VDSReturnValue)1