package org.ovirt.engine.core.bll.storage.repoimage;

import java.util.List;

import org.ovirt.engine.core.bll.QueriesCommandBase;
import org.ovirt.engine.core.bll.storage.domain.IsoDomainListSyncronizer;
import org.ovirt.engine.core.common.businessentities.storage.RepoImage;
import org.ovirt.engine.core.common.queries.GetImagesListParametersBase;
import org.ovirt.engine.core.compat.Guid;


public abstract class GetImagesListQueryBase<P extends GetImagesListParametersBase> extends QueriesCommandBase<P> {

    public GetImagesListQueryBase(P parameters) {
        super(parameters);
    }

    @Override
    protected void executeQueryCommand() {
        // Fetch all the Iso files of a given type for storage pool with active storage domain of this domain Id.
        getQueryReturnValue().setReturnValue(getUserRequestForStorageDomainRepoFileList());
    }

    /**
     * @return The storage domain to get the images from
     */
    protected abstract Guid getStorageDomainIdForQuery();

    protected List<RepoImage> getUserRequestForStorageDomainRepoFileList() {
        return IsoDomainListSyncronizer.getInstance().getUserRequestForStorageDomainRepoFileList
                (getStorageDomainIdForQuery(), getParameters().getImageType(), getParameters().getForceRefresh());
    }
}

@@ -47,16 +47,44 @@
 image;%0A%0A
+import java.util.ArrayList;%0A
 import j
@@ -1091,24 +1091,184 @@
 ileList() %7B%0A
+        Guid storageDomainId = getStorageDomainIdForQuery();%0A        if (Guid.Empty.equals(storageDomainId)) %7B%0A            return new ArrayList%3C%3E();%0A        %7D%0A%0A
         retu
@@ -1369,20 +1369,17 @@
        (
-getS
+s
 torageDo
@@ -1384,26 +1384,16 @@
 DomainId
-ForQuery()
 , getPar

Fix ISO Domain List refresh NPE