@SuppressWarnings("deprecation")
    @Path("history")
    public ConnectionHistoryResource getConnectionHistory()
            throws GuacamoleException {

        Connection connection = getInternalObject();

        // Try the current getConnectionHistory() method, first, for connection history.
        try {
            return new ConnectionHistoryResource(connection.getConnectionHistory()
                    .sort(ActivityRecordSet.SortableProperty.START_DATE, true));
        }
        catch (GuacamoleUnsupportedException e) {
            logger.debug("Call to getConnectionHistory() is unsupported, falling back to getHistory().", e);
        }
        
        // Fall back to the deprecated getHistory() method.
        try {
            return new ConnectionHistoryResource(new SimpleActivityRecordSet<>(connection.getHistory()));
        }
        catch (GuacamoleUnsupportedException e) {
            logger.debug("Call to getHistory() is unsupported, no connection history records will be returned.", e);
        }
        
        // If all fails, return an empty connection history set.
        return new ConnectionHistoryResource(new SimpleActivityRecordSet<>());

    }
Retrieves the usage history of a single connection.

@return
    A list of connection records, describing the start and end times of
    various usages of this connection.

@throws GuacamoleException
    If an error occurs while retrieving the connection history.
guacamole/src/main/java/org/apache/guacamole/rest/connection/ConnectionResource.java