com.cafesoft.cams.auth.callback
Class NamePasswordCallbackHandler

java.lang.Object
  |
  +--com.cafesoft.cams.auth.callback.NamePasswordCallbackHandler
All Implemented Interfaces:
CallbackHandler

public class NamePasswordCallbackHandler
extends Object
implements CallbackHandler

CallbackHandler interface for JAAS LoginModules that must prompt for input. Provides the specified username and password when prompted by the Callback.

Since:
11/8/01

Constructor Summary
NamePasswordCallbackHandler()
          Create a new NamePasswordCallbackHandler (required Cams default constructor that is dynamically called by the authentication server).
NamePasswordCallbackHandler(String username, String password)
          Create a new NamePasswordCallbackHandler (optional constructor used to facilitate testing).
 
Method Summary
 void handle(Callback[] callbacks)
          Retrieve or display the information requested in the provided Callbacks.
 void setPassword(String password)
          Set the password.
 void setUsername(String username)
          Set the username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamePasswordCallbackHandler

public NamePasswordCallbackHandler()
Create a new NamePasswordCallbackHandler (required Cams default constructor that is dynamically called by the authentication server).


NamePasswordCallbackHandler

public NamePasswordCallbackHandler(String username,
                                   String password)
Create a new NamePasswordCallbackHandler (optional constructor used to facilitate testing).

Parameters:
username - the username to provide when prompted.
password - the password to provide when prompted.
Method Detail

setUsername

public void setUsername(String username)
Set the username.

Parameters:
username - the username to be provided to a NameCallback.

setPassword

public void setPassword(String password)
Set the password.

Parameters:
password - the password to be provided to a PasswordCallback.

handle

public void handle(Callback[] callbacks)
            throws IOException,
                   UnsupportedCallbackException
Retrieve or display the information requested in the provided Callbacks. The handle method implementation checks the instance(s) of the Callback object(s) passed in to retrieve or display the requested information.

Specified by:
handle in interface CallbackHandler
Parameters:
callbacks - an array of Callback objects provided by an underlying security service which contains the information requested to be retrieved or displayed.
Throws:
IOException - if an input or output error ocurrs
UnsupportedCallbackException - if the implementation of this method does not support one or more of the Callbacks specified in the callbacks parameter


Generated on 10:40:31 AM September 10, 2003, © 1996-2003 Cafésoft LLC. All rights reserved.