Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Add functionality to rAPP Catalogue
[nonrtric.git]
/
enrichment-coordinator-service
/
src
/
main
/
java
/
org
/
oransc
/
enrichment
/
repository
/
EiJobs.java
diff --git
a/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJobs.java
b/enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJobs.java
index
9326195
..
f0e4051
100644
(file)
--- a/
enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJobs.java
+++ b/
enrichment-coordinator-service/src/main/java/org/oransc/enrichment/repository/EiJobs.java
@@
-28,16
+28,18
@@
import java.util.Vector;
import org.oransc.enrichment.exceptions.ServiceException;
/**
import org.oransc.enrichment.exceptions.ServiceException;
/**
- * Dynamic representation of all
EI Jobs in the system
.
+ * Dynamic representation of all
existing EI jobs
.
*/
public class EiJobs {
private Map<String, EiJob> allEiJobs = new HashMap<>();
private MultiMap<EiJob> jobsByType = new MultiMap<>();
*/
public class EiJobs {
private Map<String, EiJob> allEiJobs = new HashMap<>();
private MultiMap<EiJob> jobsByType = new MultiMap<>();
+ private MultiMap<EiJob> jobsByOwner = new MultiMap<>();
public synchronized void put(EiJob job) {
allEiJobs.put(job.id(), job);
jobsByType.put(job.type().getId(), job.id(), job);
public synchronized void put(EiJob job) {
allEiJobs.put(job.id(), job);
jobsByType.put(job.type().getId(), job.id(), job);
+ jobsByOwner.put(job.owner(), job.id(), job);
}
public synchronized Collection<EiJob> getJobs() {
}
public synchronized Collection<EiJob> getJobs() {
@@
-47,7
+49,7
@@
public class EiJobs {
public synchronized EiJob getJob(String id) throws ServiceException {
EiJob ric = allEiJobs.get(id);
if (ric == null) {
public synchronized EiJob getJob(String id) throws ServiceException {
EiJob ric = allEiJobs.get(id);
if (ric == null) {
- throw new ServiceException("Could not find EI
J
ob: " + id);
+ throw new ServiceException("Could not find EI
j
ob: " + id);
}
return ric;
}
}
return ric;
}
@@
-60,6
+62,10
@@
public class EiJobs {
return jobsByType.get(type.getId());
}
return jobsByType.get(type.getId());
}
+ public synchronized Collection<EiJob> getJobsForOwner(String owner) {
+ return jobsByOwner.get(owner);
+ }
+
public synchronized EiJob get(String id) {
return allEiJobs.get(id);
}
public synchronized EiJob get(String id) {
return allEiJobs.get(id);
}
@@
-75,6
+81,7
@@
public class EiJobs {
public synchronized void remove(EiJob job) {
this.allEiJobs.remove(job.id());
jobsByType.remove(job.type().getId(), job.id());
public synchronized void remove(EiJob job) {
this.allEiJobs.remove(job.id());
jobsByType.remove(job.type().getId(), job.id());
+ jobsByOwner.remove(job.owner(), job.id());
}
public synchronized int size() {
}
public synchronized int size() {
@@
-84,6
+91,7
@@
public class EiJobs {
public synchronized void clear() {
this.allEiJobs.clear();
this.jobsByType.clear();
public synchronized void clear() {
this.allEiJobs.clear();
this.jobsByType.clear();
+ jobsByOwner.clear();
}
}
}
}