Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(171)

Issue 1696056: Refactor proxy handler, part #1: remove ProxyBase (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 5 months ago by johnfargo
Modified:
15 years, 5 months ago
Reviewers:
gagan.goku, dev-remailer, zhoresh
Base URL:
http://svn.apache.org/repos/asf/shindig/trunk/
Visibility:
Public.

Description

First phase in getting rid of the confusing ProxyBase class. All its methods are stateless helpers, and its constants are replaced with UriCommon.Param enums. 1. Removes ProxyBase and for the most part puts its helper methods into a new util wrapper, ServletUtil. 2. Replaces helper method use with ServletUtil calls, in MakeRequest and Proxy handlers. 3. Modifies ProxyHandler to deal with HttpRequest/HttpResponse rather than Http[Servlet]Request/Response. This is a big motivator for this change, moving closer to making ProxyHandler accessible easily via JSON-RPC as well as direct HTTP request. 4. In support of #3, adds ServletUtil methods converting between HttpServletRequest and HttpRequest, and HttpResponse to HttpServletResponse. 5. Adds, but does not use, ServletUtil method converting an HttpResponse into a JSON-style HttpResponse with dataUri field and metadata.

Patch Set 1 #

Total comments: 5

Patch Set 2 : Refactoring, per discussion w/ Ziv. This is a much more significant change, and bears a closer look. #

Patch Set 3 : Committed small UriCommon CL; many fewer files now in this patch. #

Total comments: 4

Patch Set 4 : Sync w/ @head, removed datauri_proxy.html page. Haven't removed JSON stuff yet (pre-submit) #

Patch Set 5 : Oops, removing a few more UriCommon.Param-only changes. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+1088 lines, -851 lines) Patch
content/container/datauri_proxy.html View 1 chunk +51 lines, -0 lines 1 comment Download
java/common/src/main/java/org/apache/shindig/common/servlet/HttpUtil.java View 2 3 2 chunks +22 lines, -7 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/AccelHandler.java View 2 3 10 chunks +15 lines, -15 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/HtmlAccelServlet.java View 2 3 2 chunks +14 lines, -2 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestHandler.java View 2 3 10 chunks +67 lines, -16 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/MakeRequestServlet.java View 2 3 2 chunks +10 lines, -1 line 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyBase.java View 2 3 1 chunk +0 lines, -205 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyHandler.java View 1 2 3 3 chunks +75 lines, -54 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyServlet.java View 2 3 3 chunks +19 lines, -3 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java View 1 chunk +209 lines, -0 lines 0 comments Download
java/gadgets/src/main/java/org/apache/shindig/gadgets/uri/UriUtils.java View 2 3 7 chunks +29 lines, -41 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/HtmlAccelServletTest.java View 2 3 3 chunks +5 lines, -0 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/MakeRequestHandlerTest.java View 2 3 7 chunks +125 lines, -5 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/MakeRequestServletTest.java View 2 3 2 chunks +2 lines, -1 line 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyBaseTest.java View 2 3 1 chunk +0 lines, -252 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyHandlerTest.java View 1 2 3 14 chunks +108 lines, -118 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java View 2 3 7 chunks +34 lines, -17 lines 1 comment Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ServletUtilTest.java View 1 chunk +239 lines, -0 lines 0 comments Download
java/gadgets/src/test/java/org/apache/shindig/gadgets/uri/UriUtilsTest.java View 2 3 8 chunks +64 lines, -114 lines 0 comments Download

Messages

Total messages: 17
johnfargo
15 years, 5 months ago (2010-07-24 00:59:17 UTC) #1
gagan.goku
Nice change :) Small nits: http://codereview.appspot.com/1696056/diff/1/3 File java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyHandler.java (left): http://codereview.appspot.com/1696056/diff/1/3#oldcode140 java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ProxyHandler.java:140: for (Map.Entry<String, String> entry ...
15 years, 5 months ago (2010-07-24 04:11:22 UTC) #2
zhoresh
Code looks nice but I would argue that this data should be served by the ...
15 years, 5 months ago (2010-07-26 20:34:50 UTC) #3
johnfargo
That seems reasonable to me: one place for all "new" metadata-driven APIs. This is consistent ...
15 years, 5 months ago (2010-07-26 20:43:36 UTC) #4
johnfargo
Refactoring, per discussion w/ Ziv. This is a much more significant change, and bears a ...
15 years, 5 months ago (2010-08-02 19:09:09 UTC) #5
gagan.goku
On 2010/08/02 19:09:09, johnfargo wrote: > Refactoring, per discussion w/ Ziv. This is a much ...
15 years, 5 months ago (2010-08-02 20:09:58 UTC) #6
johnfargo
Moved UriCommon.Param-only files to: http://codereview.appspot.com/1883046/show On 2010/08/02 20:09:58, gagan.goku wrote: > On 2010/08/02 19:09:09, johnfargo ...
15 years, 5 months ago (2010-08-02 21:06:29 UTC) #7
johnfargo
Committed small UriCommon CL; many fewer files now in this patch.
15 years, 5 months ago (2010-08-02 21:15:43 UTC) #8
zhoresh
Here couple preliminary comments, I will continue http://codereview.appspot.com/1696056/diff/36001/8012 File java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/AccelHandler.java (right): http://codereview.appspot.com/1696056/diff/36001/8012#newcode112 java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/AccelHandler.java:112: ByteArrayOutputStream baos ...
15 years, 5 months ago (2010-08-02 22:21:55 UTC) #9
zhoresh
http://codereview.appspot.com/1696056/diff/36001/8015 File java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java (right): http://codereview.appspot.com/1696056/diff/36001/8015#newcode166 java/gadgets/src/main/java/org/apache/shindig/gadgets/servlet/ServletUtil.java:166: ByteArrayOutputStream os = new ByteArrayOutputStream(); Maybe it is an ...
15 years, 5 months ago (2010-08-03 00:39:01 UTC) #10
johnfargo
On Mon, Aug 2, 2010 at 3:21 PM, <zhoresh@gmail.com> wrote: > Here couple preliminary comments, ...
15 years, 5 months ago (2010-08-03 01:09:27 UTC) #11
johnfargo
I was going to use JSONObject, but preferred this mechanism since it allows for streaming ...
15 years, 5 months ago (2010-08-03 01:10:13 UTC) #12
johnfargo
On Mon, Aug 2, 2010 at 1:09 PM, <gagan.goku@gmail.com> wrote: > On 2010/08/02 19:09:09, johnfargo ...
15 years, 5 months ago (2010-08-03 01:13:12 UTC) #13
johnfargo
Sync w/ @head, removed datauri_proxy.html page. Haven't removed JSON stuff yet (pre-submit)
15 years, 5 months ago (2010-08-03 01:26:21 UTC) #14
johnfargo
Oops, removing a few more UriCommon.Param-only changes.
15 years, 5 months ago (2010-08-03 01:29:15 UTC) #15
zhoresh
lgtm http://codereview.appspot.com/1696056/diff/53001/54019 File content/container/datauri_proxy.html (right): http://codereview.appspot.com/1696056/diff/53001/54019#newcode1 content/container/datauri_proxy.html:1: <html> I assume this is not part of ...
15 years, 5 months ago (2010-08-03 23:04:41 UTC) #16
johnfargo
15 years, 5 months ago (2010-08-04 00:10:43 UTC) #17
On Tue, Aug 3, 2010 at 4:04 PM, <zhoresh@gmail.com> wrote:

> lgtm
>
>
> http://codereview.appspot.com/1696056/diff/53001/54019
> File content/container/datauri_proxy.html (right):
>
> http://codereview.appspot.com/1696056/diff/53001/54019#newcode1
> content/container/datauri_proxy.html:1: <html>
> I assume this is not part of the change
>

True, will be removed from the change before commit.


>
> http://codereview.appspot.com/1696056/diff/53001/54007
> File
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java
> (right):
>
> http://codereview.appspot.com/1696056/diff/53001/54007#newcode93
>
>
java/gadgets/src/test/java/org/apache/shindig/gadgets/servlet/ProxyServletTest.java:93:
> Capture<HttpRequest> requestCapture = new Capture<HttpRequest>();
> Add check to verify what you capture


Done. Committing!


>
>
> http://codereview.appspot.com/1696056/show
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b