use of org.ovirt.engine.core.common.queries.GetImagesListParameters in project ovirt-engine by oVirt.
the class BackendOpenStackImagesResource method list.
@Override
public OpenStackImages list() {
Guid storageDomainId = BackendOpenStackStorageProviderHelper.getStorageDomainId(this, providerId);
GetImagesListParameters parameters = new GetImagesListParameters(storageDomainId, ImageFileType.All);
return mapCollection(getBackendCollection(QueryType.GetImagesList, parameters));
}
use of org.ovirt.engine.core.common.queries.GetImagesListParameters in project ovirt-engine by oVirt.
the class BackendFilesResource method listFiles.
protected List<String> listFiles() {
GetImagesListParameters queryParams = new GetImagesListParameters(asGuid(storageDomainId), ImageFileType.All);
Boolean forceRefresh = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, FORCE_REFRESH, null, null);
queryParams.setForceRefresh(forceRefresh);
List<RepoImage> files = getBackendCollection(RepoImage.class, QueryType.GetImagesList, queryParams);
return files.stream().map(RepoImage::getRepoImageId).collect(toList());
}
use of org.ovirt.engine.core.common.queries.GetImagesListParameters in project ovirt-engine by oVirt.
the class BackendStorageDomainImagesResource method list.
@Override
public Images list() {
GetImagesListParameters getImagesListParams = new GetImagesListParameters(storageDomainId, ImageFileType.All);
getImagesListParams.setForceRefresh(true);
return mapCollection(getBackendCollection(QueryType.GetImagesList, getImagesListParams));
}
use of org.ovirt.engine.core.common.queries.GetImagesListParameters in project ovirt-engine by oVirt.
the class StorageIsoListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
super.syncSearch();
StorageDomain storageDomain = getEntity();
boolean isDomainActive = storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active || storageDomain.getStorageDomainSharedStatus() == StorageDomainSharedStatus.Mixed;
if (storageDomain.getStorageDomainType() == StorageDomainType.ISO && !isDomainActive) {
setItems(Collections.emptyList());
return;
}
GetImagesListParameters imagesListParams = new GetImagesListParameters(storageDomain.getId(), ImageFileType.All);
imagesListParams.setForceRefresh(true);
imagesListParams.setRefresh(getIsQueryFirstTime());
startProgress();
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(returnValue -> {
stopProgress();
ArrayList<RepoImage> repoImageList = new ArrayList<>();
if (returnValue != null && returnValue.getReturnValue() != null && returnValue.getSucceeded()) {
repoImageList = returnValue.getReturnValue();
repoImageList.sort(Comparator.comparing(RepoImage::getRepoImageId));
}
setItems(repoImageList);
setIsEmpty(repoImageList.isEmpty());
});
asyncQuery.setHandleFailure(true);
Frontend.getInstance().runQuery(QueryType.GetImagesList, imagesListParams, asyncQuery);
}
Aggregations