@SuppressWarnings("deprecation")
    @Path("history")
    public UserHistoryResource getUserHistory()
            throws GuacamoleException {

        User user = getInternalObject();

        // First try to retrieve history using the current getUserHistory() method.
        try {
            return new UserHistoryResource(user.getUserHistory());
        }
        catch (GuacamoleUnsupportedException e) {
            logger.debug("Call to getUserHistory() is unsupported, falling back to deprecated method getHistory().", e);
        }
        
        // Fall back to deprecated getHistory() method.
        try {
            return new UserHistoryResource(new SimpleActivityRecordSet<>(user.getHistory()));
        }
        catch (GuacamoleUnsupportedException e) {
            logger.debug("Call to getHistory() is unsupported, no user history records will be returned.", e);
        }
        
        // If both are unimplemented, return an empty history set.
        return new UserHistoryResource(new SimpleActivityRecordSet<>());

    }
Retrieves the login (session) history of a single user.

@return
    A list of activity records, describing the start and end times of
    this user's sessions.

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