summaryrefslogtreecommitdiffstats
path: root/datarouter-prov
diff options
context:
space:
mode:
authorAmaresh Kumar <kamaresh@in.ibm.com>2018-09-03 20:04:04 +0530
committerAmaresh Kumar <kamaresh@in.ibm.com>2018-09-03 20:04:15 +0530
commitd9c9da7cc04fb308fc83243e665407b07f6188e0 (patch)
tree0f767959ae081416ece28098205fbe602c505ae9 /datarouter-prov
parenta1cc0279360b09663c1b59fd0b89a1c2e081dfbd (diff)
Fixed Sonar issues in Main.java
https://sonar.onap.org/project/issues?id=org.onap.dmaap.datarouter%3Aparent&open=AWVHornGxOv3LmQdBxkZ&resolved=false&severities=BLOCKER&types=BUG Issue-ID: DMAAP-693 Change-Id: I7ef7062472326472c973f3c19eaec94a9bfd3add Signed-off-by: Amaresh Kumar <kamaresh@in.ibm.com>
Diffstat (limited to 'datarouter-prov')
-rw-r--r--datarouter-prov/src/main/java/org/onap/dmaap/datarouter/provisioning/Main.java157
1 files changed, 79 insertions, 78 deletions
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 800bd9af..5d799eee 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
@@ -156,91 +156,92 @@ public class Main {
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"));
+ .setKeyManagerPassword(p.getProperty("org.onap.dmaap.datarouter.provserver.keymanager.password"));
// SSL stuff
/* Skip SSLv3 Fixes */
sslContextFactory.addExcludeProtocols("SSLv3");
logger.info("Excluded protocols prov-" + Arrays.toString(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);
- sslContextFactory.setTrustStorePath(ts);
- sslContextFactory.setTrustStorePassword(p.getProperty(TRUSTSTORE_PASSWORD_PROPERTY));
- } else {
- sslContextFactory.setTrustStorePath(DEFAULT_TRUSTSTORE);
- sslContextFactory.setTrustStorePassword("changeit");
- }
- sslContextFactory.setWantClientAuth(true);
-
- // Servlet and Filter configuration
- ServletContextHandler ctxt = new ServletContextHandler(0);
- ctxt.setContextPath("/");
- ctxt.addServlet(new ServletHolder(new FeedServlet()), "/feed/*");
- ctxt.addServlet(new ServletHolder(new FeedLogServlet()), "/feedlog/*");
- ctxt.addServlet(new ServletHolder(new PublishServlet()), "/publish/*");
- ctxt.addServlet(new ServletHolder(new SubscribeServlet()), "/subscribe/*");
- ctxt.addServlet(new ServletHolder(new StatisticsServlet()), "/statistics/*");
- ctxt.addServlet(new ServletHolder(new SubLogServlet()), "/sublog/*");
- ctxt.addServlet(new ServletHolder(new GroupServlet()),
- "/group/*"); //Provision groups - Rally US708115 -1610
- ctxt.addServlet(new ServletHolder(new SubscriptionServlet()), "/subs/*");
- ctxt.addServlet(new ServletHolder(new InternalServlet()), "/internal/*");
- ctxt.addServlet(new ServletHolder(new RouteServlet()), "/internal/route/*");
- ctxt.addServlet(new ServletHolder(new DRFeedsServlet()), "/");
- ctxt.addFilter(new FilterHolder(new ThrottleFilter()), "/publish/*", EnumSet.of(DispatcherType.REQUEST));
-
- ContextHandlerCollection contexts = new ContextHandlerCollection();
- contexts.addHandler(ctxt);
-
- // Request log configuration
- NCSARequestLog nrl = new NCSARequestLog();
- nrl.setFilename(
- p.getProperty("org.onap.dmaap.datarouter.provserver.accesslog.dir") + "/request.log.yyyy_mm_dd");
- nrl.setFilenameDateFormat("yyyyMMdd");
- nrl.setRetainDays(90);
- nrl.setAppend(true);
- nrl.setExtended(false);
- nrl.setLogCookies(false);
- nrl.setLogTimeZone("GMT");
-
- RequestLogHandler reqlog = new RequestLogHandler();
- reqlog.setRequestLog(nrl);
-
- // Server's Handler collection
- hc = new HandlerCollection();
- hc.setHandlers(new Handler[]{contexts, new DefaultHandler()});
- hc.addHandler(reqlog);
-
- // 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
-
- // Start LogfileLoader
- LogfileLoader.getLoader();
-
- try (ServerConnector serverConnector = new ServerConnector(server,
- new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
- new HttpConnectionFactory(httpsConfiguration))) {
- serverConnector.setPort(httpsPort);
- serverConnector.setIdleTimeout(500000);
+ try (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);
+ sslContextFactory.setTrustStorePath(ts);
+ sslContextFactory.setTrustStorePassword(p.getProperty(TRUSTSTORE_PASSWORD_PROPERTY));
+ } else {
+ sslContextFactory.setTrustStorePath(DEFAULT_TRUSTSTORE);
+ sslContextFactory.setTrustStorePassword("changeit");
+ }
+ sslContextFactory.setWantClientAuth(true);
+
+ // Servlet and Filter configuration
+ ServletContextHandler ctxt = new ServletContextHandler(0);
+ ctxt.setContextPath("/");
+ ctxt.addServlet(new ServletHolder(new FeedServlet()), "/feed/*");
+ ctxt.addServlet(new ServletHolder(new FeedLogServlet()), "/feedlog/*");
+ ctxt.addServlet(new ServletHolder(new PublishServlet()), "/publish/*");
+ ctxt.addServlet(new ServletHolder(new SubscribeServlet()), "/subscribe/*");
+ ctxt.addServlet(new ServletHolder(new StatisticsServlet()), "/statistics/*");
+ ctxt.addServlet(new ServletHolder(new SubLogServlet()), "/sublog/*");
+ ctxt.addServlet(new ServletHolder(new GroupServlet()),
+ "/group/*"); //Provision groups - Rally US708115 -1610
+ ctxt.addServlet(new ServletHolder(new SubscriptionServlet()), "/subs/*");
+ ctxt.addServlet(new ServletHolder(new InternalServlet()), "/internal/*");
+ ctxt.addServlet(new ServletHolder(new RouteServlet()), "/internal/route/*");
+ ctxt.addServlet(new ServletHolder(new DRFeedsServlet()), "/");
+ ctxt.addFilter(new FilterHolder(new ThrottleFilter()), "/publish/*", EnumSet.of(DispatcherType.REQUEST));
+
+ ContextHandlerCollection contexts = new ContextHandlerCollection();
+ contexts.addHandler(ctxt);
+
+ // Request log configuration
+ NCSARequestLog nrl = new NCSARequestLog();
+ nrl.setFilename(
+ p.getProperty("org.onap.dmaap.datarouter.provserver.accesslog.dir") + "/request.log.yyyy_mm_dd");
+ nrl.setFilenameDateFormat("yyyyMMdd");
+ nrl.setRetainDays(90);
+ nrl.setAppend(true);
+ nrl.setExtended(false);
+ nrl.setLogCookies(false);
+ nrl.setLogTimeZone("GMT");
+
+ RequestLogHandler reqlog = new RequestLogHandler();
+ reqlog.setRequestLog(nrl);
+
+ // Server's Handler collection
+ hc = new HandlerCollection();
+ hc.setHandlers(new Handler[]{contexts, new DefaultHandler()});
+ hc.addHandler(reqlog);
+
+ // 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
+
+ // Start LogfileLoader
+ LogfileLoader.getLoader();
+
+ try (ServerConnector serverConnector = new ServerConnector(server,
+ new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()),
+ new HttpConnectionFactory(httpsConfiguration))) {
+ serverConnector.setPort(httpsPort);
+ serverConnector.setIdleTimeout(500000);
+ }
+
+ server.setConnectors(new Connector[]{httpServerConnector, httpsServerConnector});
}
-
- server.setConnectors(new Connector[]{httpServerConnector, httpsServerConnector});
}
server.setHandler(hc);
server.setStopAtShutdown(true);