This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch 3.0.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit a1bd10889f6b0286036e165d477020cc3fac1384
Author: nichunen <n...@apache.org>
AuthorDate: Fri Jan 10 21:51:03 2020 +0800

    Encrept response output for BroadcasterReceiveServlet
---
 .../broadcaster/BroadcasterReceiveServlet.java     | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git 
a/server-base/src/main/java/org/apache/kylin/rest/broadcaster/BroadcasterReceiveServlet.java
 
b/server-base/src/main/java/org/apache/kylin/rest/broadcaster/BroadcasterReceiveServlet.java
index a277cf3..8450f7a 100644
--- 
a/server-base/src/main/java/org/apache/kylin/rest/broadcaster/BroadcasterReceiveServlet.java
+++ 
b/server-base/src/main/java/org/apache/kylin/rest/broadcaster/BroadcasterReceiveServlet.java
@@ -28,26 +28,21 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.kylin.common.util.EncryptUtil;
+
 /**
  */
 public class BroadcasterReceiveServlet extends HttpServlet {
 
     private static final long serialVersionUID = 1L;
-
-    public interface BroadcasterHandler {
-
-        void handle(String type, String name, String event);
-    }
-
+    private static final Pattern PATTERN = Pattern.compile("/(.+)/(.+)/(.+)");
+    private static final Pattern PATTERN2 = Pattern.compile("/(.+)/(.+)");
     private final BroadcasterHandler handler;
 
     public BroadcasterReceiveServlet(BroadcasterHandler handler) {
         this.handler = handler;
     }
 
-    private static final Pattern PATTERN = Pattern.compile("/(.+)/(.+)/(.+)");
-    private static final Pattern PATTERN2 = Pattern.compile("/(.+)/(.+)");
-
     @Override
     protected void doPut(HttpServletRequest req, HttpServletResponse resp) 
throws IOException {
         handle(req, resp);
@@ -72,7 +67,8 @@ public class BroadcasterReceiveServlet extends HttpServlet {
             if (handler != null) {
                 handler.handle(type, cacheKey, event);
             }
-            resp.getWriter().write("type:" + type + " name:" + cacheKey + " 
event:" + event);
+            resp.getWriter().write("Encrypted(type:" + 
EncryptUtil.encrypt(type) + " name:" + EncryptUtil.encrypt(cacheKey)
+                    + " event:" + EncryptUtil.encrypt(event) + ")");
         } else if (matcher2.matches()) {
             String type = matcher2.group(1);
             String event = matcher2.group(2);
@@ -82,10 +78,16 @@ public class BroadcasterReceiveServlet extends HttpServlet {
             if (handler != null) {
                 handler.handle(type, cacheKey, event);
             }
-            resp.getWriter().write("type:" + type + " name:" + cacheKey + " 
event:" + event);
+            resp.getWriter().write("Encrypted(type:" + 
EncryptUtil.encrypt(type) + " name:" + EncryptUtil.encrypt(cacheKey)
+                    + " event:" + EncryptUtil.encrypt(event) + ")");
         } else {
             resp.getWriter().write("not valid uri");
         }
         resp.getWriter().close();
     }
+
+    public interface BroadcasterHandler {
+
+        void handle(String type, String name, String event);
+    }
 }

Reply via email to