X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fserver%2FJettyServiceStarter.java;h=bcc071a21b4c474d08f57a06d0852a95071383b9;hb=ff1417ff60baee231a28272f9a16ef2c9c8ea0a2;hp=2d0a82a85f0474a6cfa9babf42370caa6e468783;hpb=dd097a4b411cd78ced737548a43e019b1f3172f1;p=aaf%2Fauthz.git diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java index 2d0a82a8..bcc071a2 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/server/JettyServiceStarter.java @@ -21,7 +21,6 @@ package org.onap.aaf.auth.server; import java.io.IOException; -import java.net.Inet4Address; import java.net.InetAddress; import java.util.Properties; @@ -45,11 +44,10 @@ import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.onap.aaf.auth.org.OrganizationException; import org.onap.aaf.auth.rserv.RServlet; +import org.onap.aaf.cadi.Access.Level; import org.onap.aaf.cadi.CadiException; import org.onap.aaf.cadi.LocatorException; -import org.onap.aaf.cadi.Access.Level; import org.onap.aaf.cadi.config.Config; -import org.onap.aaf.cadi.config.SecurityInfo; import org.onap.aaf.misc.env.Trans; import org.onap.aaf.misc.env.util.Split; import org.onap.aaf.misc.rosetta.env.RosettaEnv; @@ -81,7 +79,7 @@ public class JettyServiceStarter ex // Critical - if no Security Protocols set, then set it. We'll just get messed up if not if ((httpproto=props.get(Config.CADI_PROTOCOLS))==null) { if ((httpproto=props.get(Config.HTTPS_PROTOCOLS))==null) { - props.put(Config.CADI_PROTOCOLS, (httpproto=SecurityInfo.HTTPS_PROTOCOLS_DEFAULT)); + props.put(Config.CADI_PROTOCOLS, (httpproto=Config.HTTPS_PROTOCOLS_DEFAULT)); } else { props.put(Config.CADI_PROTOCOLS, httpproto); } @@ -94,10 +92,6 @@ public class JettyServiceStarter ex @Override public void _start(RServlet rserv) throws Exception { - String hostname = access().getProperty(Config.HOSTNAME, null); - if (hostname==null) { - hostname = Inet4Address.getLocalHost().getHostName(); - } final int port = Integer.parseInt(access().getProperty("port","0")); final String keystore = access().getProperty(Config.CADI_KEYSTORE, null); final int IDLE_TIMEOUT = Integer.parseInt(access().getProperty(Config.AAF_CONN_IDLE_TIMEOUT, Config.AAF_CONN_IDLE_TIMEOUT_DEF)); @@ -133,7 +127,7 @@ public class JettyServiceStarter ex sslContextFactory.setTrustStorePassword(access().decrypt(truststorePassword, false)); } // Be able to accept only certain protocols, i.e. TLSv1.1+ - String subprotocols = access().getProperty(Config.CADI_PROTOCOLS, SecurityInfo.HTTPS_PROTOCOLS_DEFAULT); + String subprotocols = access().getProperty(Config.CADI_PROTOCOLS, Config.HTTPS_PROTOCOLS_DEFAULT); service.setSubprotocol(subprotocols); final String[] protocols = Split.splitTrim(',', subprotocols); sslContextFactory.setIncludeProtocols(protocols); @@ -215,9 +209,15 @@ public class JettyServiceStarter ex } } try { - register(service.registrants(port)); + String no_register = env().getProperty("aaf_no_register",null); + if(no_register==null) { + register(service.registrants(port)); + } else { + access().printf(Level.INIT,"'aaf_no_register' is set. %s will not be registered with Locator", service.app_name); + } access().printf(Level.INIT, "Starting Jetty Service for %s, version %s, on %s://%s:%d", service.app_name,service.app_version,protocol,hostname,port); - //server.join(); + + rserv.postStartup(hostname, port); } catch (Exception e) { access().log(e,"Error registering " + service.app_name); String doExit = access().getProperty("cadi_exitOnFailure", "true");