aboutsummaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java')
-rw-r--r--policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java53
1 files changed, 32 insertions, 21 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
index b22a9401..b866a81e 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java
@@ -43,12 +43,12 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Http Server implementation using Embedded Jetty
+ * Http Server implementation using Embedded Jetty.
*/
public abstract class JettyServletServer implements HttpServletServer, Runnable {
/**
- * Keystore/Truststore system property names
+ * Keystore/Truststore system property names.
*/
public static final String SYSTEM_KEYSTORE_PROPERTY_NAME = "javax.net.ssl.keyStore";
public static final String SYSTEM_KEYSTORE_PASSWORD_PROPERTY_NAME = "javax.net.ssl.keyStorePassword";
@@ -56,67 +56,67 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
public static final String SYSTEM_TRUSTSTORE_PASSWORD_PROPERTY_NAME = "javax.net.ssl.trustStorePassword";
/**
- * Logger
+ * Logger.
*/
private static Logger logger = LoggerFactory.getLogger(JettyServletServer.class);
/**
- * server name
+ * Server name.
*/
protected final String name;
/**
- * server host address
+ * Server host address.
*/
protected final String host;
/**
- * server port to bind
+ * Server port to bind.
*/
protected final int port;
/**
- * server auth user name
+ * Server auth user name.
*/
protected String user;
/**
- * server auth password name
+ * Server auth password name.
*/
protected String password;
/**
- * server base context path
+ * Server base context path.
*/
protected final String contextPath;
/**
- * embedded jetty server
+ * Embedded jetty server.
*/
protected final Server jettyServer;
/**
- * servlet context
+ * Servlet context.
*/
protected final ServletContextHandler context;
/**
- * jetty connector
+ * Jetty connector.
*/
protected final ServerConnector connector;
/**
- * jetty thread
+ * Jetty thread.
*/
protected volatile Thread jettyThread;
/**
- * start condition
+ * Start condition.
*/
protected Object startCondition = new Object();
/**
- * constructor
+ * Constructor.
*
* @param name server name
* @param host server host
@@ -159,11 +159,12 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
this.jettyServer = new Server();
this.jettyServer.setRequestLog(new Slf4jRequestLog());
- if (https)
+ if (https) {
this.connector = httpsConnector();
- else
+ } else {
this.connector = httpConnector();
-
+ }
+
this.connector.setName(srvName);
this.connector.setReuseAddress(true);
this.connector.setPort(port);
@@ -200,8 +201,9 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
sslContextFactory.setKeyStorePath(keyStore);
String ksPassword = System.getProperty(SYSTEM_KEYSTORE_PASSWORD_PROPERTY_NAME);
- if (ksPassword != null)
+ if (ksPassword != null) {
sslContextFactory.setKeyStorePassword(ksPassword);
+ }
}
String trustStore = System.getProperty(SYSTEM_TRUSTSTORE_PROPERTY_NAME);
@@ -209,8 +211,9 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
sslContextFactory.setTrustStorePath(trustStore);
String tsPassword = System.getProperty(SYSTEM_TRUSTSTORE_PASSWORD_PROPERTY_NAME);
- if (tsPassword != null)
+ if (tsPassword != null) {
sslContextFactory.setTrustStorePassword(tsPassword);
+ }
}
HttpConfiguration https = new HttpConfiguration();
@@ -261,7 +264,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
/**
- * jetty server execution
+ * jetty server execution.
*/
@Override
public void run() {
@@ -425,6 +428,8 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
/**
+ * Get name.
+ *
* @return the name
*/
public String getName() {
@@ -432,6 +437,8 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
/**
+ * Get host.
+ *
* @return the host
*/
public String getHost() {
@@ -439,6 +446,8 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
/**
+ * Get user.
+ *
* @return the user
*/
public String getUser() {
@@ -446,6 +455,8 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable
}
/**
+ * Get password.
+ *
* @return the password
*/
@JsonIgnore