public class AuthenticatorModuleImpl extends Object implements AuthenticatorModule
This class has facilities to serialize/deserialize (in plain text) user names/passwords specified this way.
Constructor and Description |
---|
AuthenticatorModuleImpl()
Creates an interactive authenticator module.
|
Modifier and Type | Method and Description |
---|---|
void |
clearCredentials()
If usernames/passwords are cached, invoking this method definitely
clears such cached information.
|
Component |
getDialogParent()
Returns the component which is the parent of the graphical dialog box
used to prompt the user.
|
ModularAuthenticator |
getModularAuthenticator()
Returns the modular authenticator to which this module belongs.
|
PasswordAuthentication |
getPasswordAuthentication()
Returns the PasswordAuthentication found for the context which can be
queried using the
ModularAuthenticator interface. |
String |
getPasswords()
Returns the list of usernames/passwords used by this interactive
authenticator module, a possibly empty string.
|
boolean |
isInteractive()
Returns
true if this authenticator is allowed to prompt
the user for her/his credentials; false otherwise. |
void |
setDialogParent(Component dialogParent)
Specifies the component which is the parent of the graphical dialog box
used to prompt the user.
|
void |
setInteractive(boolean interactive)
Specifies whether this authenticator is allowed to prompt the user for
her/his credentials.
|
void |
setModularAuthenticator(ModularAuthenticator authenticator)
Invoked by the modular authenticator to specify to its module to which
``parent'' it belongs.
|
void |
setPasswords(String passwords)
Specifies the list of user names/passwords used by this interactive
authenticator module.
|
public AuthenticatorModuleImpl()
public void setModularAuthenticator(ModularAuthenticator authenticator)
AuthenticatorModule
setModularAuthenticator
in interface AuthenticatorModule
public ModularAuthenticator getModularAuthenticator()
AuthenticatorModule
getModularAuthenticator
in interface AuthenticatorModule
public void clearCredentials()
AuthenticatorModule
clearCredentials
in interface AuthenticatorModule
public void setDialogParent(Component dialogParent)
dialogParent
- parent of the dialog box. May be null
,
in such case, instead of using a graphical dialog box, the user has to
type his user name/password in the console of the application.public Component getDialogParent()
null
unless setDialogParent(java.awt.Component)
has been previously invoked with a non-null argument.public void setInteractive(boolean interactive)
By default, prompting the user is allowed.
Note that this is orthogonal to specifying whether a graphical dialog box or the console is used to prompt the user.
public boolean isInteractive()
true
if this authenticator is allowed to prompt
the user for her/his credentials; false
otherwise.
By default, returns true
.
public void setPasswords(String passwords)
The format of this list is opaque. This list must have been returned
by getPasswords()
. At the end of a session, it is typically
saved to a user preference file in order to be reloaded and reused in
subsequent sessions.
public String getPasswords()
public PasswordAuthentication getPasswordAuthentication()
AuthenticatorModule
ModularAuthenticator
interface. Returns
null
if, given this context, this module cannot determine
the PasswordAuthentication object.getPasswordAuthentication
in interface AuthenticatorModule