diff options
author | Pamela Dragosh <pdragosh@research.att.com> | 2018-09-21 12:48:29 -0400 |
---|---|---|
committer | Pamela Dragosh <pdragosh@research.att.com> | 2018-09-21 14:33:06 -0400 |
commit | af5e28cc353456a28204ce8ebe792a218607d8c9 (patch) | |
tree | 4c21586f87fce9dedc7d4d106fe559a8f119c4e8 /policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http | |
parent | 9a42498247f49a09b56c381ddb009e02127c2234 (diff) |
Fix policy/common checkstyle issues
The root pom.xml had a syntax error in a declaration. The suppressions
xml was not being found by the sub-modules. It was better to create a
copy in each of the sub-modules where we will not be fixing
abbreviations or the interface declarations in own java file.
Added specific checkstyle files for each submodule.
One interesting note for the InheritDoc tag. It seems that the mvn
compile has a bug that interprets these as missing a period after
the tag. Even though the parent interface has it correctly. It was
easier to just remove it than duplicate.
There are new JIRA's for that work to be done in Dublin.
Fixed some spacing in pom's.
Issue-ID: POLICY-1131
Change-Id: I5f845958ccefd50a3b7290662da43c994870f1f7
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http')
4 files changed, 26 insertions, 16 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java index 0be81099..94635615 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/client/internal/JerseyClient.java @@ -70,7 +70,7 @@ public class JerseyClient implements HttpClient { /** * Constructor. * - * name the name https is it https or not selfSignedCerts are there self signed certs hostname + * <p>name the name https is it https or not selfSignedCerts are there self signed certs hostname * the hostname port port being used basePath base context userName user password password * * @param busTopicParams Input parameters object @@ -126,7 +126,7 @@ public class JerseyClient implements HttpClient { return new X509Certificate[0]; } - }}, new SecureRandom()); + } }, new SecureRandom()); clientBuilder = ClientBuilder.newBuilder().sslContext(sslContext).hostnameVerifier((host, session) -> true); } else { 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 b98ed180..488512f9 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 @@ -179,33 +179,41 @@ class IndexedHttpServletServerFactory implements HttpServletServerFactory { continue; } - String hostName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String hostName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_HOST_SUFFIX); - String contextUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String contextUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_CONTEXT_URIPATH_SUFFIX); - String userName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String userName = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX); - String password = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String password = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX); - String authUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String authUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_URIPATH_SUFFIX); - String restClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String restClasses = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_CLASSES_SUFFIX); - String filterClasses = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." - + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); + final String filterClasses = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_FILTER_CLASSES_SUFFIX); - String restPackages = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String restPackages = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_PACKAGES_SUFFIX); - String restUriPath = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + + final String restUriPath = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_HTTP_REST_URIPATH_SUFFIX); - String managedString = properties.getProperty(PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + final String managedString = properties.getProperty( + PolicyEndPointProperties.PROPERTY_HTTP_SERVER_SERVICES + "." + serviceName + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX); boolean managed = true; if (managedString != null && !managedString.isEmpty()) { @@ -233,14 +241,15 @@ 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 */ if (aaf) { service.addFilterClass(contextUriPath, CadiFilter.class.getCanonicalName()); } else if (userName != null && !userName.isEmpty() && password != null && !password.isEmpty()) { - service.setBasicAuthentication(userName, password, authUriPath); + service.setBasicAuthentication(userName, password, authUriPath); } if (filterClasses != null && !filterClasses.isEmpty()) { diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java index 5f6bb544..df1f6044 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/aaf/AafAuthFilter.java @@ -40,5 +40,6 @@ public abstract class AafAuthFilter extends AuthorizationFilter { } protected abstract String getPermissionType(HttpServletRequest request); + protected abstract String getPermissionInstance(HttpServletRequest request); } diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java index 62fa0526..ebac41ef 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/internal/JettyServletServer.java @@ -198,7 +198,7 @@ public abstract class JettyServletServer implements HttpServletServer, Runnable /** * Returns the https connector. * - * @return + * @return the server connector */ public ServerConnector httpsConnector() { SslContextFactory sslContextFactory = new SslContextFactory(); |