summaryrefslogtreecommitdiffstats
path: root/datarouter-prov
diff options
context:
space:
mode:
authoreconwar <conor.ward@ericsson.com>2018-08-15 12:12:42 +0000
committerRonan Keogh <ronan.keogh@ericsson.com>2018-08-16 14:43:05 +0100
commit49fbf9a09d244bbdc19783d9ff10cd03cd89640a (patch)
tree2976c63daf00746f4958601ba5883834165e08d4 /datarouter-prov
parentf20d316c4a4d8666f93be0a654dd042c6d0ac835 (diff)
Fix datarouter-prov server issue
Change-Id: Id9637c56d39156da60c167dfb8f375f4cb498f55 Signed-off-by: Conor Ward <conor.ward@ericsson.com> Issue-ID: DMAAP-596
Diffstat (limited to 'datarouter-prov')
-rwxr-xr-xdatarouter-prov/pom.xml5
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java77
2 files changed, 39 insertions, 43 deletions
diff --git a/datarouter-prov/pom.xml b/datarouter-prov/pom.xml
index a0650a02..a0624d2b 100755
--- a/datarouter-prov/pom.xml
+++ b/datarouter-prov/pom.xml
@@ -75,11 +75,6 @@
<version>0.0.1</version>
</dependency>
<dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- </dependency>
- <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty.version}</version>
diff --git a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
index 60496e56..3e3f45fe 100644
--- a/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
+++ b/datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java
@@ -116,50 +116,60 @@ public class Main {
// Get properties
Properties p = (new DB()).getProperties();
- int http_port = Integer.parseInt(p.getProperty("org.onap.dmaap.datarouter.provserver.http.port", "8080"));
- int https_port = Integer.parseInt(p.getProperty("org.onap.dmaap.datarouter.provserver.https.port", "8443"));
+ int httpPort = Integer.parseInt(p.getProperty("org.onap.dmaap.datarouter.provserver.http.port", "8080"));
+ int httpsPort = Integer.parseInt(p.getProperty("org.onap.dmaap.datarouter.provserver.https.port", "8443"));
+
+ // HTTP configuration
+ HttpConfiguration httpConfiguration = new HttpConfiguration();
+ httpConfiguration.setSecureScheme("https");
+ httpConfiguration.setSecurePort(httpsPort);
+ httpConfiguration.setOutputBufferSize(32768);
+ httpConfiguration.setRequestHeaderSize(2048);
+ httpConfiguration.setIdleTimeout(300000);
+ httpConfiguration.setSendServerVersion(true);
+ httpConfiguration.setSendDateHeader(false);
+
+ // Server's thread pool
+ QueuedThreadPool queuedThreadPool = new QueuedThreadPool();
+ queuedThreadPool.setMinThreads(10);
+ queuedThreadPool.setMaxThreads(200);
+ queuedThreadPool.setDetailedDump(false);
+
+ // The server itself
+ server = new Server(queuedThreadPool);
// HTTP connector
- HttpConfiguration http_config = new HttpConfiguration();
- http_config.setSecureScheme("https");
- http_config.setSecurePort(https_port);
- http_config.setOutputBufferSize(32768);
- http_config.setRequestHeaderSize(2048);
- http_config.setIdleTimeout(300000);
- http_config.setSendServerVersion(true);
- http_config.setSendDateHeader(false);
-
- ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config));
- http.setPort(http_port);
- http.setAcceptQueueSize(2);
-
- // HTTPS config
- HttpConfiguration https_config = new HttpConfiguration(http_config);
- https_config.setRequestHeaderSize(8192);
+ ServerConnector httpServerConnector = new ServerConnector(server, new HttpConnectionFactory(httpConfiguration));
+ httpServerConnector.setPort(httpPort);
+ httpServerConnector.setAcceptQueueSize(2);
+
+ // HTTPS configuration
+ HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration);
+ httpsConfiguration.setRequestHeaderSize(8192);
// HTTPS connector
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath(p.getProperty(KEYSTORE_PATH_PROPERTY));
sslContextFactory.setKeyStorePassword(p.getProperty(KEYSTORE_PASSWORD_PROPERTY));
sslContextFactory.setKeyManagerPassword(p.getProperty("org.onap.dmaap.datarouter.provserver.keymanager.password"));
-
- ServerConnector https = new ServerConnector(server,
- new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
- new HttpConnectionFactory(https_config));
- https.setPort(https_port);
- https.setIdleTimeout(30000);
- https.setAcceptQueueSize(2);
-
// SSL stuff
/* Skip SSLv3 Fixes */
sslContextFactory.addExcludeProtocols("SSLv3");
logger.info("Excluded protocols prov-" + sslContextFactory.getExcludeProtocols());
/* End of SSLv3 Fixes */
+ ServerConnector httpsServerConnector = new ServerConnector(server,
+ new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
+ new HttpConnectionFactory(httpsConfiguration));
+ httpsServerConnector.setPort(httpsPort);
+ httpsServerConnector.setIdleTimeout(30000);
+ httpsServerConnector.setAcceptQueueSize(2);
+
sslContextFactory.setKeyStoreType(p.getProperty(KEYSTORE_TYPE_PROPERTY, "jks"));
sslContextFactory.setKeyStorePath(p.getProperty(KEYSTORE_PATH_PROPERTY));
sslContextFactory.setKeyStorePassword(p.getProperty(KEYSTORE_PASSWORD_PROPERTY));
sslContextFactory.setKeyManagerPassword(p.getProperty("org.onap.dmaap.datarouter.provserver.keymanager.password"));
+
String ts = p.getProperty(TRUSTSTORE_PATH_PROPERTY);
if (ts != null && ts.length() > 0) {
System.out.println("@@ TS -> " + ts);
@@ -210,12 +220,6 @@ public class Main {
hc.setHandlers(new Handler[]{contexts, new DefaultHandler()});
hc.addHandler(reqlog);
- // Server's thread pool
- QueuedThreadPool queuedThreadPool = new QueuedThreadPool();
- queuedThreadPool.setMinThreads(10);
- queuedThreadPool.setMaxThreads(200);
- queuedThreadPool.setDetailedDump(false);
-
// Daemon to clean up the log directory on a daily basis
Timer rolex = new Timer();
rolex.scheduleAtFixedRate(new PurgeLogDirTask(), 0, 86400000L); // run once per day
@@ -223,16 +227,13 @@ public class Main {
// Start LogfileLoader
LogfileLoader.getLoader();
- // The server itself
- server = new Server(queuedThreadPool);
-
ServerConnector serverConnector = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()),
- new HttpConnectionFactory(https_config));
- serverConnector.setPort(https_port);
+ new HttpConnectionFactory(httpsConfiguration));
+ serverConnector.setPort(httpsPort);
serverConnector.setIdleTimeout(500000);
- server.setConnectors(new Connector[]{http, https});
+ server.setConnectors(new Connector[]{httpServerConnector, httpsServerConnector});
server.setHandler(hc);
server.setStopAtShutdown(true);
server.setStopTimeout(5000);