diff options
author | eronkeo <ronan.keogh@ericsson.com> | 2018-08-14 17:58:28 +0100 |
---|---|---|
committer | eronkeo <ronan.keogh@ericsson.com> | 2018-08-14 19:48:59 +0100 |
commit | 85129f80a65aea102c07f695878a772ffa2dffc4 (patch) | |
tree | 508511cf080d0221c8fbe0bc597622e781159ff0 /datarouter-node/src/main/java/org/onap | |
parent | 1841cb5d8da7b21996f8faad9d24f858e6ce8a41 (diff) |
remove the policy and security issue dependencies
Change-Id: If92573566a96ab85a7ee762b727740e2766ea6a0
Issue-ID: DMAAP-557
Signed-off-by: eronkeo <ronan.keogh@ericsson.com>
Diffstat (limited to 'datarouter-node/src/main/java/org/onap')
-rw-r--r-- | datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java index d7650030..b9cdb541 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeMain.java @@ -21,14 +21,12 @@ * * ******************************************************************************/ - package org.onap.dmaap.datarouter.node; +import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.servlet.*; import org.eclipse.jetty.util.ssl.*; import org.eclipse.jetty.server.*; -import org.eclipse.jetty.server.nio.*; -import org.eclipse.jetty.server.ssl.*; import org.apache.log4j.Logger; /** @@ -43,7 +41,7 @@ public class NodeMain { private static class wfconfig implements Runnable { private NodeConfigManager ncm; - public wfconfig(NodeConfigManager ncm) { + wfconfig(NodeConfigManager ncm) { this.ncm = ncm; } @@ -51,13 +49,14 @@ public class NodeMain { notify(); } - public synchronized void waitforconfig() { + synchronized void waitforconfig() { ncm.registerConfigTask(this); while (!ncm.isConfigured()) { logger.info("NODE0003 Waiting for Node Configuration"); try { wait(); } catch (Exception e) { + logger.debug("NodeMain: waitforconfig exception"); } } ncm.deregisterConfigTask(this); @@ -71,7 +70,7 @@ public class NodeMain { /** * Reset the retry timer for a subscription */ - public static void resetQueue(String subid, String ip) { + static void resetQueue(String subid, String ip) { d.resetQueue(ncm.getSpoolDir(subid, ip)); } @@ -91,25 +90,37 @@ public class NodeMain { d = new Delivery(ncm); LogManager lm = new LogManager(ncm); Server server = new Server(); - SelectChannelConnector http = new SelectChannelConnector(); + + // HTTP configuration + HttpConfiguration http_config = new HttpConfiguration(); + http_config.setIdleTimeout(2000); + http_config.setRequestHeaderSize(2048); + + ServerConnector http = new ServerConnector(server, new HttpConnectionFactory(http_config)); http.setPort(ncm.getHttpPort()); - http.setMaxIdleTime(2000); - http.setRequestHeaderSize(2048); - SslSelectChannelConnector https = new SslSelectChannelConnector(); + + // HTTPS configuration + SslContextFactory sslContextFactory = new SslContextFactory(); + sslContextFactory.setKeyStoreType(ncm.getKSType()); + sslContextFactory.setKeyStorePath(ncm.getKSFile()); + sslContextFactory.setKeyStorePassword(ncm.getKSPass()); + sslContextFactory.setKeyManagerPassword(ncm.getKPass()); + + HttpConfiguration https_config = new HttpConfiguration(http_config); + https_config.setRequestHeaderSize(8192); + + ServerConnector https = new ServerConnector(server, + new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()), + new HttpConnectionFactory(https_config)); https.setPort(ncm.getHttpsPort()); - https.setMaxIdleTime(30000); - https.setRequestHeaderSize(8192); - SslContextFactory cf = https.getSslContextFactory(); - - /**Skip SSLv3 Fixes*/ - cf.addExcludeProtocols("SSLv3"); - logger.info("Excluded protocols node-" + cf.getExcludeProtocols()); - /**End of SSLv3 Fixes*/ - - cf.setKeyStoreType(ncm.getKSType()); - cf.setKeyStorePath(ncm.getKSFile()); - cf.setKeyStorePassword(ncm.getKSPass()); - cf.setKeyManagerPassword(ncm.getKPass()); + https.setIdleTimeout(500000); + https.setAcceptQueueSize(2); + + /* Skip SSLv3 Fixes */ + sslContextFactory.addExcludeProtocols("SSLv3"); + logger.info("Excluded protocols node-" + sslContextFactory.getExcludeProtocols()); + /* End of SSLv3 Fixes */ + server.setConnectors(new Connector[]{http, https}); ServletContextHandler ctxt = new ServletContextHandler(0); ctxt.setContextPath("/"); |