|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AuthenticationContext
Authentication
Callbacks can be handled in either of two ways:
Applet's.
POSTed replies to the calback objects and resume login
The AuthenticationContext pattern helps to follow the service
request sequence strategy. The invocation sequence would look like that, if
it wasn't distributed over different HTTP requests:
for(
boolean handleCallbacks = authentication.startLogin();
handleCallbacks;
) try {
Callback[] callbacks = authentication.getCallbacks();
// Handle Callbacks
handleCallbacks = authentication.resumeLogin();
} catch (IOException exception) {
handleCallbacks = authentication.resumeLogin(exception);
} catch (UnsupportedCallbackException exception) {
handleCallbacks = authentication.resumeLogin(exception);
}
Subject subject = authentication.getSubject();
| Method Summary | |
|---|---|
boolean |
continueLogin()
Continue execution |
int |
getAttempt()
Tells how often the login sequence has been started for the associated LoginContext. |
Callback[] |
getCallbacks()
Retrieve the callbacks to be handled. |
String |
getCorrelationId()
Retrieve the correlation id. |
String |
getName()
Returns the Authentication object's name |
Subject |
getSubject()
Return the authenticated Subject. |
boolean |
restartLogin()
Re-starts the authentication sequence |
boolean |
resumeLogin()
Resumes execution |
boolean |
resumeLogin(IOException exception)
Resumes execution |
boolean |
resumeLogin(UnsupportedCallbackException exception)
Resumes execution |
void |
setCorrelationId(String id)
Set the correlation id. |
boolean |
startLogin(Subject subject)
Starts the authentication sequence |
| Method Detail |
|---|
boolean startLogin(Subject subject)
throws LoginException,
IOException
subject - the Subject to authenticate,
or null
true if there are no more callbacks to be handled
and login has commpleted successfully.
LoginException - if the login attempt failed
IllegalStateException - if the authenticator is in an
inappropriate state
IOException
boolean restartLogin()
throws LoginException,
IOException
true if there are no more callbacks to be handled
and login has commpleted successfully.
LoginException - if the login attempt failed
IllegalStateException - if the authenticator is in an
inappropriate state
IOException
boolean resumeLogin()
throws LoginException,
IOException
true if there are no more callbacks to be handled
and login has commpleted successfully.
IllegalStateException - if the authenticator is in an
inappropriate state
LoginException - if the login process failed
IOException
boolean continueLogin()
throws LoginException,
IOException
true if there are no more callbacks to be handled
and login has commpleted successfully.
IllegalStateException - if the authenticator is in an
inappropriate state
LoginException - if the login process failed
IOException
boolean resumeLogin(IOException exception)
throws LoginException,
IOException
exception - The IOException which occured during
callback handling.
true if there are no more callbacks to be handled
and the login process has commpleted successfully.
IllegalStateException - if the authenticator is in an
inappropriate state
NullPointerException - if exception is
null.
LoginException - if the login process failed
IOException
boolean resumeLogin(UnsupportedCallbackException exception)
throws LoginException,
IOException
exception - The UnsupportedCallbackException which
occured during callback handling.
true if there are no more callbacks to be handled
and the login process has commpleted successfully.
IllegalStateException - if the authenticator is in an
inappropriate state
NullPointerException - if exception is
null.
LoginException - if the login process failed
IOExceptionint getAttempt()
LoginContext.
Subject getSubject()
null.
Callback[] getCallbacks()
throws LoginException
LoginException - if the callback handler is not ACTIVE
and a LoginException is pendingString getCorrelationId()
id's valuevoid setCorrelationId(String id)
id - The id's valueString getName()
Authentication object's name
This method is meant for logging and debugging purposes only.
Authentication object's name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||