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;
}
Aggregations