javax.security.auth.callback
Class NameCallback

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.security.auth.callback.NameCallback
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback

public class NameCallback
extends Object sample code for java.lang.Object definition code for java.lang.Object
implements Callback sample code for javax.security.auth.callback.Callback definition code for javax.security.auth.callback.Callback , Serializable sample code for java.io.Serializable definition code for java.io.Serializable

Underlying security services instantiate and pass a NameCallback to the handle method of a CallbackHandler to retrieve name information.

See Also:
CallbackHandler sample code for javax.security.auth.callback.CallbackHandler definition code for javax.security.auth.callback.CallbackHandler , Serialized Form

Constructor Summary
NameCallback sample code for javax.security.auth.callback.NameCallback.NameCallback(java.lang.String) definition code for javax.security.auth.callback.NameCallback.NameCallback(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  prompt)
          Construct a NameCallback with a prompt.
NameCallback sample code for javax.security.auth.callback.NameCallback.NameCallback(java.lang.String, java.lang.String) definition code for javax.security.auth.callback.NameCallback.NameCallback(java.lang.String, java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  prompt, String sample code for java.lang.String definition code for java.lang.String  defaultName)
          Construct a NameCallback with a prompt and default name.
 
Method Summary
 String sample code for java.lang.String definition code for java.lang.String getDefaultName sample code for javax.security.auth.callback.NameCallback.getDefaultName() definition code for javax.security.auth.callback.NameCallback.getDefaultName() ()
          Get the default name.
 String sample code for java.lang.String definition code for java.lang.String getName sample code for javax.security.auth.callback.NameCallback.getName() definition code for javax.security.auth.callback.NameCallback.getName() ()
          Get the retrieved name.
 String sample code for java.lang.String definition code for java.lang.String getPrompt sample code for javax.security.auth.callback.NameCallback.getPrompt() definition code for javax.security.auth.callback.NameCallback.getPrompt() ()
          Get the prompt.
 void setName sample code for javax.security.auth.callback.NameCallback.setName(java.lang.String) definition code for javax.security.auth.callback.NameCallback.setName(java.lang.String) (String sample code for java.lang.String definition code for java.lang.String  name)
          Set the retrieved name.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

NameCallback sample code for javax.security.auth.callback.NameCallback(java.lang.String) definition code for javax.security.auth.callback.NameCallback(java.lang.String)

public NameCallback(String sample code for java.lang.String definition code for java.lang.String  prompt)
Construct a NameCallback with a prompt.

Parameters:
prompt - the prompt used to request the name.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if prompt is null or if prompt has a length of 0.

NameCallback sample code for javax.security.auth.callback.NameCallback(java.lang.String, java.lang.String) definition code for javax.security.auth.callback.NameCallback(java.lang.String, java.lang.String)

public NameCallback(String sample code for java.lang.String definition code for java.lang.String  prompt,
                    String sample code for java.lang.String definition code for java.lang.String  defaultName)
Construct a NameCallback with a prompt and default name.

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

defaultName - the name to be used as the default name displayed with the prompt.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if prompt is null, if prompt has a length of 0, if defaultName is null, or if defaultName has a length of 0.
Method Detail

getPrompt sample code for javax.security.auth.callback.NameCallback.getPrompt() definition code for javax.security.auth.callback.NameCallback.getPrompt()

public String sample code for java.lang.String definition code for java.lang.String  getPrompt()
Get the prompt.

Returns:
the prompt.

getDefaultName sample code for javax.security.auth.callback.NameCallback.getDefaultName() definition code for javax.security.auth.callback.NameCallback.getDefaultName()

public String sample code for java.lang.String definition code for java.lang.String  getDefaultName()
Get the default name.

Returns:
the default name, or null if this NameCallback was not instantiated with a defaultName.

setName sample code for javax.security.auth.callback.NameCallback.setName(java.lang.String) definition code for javax.security.auth.callback.NameCallback.setName(java.lang.String)

public void setName(String sample code for java.lang.String definition code for java.lang.String  name)
Set the retrieved name.

Parameters:
name - the retrieved name (which may be null).
See Also:
getName() sample code for javax.security.auth.callback.NameCallback.getName() definition code for javax.security.auth.callback.NameCallback.getName()

getName sample code for javax.security.auth.callback.NameCallback.getName() definition code for javax.security.auth.callback.NameCallback.getName()

public String sample code for java.lang.String definition code for java.lang.String  getName()
Get the retrieved name.

Returns:
the retrieved name (which may be null)
See Also:
setName(java.lang.String) sample code for javax.security.auth.callback.NameCallback.setName(java.lang.String) definition code for javax.security.auth.callback.NameCallback.setName(java.lang.String)