use of org.ovirt.engine.core.common.businessentities.StorageDomainStatus in project ovirt-engine by oVirt.
the class StorageDomainCommandBase method checkStorageDomainStatus.
protected boolean checkStorageDomainStatus(Set<StorageDomainStatus> statuses) {
boolean valid = false;
StorageDomainStatus status = getStorageDomainStatus();
if (status != null) {
valid = statuses.contains(status);
}
if (!valid) {
if (status != null && status.isStorageDomainInProcess()) {
return failValidation(EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED);
}
addStorageDomainStatusIllegalMessage();
}
return valid;
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatus in project ovirt-engine by oVirt.
the class StorageDomainCommandBase method addStorageDomainStatusIllegalMessage.
protected void addStorageDomainStatusIllegalMessage() {
addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2);
StorageDomainStatus status = getStorageDomainStatus();
StorageDomainSharedStatus sharedStatus = getStorageDomainSharedStatus();
Object messageParameter = status;
if (status == StorageDomainStatus.Unknown && sharedStatus != null) {
// We got more informative information than "Unknown".
messageParameter = sharedStatus;
}
addValidationMessageVariable("status", messageParameter);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatus in project ovirt-engine by oVirt.
the class StorageDomainStaticDaoImpl method getAllIds.
@Override
public List<Guid> getAllIds(Guid pool, StorageDomainStatus status) {
MapSqlParameterSource parameterSource = getStoragePoolIdParameterSource(pool).addValue("status", status.getValue());
RowMapper<Guid> mapper = (rs, rowNum) -> getGuidDefaultEmpty(rs, "storage_id");
return getCallsHandler().executeReadList("GetStorageDomainIdsByStoragePoolIdAndStatus", mapper, parameterSource);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainStatus in project ovirt-engine by oVirt.
the class IsoDomainListSynchronizer method refreshIsoDomain.
/**
* The procedure Try to refresh the repository files of the storage domain id, By iterate over the storage pools of
* this domain, and try to choose a valid storage pool, to fetch the repository files from the VDSM, and refresh the
* cached table. <BR/>
* If succeeded, will return True. Otherwise return false with updated list of problematic repository files with the
* storage pool, storage domain, and file type, that could not complete the cache update transaction.
*
* @param storageDomainId
* - The Repository domain Id, we want to refresh.
* @param problematicRepoFileList
* - List of business entities, each one indicating the problematic entity.
* @param imageType
* - The imageType we want to fetch the files from the cache.
* @return Boolean value indicating if the refresh succeeded or not.
*/
private boolean refreshIsoDomain(Guid storageDomainId, List<RepoImage> problematicRepoFileList, ImageFileType imageType) {
List<StoragePoolIsoMap> isoMapList = fetchAllStoragePoolsForIsoDomain(storageDomainId, imageType);
for (StoragePoolIsoMap storagePoolIsoMap : isoMapList) {
Guid storagePoolId = storagePoolIsoMap.getStoragePoolId();
StorageDomainStatus status = storagePoolIsoMap.getStatus();
if (StorageDomainStatus.Active != status) {
handleInactiveStorageDomain(storageDomainId, imageType, status);
} else {
// Try to refresh the domain of the storage pool id because its status is active.
boolean refreshOk = refreshIsoDomainFileForStoragePool(storageDomainId, storagePoolId, imageType);
if (!refreshOk) {
log.debug("Failed refreshing Storage domain id '{}', for '{}' file type in storage pool id '{}'.", storageDomainId, imageType, storagePoolId);
// Add the repository file to the list of problematic Iso domains.
RepoImage repoImage = createMockRepositoryFileMetaData(storageDomainId, imageType, storagePoolId);
problematicRepoFileList.add(repoImage);
return false;
}
}
}
return true;
}
Aggregations