org.dvb.auth.callback
Class PasswordCallback

java.lang.Object
  extended by org.dvb.auth.callback.PasswordCallback
All Implemented Interfaces:
Callback

public class PasswordCallback
extends java.lang.Object
implements Callback

Underlying security services instantiate and pass a PasswordCallback to the handle method of a CallbackHandler to retrieve password information. The CallbackHandler uses this to communicate to the security services a password obtained from the end-user.


Constructor Summary
PasswordCallback(java.lang.String prompt, boolean echoOn)
          Creates a new instance of PasswordCallback.
 
Method Summary
 void clearPassord()
          Clear the retrieved password.
 char[] getPassword()
          Get the retrieved password.
 java.lang.String getPrompt()
          Get the prompt to use.
 boolean isEchoOn()
          Return whether the password should be displayed as being typed.
 void setPassword(char[] password)
          Set the retrieved password.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordCallback

public PasswordCallback(java.lang.String prompt,
                        boolean echoOn)
Creates a new instance of PasswordCallback.

Parameters:
prompt - the prompt to use
echoOn - true if the password should be displayed as typed otherwise false
Method Detail

getPrompt

public java.lang.String getPrompt()
Get the prompt to use.

Returns:
the prompt as passed to the constructor

isEchoOn

public boolean isEchoOn()
Return whether the password should be displayed as being typed.

Returns:
true if the password should be displayed otherwise false

setPassword

public void setPassword(char[] password)
Set the retrieved password.

Parameters:
password - the password to return
See Also:
getPassword()

getPassword

public char[] getPassword()
Get the retrieved password.

Returns:
the last password previously set by setPassword or null if none has been set
See Also:
setPassword(char[])

clearPassord

public void clearPassord()
Clear the retrieved password.