Interface IAppService


public interface IAppService
  • Method Details

    • getLoggedInNotificationToken

      Optional<String> getLoggedInNotificationToken()
      Gets the notification token from the current logged in device. (Scope of the request)
      Returns:
      notification token from the current logged in device
    • getLoggedInProfileRegistration

      Optional<IProfileRegistrationInfo> getLoggedInProfileRegistration()
      Gets the profile registration of the current logged in device. (Scope of the request)
      Returns:
      profile registration of the current logged in device
    • getNewRegistrationId

      String getNewRegistrationId()
      Generates a registration ID.
      Returns:
      the string representation of a newly generated registration ID
    • getToken

      String getToken(String registrationId)
      Creates a token based on the registration.
      Parameters:
      registrationId - the ID to bind to the token
      Returns:
      token based on registrationId
    • getSagaUrl

      String getSagaUrl()
      Gets the current Saga installation URL. This is based on the app.saga-base-url property.
      Returns:
      current Saga URL
    • getProfileConfigurations

      List<IProfileConfiguration> getProfileConfigurations()
      Gets all mobile profile configurations.
      Returns:
      list with profile configurations
    • getProfileRegistrations

      List<IProfileRegistrationInfo> getProfileRegistrations()
      Gets all the profile registrations saved in the database.
      Returns:
      list with profile registrations
    • getActiveProfileRegistrations

      List<IProfileRegistrationInfo> getActiveProfileRegistrations()
      Gets all profile registrations saved in the database which are not expired.
      Returns:
      list with profile registrations
    • getProfileRegistration

      Optional<IProfileRegistrationInfo> getProfileRegistration(String registrationId)
      Gets the profile registration by registration ID.
      Returns:
      optional profile registration with the requested registration ID
    • getProfileRegistrationsByUser

      List<IProfileRegistrationInfo> getProfileRegistrationsByUser(User user)
      Gets all the profile registrations that is associated with a given user.
      Returns:
      list with profile registrations with the requested user
    • createProfileRegistration

      IProfileRegistrationInfo createProfileRegistration(String profileId, User user)
      Creates and saves to the database a new profile registration.
      Parameters:
      profileId - profile ID used to generate the profile registration
      user - the user to be used for the profile registration
      Returns:
      a copy of the profile registration that was saved into the database
    • createProfileRegistration

      IProfileRegistrationInfo createProfileRegistration(String profileId, User user, ZonedDateTime validUntil)
      Creates and saves to the database a new profile registration.
      Parameters:
      profileId - profile ID used to generate the profile registration
      user - the user to be used for the profile registration
      validUntil - profile is valid until this date
      Returns:
      a copy of the profile registration that was saved into the database
    • updateProfileRegistration

      void updateProfileRegistration(IProfileRegistrationInfo appRegistrationInfo)
      Update the profile registration with new registration info.
      Parameters:
      appRegistrationInfo - profile registration to be updated
    • deleteProfileRegistration

      void deleteProfileRegistration(String registrationId)
      Deletes profile registrations associated with the registration ID.
      Parameters:
      registrationId - registration ID to delete registrations for
    • getNotificationToken

      @Deprecated default Optional<String> getNotificationToken()
      Deprecated.
      As of release 2022081900.1.0, replaced by getLoggedInNotificationToken()
      Get the current users notification token.
      Returns:
      an optional containing the notification token of the currently logged in user, if any
    • getCurrentProfileRegistration

      @Deprecated default Optional<IProfileRegistrationInfo> getCurrentProfileRegistration()
      Deprecated.
      As of release 2022081900.1.0, replaced by getLoggedInProfileRegistration()
      Get the current users profile registration.
      Returns:
      an optional containing the current profile registration, if any
    • getApps

      @Deprecated default List<IAppConfiguration> getApps()
      Deprecated.
      As of release 2022081900.1.0, replaced by getProfileConfigurations()
      Get a list of all registered IAppConfigurations.
      Returns:
      list of all registered IAppConfigurations
    • getCurrentAppRegistration

      @Deprecated default Optional<AppRegistrationInfo> getCurrentAppRegistration()
      Deprecated.
      As of release 2022081900.1.0, replaced by getLoggedInProfileRegistration()
      Get the current AppRegistrationInfo.
      Returns:
      an optional containing the current AppRegistrationInfo, if any
    • getAppRegistrations

      @Deprecated default List<AppRegistrationInfo> getAppRegistrations()
      Deprecated.
      As of release 2022081900.1.0, replaced by getProfileRegistrations()
      Get a list of all registered AppRegistrationInfo.
      Returns:
      list of all registered AppRegistrationInfo
    • getAppRegistrationsByUser

      @Deprecated default List<AppRegistrationInfo> getAppRegistrationsByUser(User user)
      Deprecated.
      As of release 2022081900.1.0, replaced by getProfileRegistrationsByUser(User)
      Get a list of all registered AppRegistrationInfo for the given user.
      Parameters:
      user - the user to get the AppRegistrationInfo for
      Returns:
      list of all registered AppRegistrationInfo for the given user
    • createAppRegistration

      @Deprecated default void createAppRegistration(String appId, User user)
      Deprecated.
      As of release 2022081900.1.0, replaced by createProfileRegistration(String, User)
      Create a new app registration for the given user and saves it to the database.
      Parameters:
      appId - the app ID to create the registration for
      user - the user to create the registration for
    • deleteAppRegistration

      @Deprecated void deleteAppRegistration(String tokenId)
      Deprecated.
      As of release 2022081900.1.0, preferred replacement deleteProfileRegistration(String).
      Delete the app registration with the given token.
      Parameters:
      tokenId - the token ID of the app registration to delete
    • updateAppRegistration

      @Deprecated default void updateAppRegistration(AppRegistrationInfo appRegistrationInfo)
      Deprecated.
      As of release 2022081900.1.0, replaced by updateProfileRegistration(IProfileRegistrationInfo)
      Update the given app registration.
      Parameters:
      appRegistrationInfo - the app registration to update
    • getRegistrationUrl

      String getRegistrationUrl(String sagaurl, String tokenId)
      Generates registration URL with sagaUrl and token id
      Parameters:
      sagaurl - the current saga installation URL
      tokenId - the tokenId associated with the app registration
      Returns:
      registrationUrl the registration URL to add the profile to the app (can be put in a QR code)
    • isEnabled

      boolean isEnabled()
      Returns whether the app is enabled in the configuration.
      Returns:
      true if the app is enabled, false otherwise
    • getLastKnownLocation

      Optional<Location> getLastKnownLocation()