diff options
author | liamfallon <liam.fallon@est.tech> | 2018-12-19 19:14:35 +0000 |
---|---|---|
committer | Liam Fallon <liam.fallon@est.tech> | 2019-01-07 15:39:21 +0000 |
commit | b79939366cef7a99fca6851e7e07619cb370e2b8 (patch) | |
tree | 81c3968af7109c73078dfce949f109e9e11fbe30 /policy-endpoints/src/main/java/org/onap | |
parent | 7e580d1ea9166134bf3fdf411725bbf038bd23df (diff) |
Add support for parameter inheritance
Common parameter support does not allow for inheritance of parameters
from a super class. This change allows inheritance of public and protected
members from a parameter superclass to a parameter subclass.
Issue-ID: POLICY-1222
Change-Id: Ia4f452abab80953b41784c44e4202e8d5405a197
Signed-off-by: liamfallon <liam.fallon@est.tech>
(cherry picked from commit 7b150f6820d61b8c65b6ddd5f4952ad3d4d17c6c)
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java | 78 |
1 files changed, 33 insertions, 45 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java index 4a33f568..527ada99 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/HttpServletServerFactory.java @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Properties; -import org.onap.aaf.cadi.filter.CadiFilter; import org.onap.policy.common.endpoints.http.server.internal.JettyJerseyServer; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; import org.slf4j.Logger; @@ -50,7 +49,7 @@ public interface HttpServletServerFactory { * @throws IllegalArgumentException when invalid parameters are provided */ HttpServletServer build(String name, boolean https, String host, int port, String contextPath, boolean swagger, - boolean managed); + boolean managed); /** * Builds an http server with support for servlets. @@ -64,8 +63,7 @@ public interface HttpServletServerFactory { * @return http server * @throws IllegalArgumentException when invalid parameters are provided */ - HttpServletServer build(String name, String host, int port, String contextPath, boolean swagger, - boolean managed); + HttpServletServer build(String name, String host, int port, String contextPath, boolean swagger, boolean managed); /** * Build a list of http servers per properties. @@ -104,7 +102,6 @@ public interface HttpServletServerFactory { void destroy(); } - /** * Indexed factory implementation. */ @@ -123,9 +120,8 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { protected HashMap<Integer, HttpServletServer> servers = new HashMap<>(); @Override - public synchronized HttpServletServer build(String name, boolean https, - String host, int port, String contextPath, boolean swagger, - boolean managed) { + public synchronized HttpServletServer build(String name, boolean https, String host, int port, String contextPath, + boolean swagger, boolean managed) { if (servers.containsKey(port)) { return servers.get(port); @@ -140,12 +136,11 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { } @Override - public synchronized HttpServletServer build(String name, String host, int port, String contextPath, - boolean swagger, boolean managed) { + public synchronized HttpServletServer build(String name, String host, int port, String contextPath, boolean swagger, + boolean managed) { return build(name, false, host, port, contextPath, swagger, managed); } - @Override public synchronized List<HttpServletServer> build(Properties properties) { @@ -161,7 +156,7 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { for (String serviceName : serviceNameList) { String servicePortString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES - + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_PORT_SUFFIX); + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_PORT_SUFFIX); int servicePort; try { @@ -180,48 +175,41 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { } final String hostName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_HOST_SUFFIX); + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_HOST_SUFFIX); - final String contextUriPath = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_CONTEXT_URIPATH_SUFFIX); + final String contextUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_CONTEXT_URIPATH_SUFFIX); final String userName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX); + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX); final String password = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX); - - final String authUriPath = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_URIPATH_SUFFIX); - - final String restClasses = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX); - - final String filterClasses = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); - - final String restPackages = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_PACKAGES_SUFFIX); - - final String restUriPath = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_URIPATH_SUFFIX); - - final String managedString = properties.getProperty( - PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX); + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX); + + final String authUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_URIPATH_SUFFIX); + + final String restClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX); + + final String filterClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); + + final String restPackages = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_PACKAGES_SUFFIX); + + final String restUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_URIPATH_SUFFIX); + + final String managedString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + + "." + serviceName + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX); boolean managed = true; if (managedString != null && !managedString.isEmpty()) { managed = Boolean.parseBoolean(managedString); } String swaggerString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX); + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX); boolean swagger = false; if (swaggerString != null && !swaggerString.isEmpty()) { swagger = Boolean.parseBoolean(swaggerString); @@ -241,8 +229,8 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { aaf = Boolean.parseBoolean(aafString); } - HttpServletServer service = build(serviceName, https, hostName, servicePort, - contextUriPath, swagger, managed); + HttpServletServer service = build(serviceName, https, hostName, servicePort, contextUriPath, swagger, + managed); /* authentication method either AAF or HTTP Basic Auth */ |