List<JobRepositoryRestore> jobs = new ArrayList<JobRepositoryRestore>();
for (int i = restoreJobs.size() - 1; i >= 0; i--)
{
JobRepositoryRestore job = restoreJobs.get(i);
boolean isUnique = true;
for (JobRepositoryRestore unJob : jobs)
{
if (unJob.getRepositoryName().equals(job.getRepositoryName()))
isUnique = false;
}
if (isUnique)
jobs.add(job);
}
List<ShortInfo> list = new ArrayList<ShortInfo>();
for (JobRepositoryRestore job : jobs)
{
ShortInfo info =
new ShortInfo(ShortInfo.RESTORE, job.getRepositoryBackupChainLog(), job.getStartTime(),
job.getEndTime(), job.getStateRestore(), job.getRepositoryName());
list.add(info);
}
return Response.ok(new ShortInfoList(list)).cacheControl(noCache).build();