use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class DataCenterNetworkQoSListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
IdQueryParameters parameters = new IdQueryParameters(getEntity().getId());
parameters.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetAllNetworkQosByStoragePoolId, parameters, new SetItemsAsyncQuery());
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class DataCenterQuotaListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
IdQueryParameters parameters = new IdQueryParameters(getEntity().getId());
parameters.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetQuotaByStoragePoolId, parameters, new SetItemsAsyncQuery());
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class GlusterVolumeGeoRepCreateModel method getEligibleVolumes.
public void getEligibleVolumes() {
this.startProgress(constants.fetchingDataMessage());
Frontend.getInstance().runQuery(QueryType.GetGlusterGeoReplicationEligibleVolumes, new IdQueryParameters(masterVolume.getId()), new AsyncQuery<QueryReturnValue>(returnValue -> showAvailableVolumes(returnValue)));
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class DiskVmListModel method syncSearch.
@Override
protected void syncSearch() {
Disk disk = getEntity();
if (disk == null) {
return;
}
IdQueryParameters getVmsByDiskGuidParameters = new IdQueryParameters(disk.getId());
getVmsByDiskGuidParameters.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetVmsByDiskGuid, getVmsByDiskGuidParameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
diskVmMap = returnValue.getReturnValue();
ArrayList<VM> vmList = new ArrayList<>();
ArrayList<VM> pluggedList = (ArrayList<VM>) diskVmMap.get(true);
ArrayList<VM> unPluggedList = (ArrayList<VM>) diskVmMap.get(false);
if (pluggedList != null) {
vmList.addAll(pluggedList);
}
if (unPluggedList != null) {
vmList.addAll(unPluggedList);
}
setItems(vmList);
}));
setIsQueryFirstTime(false);
}
use of org.ovirt.engine.core.common.queries.IdQueryParameters in project ovirt-engine by oVirt.
the class TaskListModel method updateSingleTask.
public boolean updateSingleTask(final String guidOrCorrelationId) {
if (!detailedTaskMap.containsKey(guidOrCorrelationId)) {
detailedTaskMap.put(guidOrCorrelationId, null);
if (guidOrCorrelationId.startsWith(WEBADMIN)) {
GetJobsByCorrelationIdQueryParameters parameters = new GetJobsByCorrelationIdQueryParameters();
parameters.setCorrelationId(guidOrCorrelationId);
Frontend.getInstance().runQuery(QueryType.GetJobsByCorrelationId, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
ArrayList<Job> retTasks = returnValue.getReturnValue();
ArrayList<Job> taskList = (ArrayList<Job>) getItems();
ArrayList<Job> newTaskList = new ArrayList<>();
for (Job task : taskList) {
if (task.getCorrelationId().equals(guidOrCorrelationId)) {
detailedTaskMap.put(guidOrCorrelationId, task);
task.setStatus(JobExecutionStatus.FINISHED);
for (Job job : retTasks) {
Step step = new Step();
step.setId(job.getId());
step.setDescription(job.getDescription());
step.setCorrelationId(job.getCorrelationId());
step.setStartTime(job.getStartTime());
step.setEndTime(job.getEndTime());
step.setStatus(job.getStatus());
step.setSteps(job.getSteps());
if (!task.getStatus().equals(JobExecutionStatus.FINISHED) && !job.getStatus().equals(JobExecutionStatus.FINISHED)) {
task.setStatus(job.getStatus());
}
if (task.getLastUpdateTime() == null || (task.getLastUpdateTime().before(job.getLastUpdateTime()) && !task.getLastUpdateTime().equals(job.getLastUpdateTime()))) {
task.setLastUpdateTime(job.getEndTime());
}
Date tempDate = task.getLastUpdateTime();
if (task.getStartTime() == null || task.getStartTime().after(job.getStartTime())) {
task.setStartTime(job.getStartTime());
}
if (task.getEndTime() != null && (task.getEndTime() == null || task.getEndTime().before(job.getEndTime()))) {
task.setEndTime(job.getEndTime());
}
task.addStep(step);
task.setLastUpdateTime(tempDate);
}
}
newTaskList.add(task);
}
setItems(newTaskList);
}));
} else {
IdQueryParameters parameters = new IdQueryParameters(new Guid(guidOrCorrelationId));
Frontend.getInstance().runQuery(QueryType.GetJobByJobId, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
Job retTask = returnValue.getReturnValue();
if (retTask == null) {
return;
}
detailedTaskMap.put(retTask.getId().toString(), retTask);
ArrayList<Job> taskList = (ArrayList<Job>) getItems();
ArrayList<Job> newTaskList = new ArrayList<>();
for (Job task : taskList) {
if (task.getId().equals(retTask.getId())) {
newTaskList.add(retTask);
} else {
newTaskList.add(task);
}
}
setItems(newTaskList);
}));
}
return false;
}
return true;
}
Aggregations