mike-jumper commented on a change in pull request #546:
URL: https://github.com/apache/guacamole-client/pull/546#discussion_r512937584



##########
File path: guacamole-ext/src/main/java/org/apache/guacamole/net/auth/User.java
##########
@@ -103,7 +103,26 @@
      *     If an error occurs while reading the history of this user, or if
      *     permission is denied.
      */
+    @Deprecated

Review comment:
       If we have something like:
   
   ```java
   public interface User {
   
       ...
   
       @Deprecated
       default List<? extends ActivityRecord> getHistory() throws 
GuacamoleException {
           return Collections.emptyList();
       }
   
       ActivityRecordSet<ActivityRecord> getUserHistory() throws 
GuacamoleException {
            return new SomeSortOfSimpleActivityRecordSet<>(getHistory());
       }
   
       ...
   
   }
   ```
   
   Then we end up with:
   
   | Extension implements... | Result |
   | -------------- | ------ |
   | Only `getHistory()` (older extension) | Webapp invokes `getUserHistory()` 
which calls `getHistory()` by default and works as expected. |
   | Only `getUserHistory()` (newer extension) | Webapp invokes 
`getUserHistory()` which works as expected. If an older extension decorates 
`User` objects and attempts to do something with `getHistory()`, it will not 
have any effect and may behave as if history is unimplemented. |
   | Both (masochistic extension) | All calls to history-related functions work 
as expected. |
   | Neither | Calls to either `getUserHistory()` or `getHistory()` have the 
same result: empty set of records |
   
   That seems OK except for the case of inter-extension calling of the older 
`getHistory()` function.




----------------------------------------------------------------
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]


Reply via email to