necouchman commented on a change in pull request #546:
URL: https://github.com/apache/guacamole-client/pull/546#discussion_r513459416
##########
File path:
guacamole/src/main/java/org/apache/guacamole/rest/connection/ConnectionResource.java
##########
@@ -150,18 +149,16 @@ public ConnectionResource(@Assisted UserContext
userContext,
* @throws GuacamoleException
* If an error occurs while retrieving the connection history.
*/
- @GET
@Path("history")
- public List<APIConnectionRecord> getConnectionHistory()
+ public ConnectionHistoryResource getConnectionHistory()
throws GuacamoleException {
- // Retrieve the requested connection's history
- List<APIConnectionRecord> apiRecords = new
ArrayList<APIConnectionRecord>();
- for (ConnectionRecord record : connection.getHistory())
- apiRecords.add(new APIConnectionRecord(record));
-
- // Return the converted history
- return apiRecords;
+ try {
+ return new
ConnectionHistoryResource(connection.getConnectionHistory());
+ }
+ catch (GuacamoleUnsupportedException e) {
+ return new ConnectionHistoryResource(new
SimpleActivityRecordSet<>());
+ }
Review comment:
Yeah, I think I'm finally starting to get my brain around handling all
of the compatibility across implementations. I see what you're saying, and I'll
take a shot at tweaking it to your suggestion, here, and punching up the
documentation to cover it.
I _think_ that covers all the scenarios, but I'll also try to go over
possibilities in my mind and make sure there aren't any corner cases that
haven't been considered that would fail in such a scenario.
----------------------------------------------------------------
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]