summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java5
-rw-r--r--feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java2
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java8
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java16
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java4
5 files changed, 19 insertions, 16 deletions
diff --git a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java
index 5cbcf555..cc6f02e0 100644
--- a/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java
+++ b/feature-healthcheck/src/main/java/org/onap/policy/drools/healthcheck/HealthCheck.java
@@ -144,6 +144,7 @@ class HealthCheckMonitor implements HealthCheck {
/**
* {@inheritDoc}
*/
+ @Override
public Reports healthCheck() {
Reports reports = new Reports();
reports.healthy = PolicyEngine.manager.isAlive();
@@ -152,8 +153,8 @@ class HealthCheckMonitor implements HealthCheck {
engineReport.healthy = PolicyEngine.manager.isAlive();
engineReport.name = "PDP-D";
engineReport.url = "self";
- engineReport.code = (PolicyEngine.manager.isAlive()) ? 200 : 500;
- engineReport.message = (PolicyEngine.manager.isAlive()) ? "alive" : "not alive";
+ engineReport.code = PolicyEngine.manager.isAlive() ? 200 : 500;
+ engineReport.message = PolicyEngine.manager.isAlive() ? "alive" : "not alive";
reports.details.add(engineReport);
for (HttpClient client : clients) {
diff --git a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java
index fabcbc03..1c935b0c 100644
--- a/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java
+++ b/feature-session-persistence/src/main/java/org/onap/policy/drools/persistence/DroolsPersistenceProperties.java
@@ -21,6 +21,8 @@
package org.onap.policy.drools.persistence;
public class DroolsPersistenceProperties {
+ private DroolsPersistenceProperties() {
+ }
/*
* feature-session-persistence.properties parameter key values
*/
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java
index aa0a8e6b..06aa4630 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/client/HttpClientFactory.java
@@ -85,7 +85,7 @@ class IndexedHttpClientFactory implements HttpClientFactory {
*/
private static Logger logger = LoggerFactory.getLogger(IndexedHttpClientFactory.class);
- protected HashMap<String, HttpClient> clients = new HashMap<String, HttpClient>();
+ protected HashMap<String, HttpClient> clients = new HashMap<>();
@Override
public synchronized HttpClient build(String name, boolean https, boolean selfSignedCerts,
@@ -108,7 +108,7 @@ class IndexedHttpClientFactory implements HttpClientFactory {
@Override
public synchronized ArrayList<HttpClient> build(Properties properties)
throws KeyManagementException, NoSuchAlgorithmException {
- ArrayList<HttpClient> clientList = new ArrayList<HttpClient>();
+ ArrayList<HttpClient> clientList = new ArrayList<>();
String clientNames = properties.getProperty(PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES);
if (clientNames == null || clientNames.isEmpty()) {
@@ -116,7 +116,7 @@ class IndexedHttpClientFactory implements HttpClientFactory {
}
List<String> clientNameList =
- new ArrayList<String>(Arrays.asList(clientNames.split("\\s*,\\s*")));
+ new ArrayList<>(Arrays.asList(clientNames.split("\\s*,\\s*")));
for (String clientName : clientNameList) {
String httpsString = properties.getProperty(PolicyProperties.PROPERTY_HTTP_CLIENT_SERVICES + "." +
@@ -189,7 +189,7 @@ class IndexedHttpClientFactory implements HttpClientFactory {
@Override
public synchronized List<HttpClient> inventory() {
- return new ArrayList<HttpClient>(this.clients.values());
+ return new ArrayList<>(this.clients.values());
}
@Override
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java
index 56e9ccdd..b6366d00 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/HttpServletServerFactory.java
@@ -100,7 +100,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
/**
* servers index
*/
- protected HashMap<Integer, HttpServletServer> servers = new HashMap<Integer, HttpServletServer>();
+ protected HashMap<Integer, HttpServletServer> servers = new HashMap<>();
@Override
public synchronized HttpServletServer build(String name, String host, int port,
@@ -122,7 +122,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
public synchronized ArrayList<HttpServletServer> build(Properties properties)
throws IllegalArgumentException {
- ArrayList<HttpServletServer> serviceList = new ArrayList<HttpServletServer>();
+ ArrayList<HttpServletServer> serviceList = new ArrayList<>();
String serviceNames = properties.getProperty(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES);
if (serviceNames == null || serviceNames.isEmpty()) {
@@ -131,7 +131,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
}
List<String> serviceNameList =
- new ArrayList<String>(Arrays.asList(serviceNames.split("\\s*,\\s*")));
+ new ArrayList<>(Arrays.asList(serviceNames.split("\\s*,\\s*")));
for (String serviceName : serviceNameList) {
String servicePortString = properties.getProperty(PolicyProperties.PROPERTY_HTTP_SERVER_SERVICES + "." +
@@ -206,14 +206,14 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
if (restClasses != null && !restClasses.isEmpty()) {
List<String> restClassesList =
- new ArrayList<String>(Arrays.asList(restClasses.split("\\s*,\\s*")));
+ new ArrayList<>(Arrays.asList(restClasses.split("\\s*,\\s*")));
for (String restClass : restClassesList)
service.addServletClass(restUriPath, restClass);
}
if (restPackages != null && !restPackages.isEmpty()) {
List<String> restPackageList =
- new ArrayList<String>(Arrays.asList(restPackages.split("\\s*,\\s*")));
+ new ArrayList<>(Arrays.asList(restPackages.split("\\s*,\\s*")));
for (String restPackage : restPackageList)
service.addServletPackage(restUriPath, restPackage);
}
@@ -236,7 +236,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
@Override
public synchronized List<HttpServletServer> inventory() {
- return new ArrayList<HttpServletServer>(this.servers.values());
+ return new ArrayList<>(this.servers.values());
}
@Override
@@ -252,8 +252,8 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory {
@Override
public synchronized void destroy() throws IllegalArgumentException, IllegalStateException {
- List<HttpServletServer> servers = this.inventory();
- for (HttpServletServer server: servers) {
+ List<HttpServletServer> httpServletServers = this.inventory();
+ for (HttpServletServer server: httpServletServers) {
server.shutdown();
}
diff --git a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java
index 55d058f5..e0a46173 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/drools/http/server/internal/JettyServletServer.java
@@ -243,7 +243,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
}
- return (this.jettyServer.isRunning());
+ return this.jettyServer.isRunning();
}
}
@@ -373,7 +373,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("JettyServer [name=").append(name).append(", host=").append(host).append(", port=").append(port)
- .append(", user=").append(user).append(", password=").append((password != null)).append(", contextPath=")
+ .append(", user=").append(user).append(", password=").append(password != null).append(", contextPath=")
.append(contextPath).append(", jettyServer=").append(jettyServer).append(", context=").append(this.context)
.append(", connector=").append(connector).append(", jettyThread=").append(jettyThread)
.append("]");