Code Review
/
nonrtric.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Removed support for the non used A1 1.0 standard
[nonrtric.git]
/
policy-agent
/
src
/
main
/
java
/
org
/
oransc
/
policyagent
/
repository
/
Services.java
diff --git
a/policy-agent/src/main/java/org/oransc/policyagent/repository/Services.java
b/policy-agent/src/main/java/org/oransc/policyagent/repository/Services.java
index
01d6a7a
..
f6c55dc
100644
(file)
--- a/
policy-agent/src/main/java/org/oransc/policyagent/repository/Services.java
+++ b/
policy-agent/src/main/java/org/oransc/policyagent/repository/Services.java
@@
-20,6
+20,7
@@
package org.oransc.policyagent.repository;
package org.oransc.policyagent.repository;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.HashMap;
import java.util.Map;
@@
-30,13
+31,10
@@
import org.slf4j.LoggerFactory;
public class Services {
private static final Logger logger = LoggerFactory.getLogger(Services.class);
public class Services {
private static final Logger logger = LoggerFactory.getLogger(Services.class);
- private Map<String, Service> services = new HashMap<>();
-
- public Services() {
- }
+ private Map<String, Service> registeredServices = new HashMap<>();
public synchronized Service getService(String name) throws ServiceException {
public synchronized Service getService(String name) throws ServiceException {
- Service s =
s
ervices.get(name);
+ Service s =
registeredS
ervices.get(name);
if (s == null) {
throw new ServiceException("Could not find service: " + name);
}
if (s == null) {
throw new ServiceException("Could not find service: " + name);
}
@@
-44,24
+42,27
@@
public class Services {
}
public synchronized Service get(String name) {
}
public synchronized Service get(String name) {
- return
s
ervices.get(name);
+ return
registeredS
ervices.get(name);
}
public synchronized void put(Service service) {
}
public synchronized void put(Service service) {
- logger.debug("Put service:
" + service.n
ame());
-
services.put(service.n
ame(), service);
+ logger.debug("Put service:
{}", service.getN
ame());
+
registeredServices.put(service.getN
ame(), service);
}
public synchronized Iterable<Service> getAll() {
}
public synchronized Iterable<Service> getAll() {
- return
services.values(
);
+ return
Collections.unmodifiableCollection(registeredServices.values()
);
}
public synchronized void remove(String name) {
}
public synchronized void remove(String name) {
-
s
ervices.remove(name);
+
registeredS
ervices.remove(name);
}
public synchronized int size() {
}
public synchronized int size() {
- return
s
ervices.size();
+ return
registeredS
ervices.size();
}
}
+ public void clear() {
+ registeredServices.clear();
+ }
}
}