Package com.persequor.extension.user
Interface IAppService
public interface IAppService
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
createAppRegistration
(String appId, User user) Deprecated.createProfileRegistration
(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
deleteAppRegistration
(String tokenId) Deprecated.As of release 2022081900.1.0, preferred replacementdeleteProfileRegistration(String)
.void
deleteProfileRegistration
(String registrationId) Deletes profile registrations associated with the registration ID.Gets all profile registrations saved in the database which are not expired.default List<AppRegistrationInfo>
Deprecated.As of release 2022081900.1.0, replaced bygetProfileRegistrations()
default List<AppRegistrationInfo>
Deprecated.As of release 2022081900.1.0, replaced bygetProfileRegistrationsByUser(User)
default List<IAppConfiguration>
getApps()
Deprecated.As of release 2022081900.1.0, replaced bygetProfileConfigurations()
default Optional<AppRegistrationInfo>
Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInProfileRegistration()
default Optional<IProfileRegistrationInfo>
Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInProfileRegistration()
Gets the notification token from the current logged in device.Gets the profile registration of the current logged in device.Generates a registration ID.Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInNotificationToken()
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.default void
updateAppRegistration
(AppRegistrationInfo appRegistrationInfo) Deprecated.As of release 2022081900.1.0, replaced byupdateProfileRegistration(IProfileRegistrationInfo)
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
-
getNotificationToken
Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInNotificationToken()
Get the current users notification token.- Returns:
- an optional containing the notification token of the currently logged in user, if any
-
getCurrentProfileRegistration
Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInProfileRegistration()
Get the current users profile registration.- Returns:
- an optional containing the current profile registration, if any
-
getApps
Deprecated.As of release 2022081900.1.0, replaced bygetProfileConfigurations()
Get a list of all registered IAppConfigurations.- Returns:
- list of all registered IAppConfigurations
-
getCurrentAppRegistration
Deprecated.As of release 2022081900.1.0, replaced bygetLoggedInProfileRegistration()
Get the current AppRegistrationInfo.- Returns:
- an optional containing the current AppRegistrationInfo, if any
-
getAppRegistrations
Deprecated.As of release 2022081900.1.0, replaced bygetProfileRegistrations()
Get a list of all registered AppRegistrationInfo.- Returns:
- list of all registered AppRegistrationInfo
-
getAppRegistrationsByUser
Deprecated.As of release 2022081900.1.0, replaced bygetProfileRegistrationsByUser(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.As of release 2022081900.1.0, replaced bycreateProfileRegistration(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 foruser
- the user to create the registration for
-
deleteAppRegistration
Deprecated.As of release 2022081900.1.0, preferred replacementdeleteProfileRegistration(String)
.Delete the app registration with the given token.- Parameters:
tokenId
- the token ID of the app registration to delete
-
updateAppRegistration
Deprecated.As of release 2022081900.1.0, replaced byupdateProfileRegistration(IProfileRegistrationInfo)
Update the given app registration.- Parameters:
appRegistrationInfo
- the app registration to update
-
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.- Returns:
- true if the app is enabled, false otherwise
-
getLastKnownLocation
-
createProfileRegistration(String, User)