@GET
    @Path("history")
    public List<APIConnectionRecord> 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;

    }

    /**
     * Returns a resource which provides read-only access to the subset of
     * SharingProfiles that the current user can use to share this connection.
     *
     * @return
     *     A resource which provides read-only access to the subset of
     *     SharingProfiles that the current user can use to share this
     *     connection.
     *
     * @throws GuacamoleException
     *     If the SharingProfiles associated with this connection cannot be
     *     retrieved.
     */
    @Path("sharingProfiles")
    public DirectoryResource<SharingProfile, APISharingProfile>
            getSharingProfileDirectoryResource() throws GuacamoleException {

        // Produce subset of all SharingProfiles, containing only those which
        // are associated with this connection
        Directory<SharingProfile> sharingProfiles = new DirectoryView<SharingProfile>(
            userContext.getSharingProfileDirectory(),
            connection.getSharingProfileIdentifiers()
        );

        // Return a new resource which provides access to only those SharingProfiles
        return sharingProfileDirectoryResourceFactory.create(userContext, sharingProfiles);

    }

}
@ GET @ Path ( "history" ) public List < APIConnectionRecord > getConnectionHistory ( ) throws GuacamoleException { List < APIConnectionRecord > apiRecords = new ArrayList < APIConnectionRecord > ( ) ; for ( ConnectionRecord record : connection . getHistory ( ) ) apiRecords . add ( new APIConnectionRecord ( record ) ) ; return apiRecords ; } @ Path ( "sharingProfiles" ) public DirectoryResource < SharingProfile , APISharingProfile > getSharingProfileDirectoryResource ( ) throws GuacamoleException { Directory < SharingProfile > sharingProfiles = new DirectoryView < SharingProfile > ( userContext . getSharingProfileDirectory ( ) , connection . getSharingProfileIdentifiers ( ) ) ; return sharingProfileDirectoryResourceFactory . create ( userContext , sharingProfiles ) ; } }
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.