mike-jumper commented on a change in pull request #449: Modify the start time 
of the history session to match the GUAC_DATE and GUAC_TIME in the parameter 
tokens
URL: https://github.com/apache/guacamole-client/pull/449#discussion_r334257229
 
 

 ##########
 File path: 
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/tunnel/AbstractGuacamoleTunnelService.java
 ##########
 @@ -392,7 +395,29 @@ private GuacamoleSocket getUnconfiguredGuacamoleSocket(
         public ConnectionCleanupTask(ActiveConnectionRecord activeConnection) {
             this.activeConnection = activeConnection;
         }
-        
+
+
+
+        /***
+         * @Author zero
+         * @Description 将活动会话记录里的 会话开始时间变更为GUAC_DATE,GUAC_TIME
+         * @InitDate 10:53 2019/10/12
+         * @Param [activeConnection, tokens]
+         **/
+        public ConnectionCleanupTask(ActiveConnectionRecord 
activeConnection,Map<String ,String > tokens) {
+            this.activeConnection = activeConnection;
+
+            String yearMonthDay = tokens.get("GUAC_DATE");
+            String hourMinSecMs = tokens.get("GUAC_TIME");
+            SimpleDateFormat simpleDateFormat=new 
SimpleDateFormat("yyyyMMddHHmmss-SSS");
+
+            try {
+                
activeConnection.setStartDate(simpleDateFormat.parse(yearMonthDay+hourMinSecMs));
+            } catch (ParseException e) {
+                e.printStackTrace();
 
 Review comment:
   Exceptions should be handled either by being properly logged with a `Logger` 
at an appropriate log level, or internally in such a way that logging is 
unnecessary. Calls to `e.printStackTrace()` should not be found in production 
code.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to