Package com.persequor.extension.user
Interface IAppService
public interface IAppService
-
Method Summary
Modifier and TypeMethodDescriptioncreateProfileRegistration
(String profileId, User user) Creates and saves to the database a new profile registration.createProfileRegistration
(String profileId, User user, ZonedDateTime validUntil) Creates and saves to the database a new profile registration.void
deleteProfileRegistration
(String registrationId) Deletes profile registrations associated with the registration ID.Gets all profile registrations saved in the database which are not expired.Gets the notification token from the current logged in device.Gets the profile registration of the current logged in device.Generates a registration ID.Gets all mobile profile configurations.getProfileRegistration
(String registrationId) Gets the profile registration by registration ID.Gets all the profile registrations saved in the database.Gets all the profile registrations that is associated with a given user.getRegistrationUrl
(String sagaurl, String tokenId) Generates registration URL with sagaUrl and token idGets the current Saga installation URL.Creates a token based on the registration.boolean
Returns whether the app is enabled in the configuration in the current/active space.void
updateProfileRegistration
(IProfileRegistrationInfo appRegistrationInfo) Update the profile registration with new registration info.
-
Method Details
-
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
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
Gets the profile registration by registration ID.- Returns:
- optional profile registration with the requested registration ID
-
getProfileRegistrationsByUser
Gets all the profile registrations that is associated with a given user.- Returns:
- list with profile registrations with the requested user
-
createProfileRegistration
Creates and saves to the database a new profile registration.- Parameters:
profileId
- profile ID used to generate the profile registrationuser
- 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 registrationuser
- the user to be used for the profile registrationvalidUntil
- profile is valid until this date- Returns:
- a copy of the profile registration that was saved into the database
-
updateProfileRegistration
Update the profile registration with new registration info.- Parameters:
appRegistrationInfo
- profile registration to be updated
-
deleteProfileRegistration
Deletes profile registrations associated with the registration ID.- Parameters:
registrationId
- registration ID to delete registrations for
-
getRegistrationUrl
Generates registration URL with sagaUrl and token id- Parameters:
sagaurl
- the current saga installation URLtokenId
- 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
-