org.eclipse.ecf.core.security
Class PasswordCallback

java.lang.Object
  extended by org.eclipse.ecf.core.security.PasswordCallback
All Implemented Interfaces:
java.io.Serializable, Callback

public class PasswordCallback
extends java.lang.Object
implements Callback, java.io.Serializable

Callback that handles passwords

See Also:
Serialized Form

Constructor Summary
PasswordCallback(java.lang.String prompt)
          Construct a PasswordCallback with a prompt.
PasswordCallback(java.lang.String prompt, java.lang.String defaultPassword)
          Construct a PasswordCallback with a prompt and default password.
 
Method Summary
 java.lang.String getDefaultPassword()
          Get the default password.
 java.lang.String getPassword()
          Get the retrieved password.
 java.lang.String getPrompt()
          Get the prompt.
 void setPassword(java.lang.String pw)
          Set the retrieved password.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PasswordCallback

public PasswordCallback(java.lang.String prompt)
Construct a PasswordCallback with a prompt.

Parameters:
prompt - the prompt used to request the name.
Throws:
java.lang.IllegalArgumentException - if prompt is null.

PasswordCallback

public PasswordCallback(java.lang.String prompt,
                        java.lang.String defaultPassword)
Construct a PasswordCallback with a prompt and default password.

Parameters:
prompt - the prompt used to request the information.

defaultPassword - the name to be used as the default name displayed with the prompt.
Throws:
java.lang.IllegalArgumentException - if prompt is null.
Method Detail

getPrompt

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

Returns:
the prompt.

getDefaultPassword

public java.lang.String getDefaultPassword()
Get the default password.

Returns:
the default password, or null if this PasswordCallback was not instantiated with a defaultPassword.

setPassword

public void setPassword(java.lang.String pw)
Set the retrieved password.

Parameters:
pw - the password (which may be null).
See Also:
getPassword()

getPassword

public java.lang.String getPassword()
Get the retrieved password.

Returns:
the retrieved password (which may be null)
See Also:
setPassword(java.lang.String)