public class FRAClient
extends java.lang.Object
To create a new FRAClient object use the static builder().
| Modifier and Type | Class and Description |
|---|---|
static class |
FRAClient.FRAClientBuilder
The asynchronous Authenticator client builder.
|
| Modifier and Type | Method and Description |
|---|---|
static FRAClient.FRAClientBuilder |
builder()
Obtain FRAClient builder.
|
void |
createMechanismFromUri(java.lang.String uri,
FRAListener<Mechanism> listener)
Create a Mechanism using the URL extracted from the QRCode.
|
Account |
getAccount(Mechanism mechanism)
Get the Account object with its associated Mechanism.
|
Account |
getAccount(java.lang.String accountId)
Get the Account object with its id.
|
java.util.List<Account> |
getAllAccounts()
Get all accounts stored in the system.
|
java.util.List<PushNotification> |
getAllNotifications()
Get single list of notifications across all mechanisms.
|
java.util.List<PushNotification> |
getAllNotifications(Mechanism mechanism)
Get all of the notifications that belong to a
PushMechanism object. |
Mechanism |
getMechanism(PushNotification notification)
Get the Mechanism object associated with the PushNotification object.
|
PushNotification |
getNotification(java.lang.String notificationId)
Get the PushNotification object with its id.
|
PushNotification |
handleMessage(RemoteMessage message)
Receives a FCM remote message and covert into a
PushNotification object,
which allows accept or deny Push Authentication requests. |
PushNotification |
handleMessage(java.lang.String messageId,
java.lang.String message)
Receives the parameters from a FCM remote message and covert into a
PushNotification
object, which allows accept or deny Push Authentication requests. |
void |
registerForRemoteNotifications(java.lang.String deviceToken)
This method allows to register the FCM device token to handle Push mechanisms after the
SDK initialization.
|
boolean |
removeAccount(Account account)
Remove from the storage the
Account that was passed in, all Mechanism objects
and any PushNotification objects associated with it. |
boolean |
removeMechanism(Mechanism mechanism)
Remove from the storage the
Mechanism that was passed in and any notifications
associated with it. |
boolean |
removeNotification(PushNotification notification)
Remove from the storage the
PushNotification that was passed in. |
boolean |
updateAccount(Account account)
Update the
Account object the storage system. |
public static FRAClient.FRAClientBuilder builder()
public void createMechanismFromUri(java.lang.String uri,
FRAListener<Mechanism> listener)
uri - The URI extracted from the QRCodelistener - Callback for receiving the mechanism registration resultpublic java.util.List<Account> getAllAccounts()
null if no Account could be found.
This method full initialize the Mechanism and/or PushNotification objects
associated with the accounts.public Account getAccount(java.lang.String accountId)
null if Account could not be found.
This method full initialize the Mechanism objects associated with the account.accountId - The account unique IDpublic Account getAccount(Mechanism mechanism)
null if Account could
not be found.
This method does not initialize the Mechanism and/or PushNotification objects
associated with the account.mechanism - The Mechanism objectpublic boolean updateAccount(Account account)
Account object the storage system. Returns false if it could
not be found or updated.account - The Account to update.public boolean removeAccount(Account account)
Account that was passed in, all Mechanism objects
and any PushNotification objects associated with it.account - The account object to deletepublic Mechanism getMechanism(PushNotification notification)
null
if Mechanism could not be found.
This method full initialize the PushNotification objects associated with.
PushMechanism typenotification - The uniquely identifiable UUID for the mechanismpublic boolean removeMechanism(Mechanism mechanism)
Mechanism that was passed in and any notifications
associated with it.mechanism - The mechanism object to deletepublic java.util.List<PushNotification> getAllNotifications()
null if no PushNotification could be found.public java.util.List<PushNotification> getAllNotifications(Mechanism mechanism)
PushMechanism object.
Returns null if no PushNotification could be found or the Mechanism type
is invalid.
This also updates the passed PushMechanism object with the list of
PushNotification objects associated with it.mechanism - The Mechanism objectpublic PushNotification getNotification(java.lang.String notificationId)
null if PushNotification could not be found.
This method also sets the Mechanism object associated with the PushNotification.notificationId - The notification unique IDpublic boolean removeNotification(PushNotification notification)
PushNotification that was passed in.notification - The PushNotification object to deletepublic PushNotification handleMessage(RemoteMessage message) throws InvalidNotificationException
PushNotification object,
which allows accept or deny Push Authentication requests.message - FCM remote messageInvalidNotificationException - if the remote message does not contain required informationpublic PushNotification handleMessage(java.lang.String messageId, java.lang.String message) throws InvalidNotificationException
PushNotification
object, which allows accept or deny Push Authentication requests.messageId - the 'messageId' attribute obtained from the RemoteMessage objectmessage - the 'message' attribute obtained from the RemoteMessage objectInvalidNotificationException - if the remote message does not contain required informationpublic void registerForRemoteNotifications(java.lang.String deviceToken)
throws AuthenticatorException
FirebaseMessagingService#onNewToken. Currently, AM does not accept deviceToken updates
from the SDK. If any PushMechanism was registered with the previous token, this
mechanism needs to be removed and registered again using this new deviceToken.deviceToken - the FCM device tokenAuthenticatorException - if the SDK was already initialized with a device token