blob: b6cbd83e5a78087eed04473f53f4c171b31292ab [file] [log] [blame]
package org.eclipse.osee.ote.rest.internal;
import java.util.Collection;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import org.eclipse.osee.ote.rest.model.OTEJobStatus;
public class OteJobStoreImpl implements OteJobStore {
ConcurrentHashMap<String, OteJob> jobs;
public OteJobStoreImpl(){
jobs = new ConcurrentHashMap<>();
}
@Override
public OTEJobStatus get(String uuid) throws InterruptedException, ExecutionException {
OteJob job = jobs.get(uuid);
if(job != null){
return job.getStatus();
}
return null;
}
@Override
public Collection<String> getAll() {
return jobs.keySet();
}
@Override
public void add(OteJob job) {
jobs.put(job.getId(), job);
}
}