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
    • 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 in the current/active space.
      Returns:
      true if the app is enabled, false otherwise
    • getLastKnownLocation

      Optional<Location> getLastKnownLocation()