use of org.ovirt.engine.core.common.queries.GetErrataCountsParameters in project ovirt-engine by oVirt.
the class BackendEngineKatelloErrataResource method list.
@Override
public KatelloErrata list() {
ErrataData errataData = null;
try {
QueryReturnValue returnValue = runQuery(QueryType.GetErrataForEngine, new GetErrataCountsParameters());
if (!returnValue.getSucceeded()) {
backendFailure(returnValue.getExceptionString());
}
errataData = returnValue.getReturnValue();
} catch (Exception e) {
handleError(e, false);
}
if (errataData == null) {
return new KatelloErrata();
}
return mapCollection(errataData.getErrata());
}
use of org.ovirt.engine.core.common.queries.GetErrataCountsParameters in project ovirt-engine by oVirt.
the class BackendVmKatelloErrataResource method list.
@Override
public KatelloErrata list() {
ErrataData errataData = null;
try {
QueryReturnValue returnValue = runQuery(QueryType.GetErrataForVm, new GetErrataCountsParameters(asGuid(vmId)));
if (!returnValue.getSucceeded()) {
backendFailure(returnValue.getExceptionString());
}
errataData = returnValue.getReturnValue();
} catch (Exception e) {
handleError(e, false);
}
if (errataData == null) {
return new KatelloErrata();
}
return mapCollection(errataData.getErrata());
}
use of org.ovirt.engine.core.common.queries.GetErrataCountsParameters in project ovirt-engine by oVirt.
the class AbstractErrataCountModel method runQuery.
public void runQuery(Guid guid) {
// $NON-NLS-1$
startProgress("getCount");
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(returnValue -> {
stopProgress();
ErrataCounts resultEntity = returnValue.getReturnValue();
// Set message to null to make sure the actual setMessage creates an event.
setMessage(null);
if (resultEntity != null && returnValue.getSucceeded()) {
setErrataCounts(resultEntity);
} else {
setMessage(// $NON-NLS-1$
constants.katelloProblemRetrievingErrata() + " " + returnValue.getExceptionMessage());
}
});
asyncQuery.setHandleFailure(true);
Frontend.getInstance().runQuery(getQueryType(), new GetErrataCountsParameters(guid), asyncQuery);
}
use of org.ovirt.engine.core.common.queries.GetErrataCountsParameters in project ovirt-engine by oVirt.
the class AbstractErrataListModel method runQuery.
private void runQuery(Guid guid) {
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(returnValue -> {
if (returnValue.getSucceeded()) {
ErrataData errataData = returnValue.getReturnValue();
unfilteredResultList = errataData.getErrata();
// manual client-side filter
// TODO: Use filtering and pagination options by GetErrataCountsParameters.setErrataFilter(filter)
setItems(filter(unfilteredResultList));
} else {
// $NON-NLS-1$
setMessage(constants.katelloProblemRetrievingErrata() + " " + returnValue.getExceptionMessage());
}
});
asyncQuery.setHandleFailure(true);
Frontend.getInstance().runQuery(getQueryType(), new GetErrataCountsParameters(guid), asyncQuery);
}
use of org.ovirt.engine.core.common.queries.GetErrataCountsParameters in project ovirt-engine by oVirt.
the class BackendHostKatelloErrataResource method list.
@Override
public KatelloErrata list() {
ErrataData errataData = null;
try {
QueryReturnValue returnValue = runQuery(QueryType.GetErrataForHost, new GetErrataCountsParameters(asGuid(hostId)));
if (!returnValue.getSucceeded()) {
backendFailure(returnValue.getExceptionString());
}
errataData = returnValue.getReturnValue();
} catch (Exception e) {
handleError(e, false);
}
if (errataData == null) {
return new KatelloErrata();
}
return mapCollection(errataData.getErrata());
}
Aggregations