public interface Authenticator
Contains the various tasks defined by the UserClient
to be performed
in the AuthenticationView
during the authentication process. The methods to be called
during the authentication process are as follows:
connected(User)
- When a user has been returned successfully.failed(String)
- When the authentication process has failed.aborted(String)
- When the process has been aborted by the user.finished()
- When the control is to be handed back to the UserClient
.finished()
should be called at the end of the AuthenticationView.authenticate(Authenticator)
and no more code execution should happen after the call is made because these action could interfere
with the user provided action in finished()
.
UserClient
,
AuthenticationView
Modifier and Type | Method and Description |
---|---|
void |
aborted(java.lang.String reason)
Task to be performed when the authentication process is aborted by the user.
|
void |
connected(User user)
Task to be performed when a
user has been fetched
and ready to use. |
void |
failed(java.lang.String message)
Task to be performed when the authentication process has been unsuccessful.
|
void |
finished()
Optional additional task to be performed after the authentication process
has finished.
|
void connected(User user)
user
has been fetched
and ready to use.user
- An authenticated user.void failed(java.lang.String message)
message
- Reason for failurevoid aborted(java.lang.String reason)
reason
- A String with the reason for cancellation.void finished()