arjun4084346 commented on a change in pull request #2969:
URL: https://github.com/apache/incubator-gobblin/pull/2969#discussion_r416683094



##########
File path: 
gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/RequesterService.java
##########
@@ -50,22 +55,27 @@ public RequesterService(Config config) {
    */
   public static String serialize(List<ServiceRequester> requesterList) throws 
IOException {
     String jsonList = objectMapper.writeValueAsString(requesterList);
-    String base64Str = 
Base64.getEncoder().encodeToString(jsonList.getBytes("UTF-8"));
-    return URLEncoder.encode(base64Str, "UTF-8");
+    String base64Str = 
Base64.getEncoder().encodeToString(jsonList.getBytes(StandardCharsets.UTF_8));
+    return URLEncoder.encode(base64Str, StandardCharsets.UTF_8.name());
   }
 
   /**
    * <p> This implementation decode a given string encoded by
    * {@link #serialize(List)}.
    */
   public static List<ServiceRequester> deserialize(String encodedString) 
throws IOException {
-    String base64Str = URLDecoder.decode(encodedString, "UTF-8");
+    String base64Str = URLDecoder.decode(encodedString, 
StandardCharsets.UTF_8.name());
     byte[] decodedBytes = Base64.getDecoder().decode(base64Str);
-    String jsonList = new String(decodedBytes, "UTF-8");
+    String jsonList = new String(decodedBytes, StandardCharsets.UTF_8);
     TypeReference<List<ServiceRequester>> mapType = new 
TypeReference<List<ServiceRequester>>() {};
-    List<ServiceRequester> requesterList = objectMapper.readValue(jsonList, 
mapType);
-    return requesterList;
+    return objectMapper.readValue(jsonList, mapType);
   }
 
   protected abstract List<ServiceRequester> findRequesters(BaseResource 
resource);
+
+  /**
+   * This method should throw {@link FlowConfigLoggedException}, if the 
requester is not allowed to make this request.
+   */
+  protected abstract void requesterAllowed(List<ServiceRequester> 
originalRequesterList,

Review comment:
       How about now?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to