[NO ISSUE][OTH] Extensible Servlet Requests
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
- Allow extentions to create their own Servlet Requests
in http servers.
Change-Id: I71eeaaaf4fb30a51059b9cf6399c19bcec6b40ec
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/5306
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
Reviewed-by: Michael Blow <mblow@apache.org>
diff --git a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
index 0f4ce8a..77d3493 100644
--- a/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
+++ b/hyracks-fullstack/hyracks/hyracks-http/src/main/java/org/apache/hyracks/http/server/HttpServerHandler.java
@@ -146,7 +146,7 @@
HttpScheme scheme =
server.getScheme() == HttpScheme.HTTPS || "https".equals(request.headers().get(X_FORWARDED_PROTO))
? HttpScheme.HTTPS : HttpScheme.HTTP;
- servletRequest = HttpUtil.toServletRequest(ctx, request, scheme);
+ servletRequest = createServletRequest(ctx, request, scheme);
} catch (IllegalArgumentException e) {
LOGGER.log(Level.WARN, "Failure Decoding Request", e);
respond(ctx, request, HttpResponseStatus.BAD_REQUEST);
@@ -174,6 +174,11 @@
response -> response.headers().set(HttpUtil.PERMANENT, "true"));
}
+ protected IServletRequest createServletRequest(ChannelHandlerContext ctx, FullHttpRequest request,
+ HttpScheme scheme) {
+ return HttpUtil.toServletRequest(ctx, request, scheme);
+ }
+
@Override
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
LOGGER.log(Level.WARN, "Failure handling HTTP Request", cause);