Interface IUserLocationHistory

All Known Implementing Classes:
UserLocationHistory

public interface IUserLocationHistory
The interface for the user location history.
Author:
Christopher Mindus
  • Method Details

    • getUserInformation

      IAuthenticatedUser getUserInformation()
      Returns the authenticated user.
      Returns:
      The user.
    • getLocations

      DeviceLocation[] getLocations()
      Returns the array of user locations.
      Returns:
      The array of user locations.
    • getLatestLocation

      DeviceLocation getLatestLocation()
      Returns the latest known location of the user received by the server (approximation). Two locations with very close timestamp might be interchanged. This method returns the last added location from an array of locations.
      Returns:
      The most up-to-date location of the user, or null if none is found.
    • findNearbyUsers

      default List<Nearby> findNearbyUsers(long maximumDistance, long maximumAge)
      Finds nearby users from the latest known location in history with a max given distance and a maximum age of the users location. The distance does not take the locations altitude into account.

      The distance uses the Haversine method for calculation.

      Parameters:
      maximumDistance - The maximum distance in meters.
      maximumAge - The maximum age of the users location in milliseconds.
      Returns:
      A list of nearby users. Do not assume that the list is sorted by timestamp.
    • findNearbyUsers

      List<Nearby> findNearbyUsers(double maximumDistance, long maximumAge, boolean useAltitude)
      Finds nearby users from the latest known location in history with a max given distance and a maximum age of the users location.

      The distance uses the Haversine method for calculation.

      Parameters:
      maximumDistance - The maximum distance in meters.
      maximumAge - The maximum age of the users location in milliseconds.
      useAltitude - Flag to use the altitude in the distance calculation or not.
      Returns:
      A list of nearby users. Do not assume that the list is sorted by timestamp.
    • addLocationListener

      boolean addLocationListener(IAppSessionGyro appGyro, IUserLocationListener listener)
      Adds a listener for changes in the user's location. This method will add a dispose listener to the client session and remove the listener if not already done.

      Calling this method twice with the same listener will not cause it to be added again.

      Parameters:
      appGyro - The client session owning the listener.
      listener - The listener.
      Returns:
      true for success, false if listener is already added or if client session is disposed of.
    • addLocationListener

      boolean addLocationListener(IClientSessionGyro clientGyro, IUserLocationListener listener)
      Adds a listener for changes in the user's location. This method will add a dispose listener to the client session and remove the listener if not already done.

      Calling this method twice with the same listener will not cause it to be added again.

      Parameters:
      clientGyro - The client session owning the listener.
      listener - The listener.
      Returns:
      true for success, false if listener is already added or if client session is disposed of.
    • removeLocationListener

      boolean removeLocationListener(IUserLocationListener listener)
      Removes a listener for changes in the user's location.
      Parameters:
      listener - The listener.
      Returns:
      true for success, false if listener is not previously added or has been removed.