You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by kr...@apache.org on 2019/07/09 20:40:51 UTC
[knox] branch v1.3.0 updated: Cleanup Javadoc warnings
This is an automated email from the ASF dual-hosted git repository.
krisden pushed a commit to branch v1.3.0
in repository https://gitbox.apache.org/repos/asf/knox.git
The following commit(s) were added to refs/heads/v1.3.0 by this push:
new 54b72a2 Cleanup Javadoc warnings
54b72a2 is described below
commit 54b72a24c6952ce2c991baacdc112e5bae8044f5
Author: Kevin Risden <kr...@apache.org>
AuthorDate: Tue Jul 9 15:58:04 2019 -0400
Cleanup Javadoc warnings
---
.../gateway/filter/XForwardHeaderFilterTest.java | 41 ++++------
.../gateway/config/impl/GatewayConfigImpl.java | 8 --
.../org/apache/knox/gateway/GatewayTestConfig.java | 8 --
.../java/org/apache/hadoop/http/HttpServer2.java | 26 ++++---
.../java/org/apache/hadoop/http/HttpServer2.java | 89 ++++++++++++----------
5 files changed, 75 insertions(+), 97 deletions(-)
diff --git a/gateway-server-xforwarded-filter/src/test/java/org/apache/knox/gateway/filter/XForwardHeaderFilterTest.java b/gateway-server-xforwarded-filter/src/test/java/org/apache/knox/gateway/filter/XForwardHeaderFilterTest.java
index 5665139..6c78a1c 100644
--- a/gateway-server-xforwarded-filter/src/test/java/org/apache/knox/gateway/filter/XForwardHeaderFilterTest.java
+++ b/gateway-server-xforwarded-filter/src/test/java/org/apache/knox/gateway/filter/XForwardHeaderFilterTest.java
@@ -33,7 +33,7 @@ public class XForwardHeaderFilterTest {
public static class AssertXForwardedHeaders extends TestFilterAdapter {
@Override
- public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) throws IOException, ServletException {
+ public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) {
assertThat( request.getHeader( "X-Forwarded-For" ), is( "127.0.0.1" ) );
assertThat( request.getHeader( "X-Forwarded-Proto" ), is( "http" ) );
assertThat( request.getHeader( "X-Forwarded-Port" ), is( "8888" ) );
@@ -66,7 +66,7 @@ public class XForwardHeaderFilterTest {
public static class AssertProxiedXForwardedHeaders extends TestFilterAdapter {
@Override
- public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) throws IOException, ServletException {
+ public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) {
assertThat( request.getHeader( "X-Forwarded-For" ), is( "127.0.0.0,127.0.0.1" ) );
assertThat( request.getHeader( "X-Forwarded-Proto" ), is( "https" ) );
assertThat( request.getHeader( "X-Forwarded-Port" ), is( "9999" ) );
@@ -83,7 +83,6 @@ public class XForwardHeaderFilterTest {
* @since 1.3.0
*/
public static class DummyXForwardedHeaderFilter extends XForwardedHeaderFilter {
-
boolean isAppendServiceName;
String serviceContext;
@@ -94,8 +93,10 @@ public class XForwardHeaderFilterTest {
}
@Override
- protected void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {
- chain.doFilter( new XForwardedHeaderRequestWrapper( request , this.isAppendServiceName, this.serviceContext), response );
+ protected void doFilter(HttpServletRequest request, HttpServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+ chain.doFilter( new XForwardedHeaderRequestWrapper( request ,
+ this.isAppendServiceName, this.serviceContext), response );
}
}
@@ -104,7 +105,6 @@ public class XForwardHeaderFilterTest {
* @since 1.3.0
*/
public static class AssertProxiedXForwardedContextHeaders extends TestFilterAdapter {
-
boolean appendServiceName;
String serviceContext;
@@ -115,7 +115,7 @@ public class XForwardHeaderFilterTest {
}
@Override
- public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) throws IOException, ServletException {
+ public void doFilter( HttpServletRequest request, HttpServletResponse response, FilterChain chain ) {
assertThat( request.getHeader( "X-Forwarded-For" ), is( "127.0.0.0,127.0.0.1" ) );
assertThat( request.getHeader( "X-Forwarded-Proto" ), is( "https" ) );
assertThat( request.getHeader( "X-Forwarded-Port" ), is( "9999" ) );
@@ -129,7 +129,6 @@ public class XForwardHeaderFilterTest {
} else {
assertThat( request.getHeader( "X-Forwarded-Context" ), is( "/gateway/sandbox" ) );
}
-
}
}
@@ -163,12 +162,8 @@ public class XForwardHeaderFilterTest {
chain.doFilter( request, response );
}
- /**
- * Test the case where service name is appended to X-Forwarded-Context
- * along with request context.
- * @throws ServletException
- * @throws IOException
- * @since 1.3.0
+ /*
+ * Test the case where service name is appended to X-Forwarded-Context along with request context.
*/
@Test
public void testProxiedXForwardContextHeaders() throws ServletException, IOException {
@@ -200,12 +195,8 @@ public class XForwardHeaderFilterTest {
chain.doFilter( request, response );
}
- /**
- * Test the case where service name is appended to X-Forwarded-Context
- * along with request context.
- * @throws ServletException
- * @throws IOException
- * @since 1.3.0
+ /*
+ * Test the case where service name is appended to X-Forwarded-Context along with request context.
*/
@Test
public void testProxiedXForwardContextHeadersServiceParam() throws ServletException, IOException {
@@ -237,13 +228,8 @@ public class XForwardHeaderFilterTest {
chain.doFilter( request, response );
}
- /**
- * Test the case where appending service name to X-Forwarded-Context is
- * disabled
- *
- * @throws ServletException
- * @throws IOException
- * @since 1.3.0
+ /*
+ * Test the case where appending service name to X-Forwarded-Context is disabled
*/
@Test
public void testProxiedXForwardContextHeadersNegativeTest() throws ServletException, IOException {
@@ -274,5 +260,4 @@ public class XForwardHeaderFilterTest {
chain.push( filter );
chain.doFilter( request, response );
}
-
}
diff --git a/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java b/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
index bda88c7..71dd591 100644
--- a/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
+++ b/gateway-server/src/main/java/org/apache/knox/gateway/config/impl/GatewayConfigImpl.java
@@ -1066,14 +1066,6 @@ public class GatewayConfigImpl extends Configuration implements GatewayConfig {
return Boolean.parseBoolean(result);
}
- /**
- * Returns a list of services that need service name appended to
- * X-Forward-Context header as a result of which the new header would look
- * /{gateway}/{sandbox}/{serviceName}
- *
- * @return
- * @since 1.3.0
- */
@Override
public List<String> getXForwardContextAppendServices() {
String value = get( X_FORWARD_CONTEXT_HEADER_APPEND_SERVICES );
diff --git a/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestConfig.java b/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestConfig.java
index aad1271..60a2938 100644
--- a/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestConfig.java
+++ b/gateway-test-release-utils/src/main/java/org/apache/knox/gateway/GatewayTestConfig.java
@@ -748,14 +748,6 @@ public class GatewayTestConfig extends Configuration implements GatewayConfig {
return false;
}
- /**
- * Returns a list of services that need service name appended to
- * X-Forward-Context header as a result of which the new header would look
- * /{gateway}/{sandbox}/{serviceName}
- *
- * @return
- * @since 1.3.0
- */
@Override
public List<String> getXForwardContextAppendServices() {
return null;
diff --git a/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java b/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
index 763bfc9..ef148fe 100644
--- a/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
+++ b/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
@@ -228,7 +228,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Add an endpoint that the HTTP server should listen to.
*
* @param endpoint
@@ -243,7 +243,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Set the hostname of the http server. The host name is used to resolve the
* _HOST field in Kerberos principals. The hostname of the first listener
* will be used if the name is unspecified.
@@ -272,7 +272,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Specify whether the server should authorize the client in SSL
* connections.
*/
@@ -296,7 +296,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Specify the SSL configuration to load. This API provides an alternative
* to keyStore/keyPassword/trustStore.
*/
@@ -690,7 +690,7 @@ public final class HttpServer2 implements FilterContainer {
return initializers;
}
- /**
+ /*
* Add default apps.
* @param appDir The application directory
*/
@@ -965,7 +965,7 @@ public final class HttpServer2 implements FilterContainer {
LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}
- /**
+ /*
* Define a filter for a context and set up default url mappings.
*/
public static void defineFilter(ServletContextHandler ctx, String name,
@@ -975,7 +975,7 @@ public final class HttpServer2 implements FilterContainer {
defineFilter(ctx, filterHolder, fmap);
}
- /**
+ /*
* Define a filter for a context and set up default url mappings.
*/
private static void defineFilter(ServletContextHandler ctx,
@@ -1077,6 +1077,7 @@ public final class HttpServer2 implements FilterContainer {
/**
* Get the address that corresponds to a particular connector.
*
+ * @param index index of the connector
* @return the corresponding address for the connector, or null if there's no
* such connector or the connector is not bounded or was closed.
*/
@@ -1095,7 +1096,7 @@ public final class HttpServer2 implements FilterContainer {
return new InetSocketAddress(c.getHost(), c.getLocalPort());
}
- /**
+ /*
* Set the min, max number of worker threads (simultaneous connections).
*/
public void setThreads(int min, int max) {
@@ -1121,7 +1122,7 @@ public final class HttpServer2 implements FilterContainer {
AuthenticationFilter.class.getName(), params, null);
}
- /**
+ /*
* Start the server. Does not wait for the server to start.
*/
public void start() throws IOException {
@@ -1277,7 +1278,7 @@ public final class HttpServer2 implements FilterContainer {
}
}
- /**
+ /*
* stop the server
*/
public void stop() throws Exception {
@@ -1365,7 +1366,8 @@ public final class HttpServer2 implements FilterContainer {
* @param servletContext the servlet context.
* @param request the servlet request.
* @param response the servlet response.
- * @return TRUE/FALSE based on the logic decribed above.
+ * @return TRUE/FALSE based on the logic described above.
+ * @throws IOException exception on error
*/
public static boolean isInstrumentationAccessAllowed(
ServletContext servletContext, HttpServletRequest request,
@@ -1387,6 +1389,8 @@ public final class HttpServer2 implements FilterContainer {
* Does the user sending the HttpServletRequest has the administrator ACLs? If
* it isn't the case, response will be modified to send an error to the user.
*
+ * @param servletContext the servlet context.
+ * @param request the servlet request.
* @param response used to send the error response if user does not have admin access.
* @return true if admin-authorized, false otherwise
* @throws IOException exception on error
diff --git a/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java b/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
index 435548f..ef148fe 100644
--- a/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
+++ b/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
@@ -17,6 +17,38 @@
*/
package org.apache.hadoop.http;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.io.PrintStream;
+import java.net.BindException;
+import java.net.InetSocketAddress;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
@@ -71,37 +103,6 @@ import org.eclipse.jetty.webapp.WebAppContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.io.PrintStream;
-import java.net.BindException;
-import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
/**
* Create a Jetty embedded server to answer http requests. The primary goal is
* to serve up status information for the server. There are three contexts:
@@ -227,7 +228,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Add an endpoint that the HTTP server should listen to.
*
* @param endpoint
@@ -242,7 +243,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Set the hostname of the http server. The host name is used to resolve the
* _HOST field in Kerberos principals. The hostname of the first listener
* will be used if the name is unspecified.
@@ -271,7 +272,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Specify whether the server should authorize the client in SSL
* connections.
*/
@@ -295,7 +296,7 @@ public final class HttpServer2 implements FilterContainer {
return this;
}
- /**
+ /*
* Specify the SSL configuration to load. This API provides an alternative
* to keyStore/keyPassword/trustStore.
*/
@@ -689,7 +690,7 @@ public final class HttpServer2 implements FilterContainer {
return initializers;
}
- /**
+ /*
* Add default apps.
* @param appDir The application directory
*/
@@ -964,7 +965,7 @@ public final class HttpServer2 implements FilterContainer {
LOG.info("Added global filter '" + name + "' (class=" + classname + ")");
}
- /**
+ /*
* Define a filter for a context and set up default url mappings.
*/
public static void defineFilter(ServletContextHandler ctx, String name,
@@ -974,7 +975,7 @@ public final class HttpServer2 implements FilterContainer {
defineFilter(ctx, filterHolder, fmap);
}
- /**
+ /*
* Define a filter for a context and set up default url mappings.
*/
private static void defineFilter(ServletContextHandler ctx,
@@ -1076,6 +1077,7 @@ public final class HttpServer2 implements FilterContainer {
/**
* Get the address that corresponds to a particular connector.
*
+ * @param index index of the connector
* @return the corresponding address for the connector, or null if there's no
* such connector or the connector is not bounded or was closed.
*/
@@ -1094,7 +1096,7 @@ public final class HttpServer2 implements FilterContainer {
return new InetSocketAddress(c.getHost(), c.getLocalPort());
}
- /**
+ /*
* Set the min, max number of worker threads (simultaneous connections).
*/
public void setThreads(int min, int max) {
@@ -1120,7 +1122,7 @@ public final class HttpServer2 implements FilterContainer {
AuthenticationFilter.class.getName(), params, null);
}
- /**
+ /*
* Start the server. Does not wait for the server to start.
*/
public void start() throws IOException {
@@ -1276,7 +1278,7 @@ public final class HttpServer2 implements FilterContainer {
}
}
- /**
+ /*
* stop the server
*/
public void stop() throws Exception {
@@ -1364,7 +1366,8 @@ public final class HttpServer2 implements FilterContainer {
* @param servletContext the servlet context.
* @param request the servlet request.
* @param response the servlet response.
- * @return TRUE/FALSE based on the logic decribed above.
+ * @return TRUE/FALSE based on the logic described above.
+ * @throws IOException exception on error
*/
public static boolean isInstrumentationAccessAllowed(
ServletContext servletContext, HttpServletRequest request,
@@ -1386,6 +1389,8 @@ public final class HttpServer2 implements FilterContainer {
* Does the user sending the HttpServletRequest has the administrator ACLs? If
* it isn't the case, response will be modified to send an error to the user.
*
+ * @param servletContext the servlet context.
+ * @param request the servlet request.
* @param response used to send the error response if user does not have admin access.
* @return true if admin-authorized, false otherwise
* @throws IOException exception on error