Package com.caplin.server.auth
Interface DelayedResultReceiver
public interface DelayedResultReceiver
Provides an interface that allows delayed authentication results to be passed to the Liberator.
The authentication check calls that come from the Liberator are blocking, so in cases where it may take some time to provide a result (for example when relying on a remote database that may introduce a delay) then this mechanism should be used to prevent impairing server performance.
An instance of DelayedResultReceiver is passed to an Authenticator in its initialise
method.
This instance is then used to pass back delayed authentication results to the Liberator in the case
where the initial return value from an authentication check was AuthenticationResult.DELAYED
.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delayedCheckUserResult
(UserSession userSession, AuthenticationResult result) This method should be called when providing a delayed result from aAuthenticator.checkUser
call.void
delayedCheckWriteResult
(UserSession userSession, RTTPObject object, String contributionId, AuthenticationResult result) Use to provide a delayed result for aAuthenticator.checkWrite
call.void
delayedMapObjectResult
(UserSession userSession, MapObject mappedObject, AuthenticationResult result) Use to provide a delayed result for aAuthenticator.mapObject
call.
-
Method Details
-
delayedCheckUserResult
This method should be called when providing a delayed result from aAuthenticator.checkUser
call.- Parameters:
userSession
- the UserSession that was passed in the checkUser call.result
- the delayed AuthenticationResult
-
delayedMapObjectResult
void delayedMapObjectResult(UserSession userSession, MapObject mappedObject, AuthenticationResult result) Use to provide a delayed result for aAuthenticator.mapObject
call.- Parameters:
userSession
- the UserSession that was passed in the mapObject call.mappedObject
- theMapObject
that was passed in the mapObject call with the mapped object name set if appropriate.result
-AuthenticationResult.OK
if the object name was mapped orAuthenticationResult.FALSE
if the object name was not mapped.
-
delayedCheckWriteResult
void delayedCheckWriteResult(UserSession userSession, RTTPObject object, String contributionId, AuthenticationResult result) Use to provide a delayed result for aAuthenticator.checkWrite
call.- Parameters:
userSession
- the UserSession that was passed in the mapObject call.object
- the RTTPObject the user is attempting to read.contributionId
- the contribution Id that was passed in the checkWrite call.result
- the delayed AuthenticationResult
-