SPT Core API

com.sptci.auth
Class CustomCallbackHandler

java.lang.Object
  extended by com.sptci.auth.CustomCallbackHandler
All Implemented Interfaces:
CallbackHandler

public class CustomCallbackHandler
extends Object
implements CallbackHandler

A custom callback handler to set the username and password.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: CustomCallbackHandler.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Nikhil 2007-08-01

Constructor Summary
CustomCallbackHandler(String username, char[] password)
          Create a new callback handler using the specified values.
CustomCallbackHandler(String username, char[] password, char[] key)
          Create a new callback handler using the specified values.
CustomCallbackHandler(String username, String password)
          Create a new callback handler using the specified values.
CustomCallbackHandler(String username, String password, String key)
          Create a new callback handler using the specified values.
 
Method Summary
 void handle(Callback[] callbacks)
          Retrieve or display the information requested in the provided Callbacks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomCallbackHandler

public CustomCallbackHandler(String username,
                             String password)
Create a new callback handler using the specified values.

Parameters:
username - The username value to use.
password - The password value to use.

CustomCallbackHandler

public CustomCallbackHandler(String username,
                             char[] password)
Create a new callback handler using the specified values. This is the designated constructor.

Parameters:
username - The username value to use.
password - The password value to use.

CustomCallbackHandler

public CustomCallbackHandler(String username,
                             String password,
                             String key)
Create a new callback handler using the specified values.

Parameters:
username - The {l@ink #username} value to use.
password - The password value to use.
key - The key value to use.

CustomCallbackHandler

public CustomCallbackHandler(String username,
                             char[] password,
                             char[] key)
Create a new callback handler using the specified values. This is the designated constructor.

Parameters:
username - The username value to use.
password - The password value to use.
key - The key to use to decrypt the stored password.
Method Detail

handle

public void handle(Callback[] callbacks)
            throws IOException,
                   UnsupportedCallbackException
Retrieve or display the information requested in the provided Callbacks.

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 occurs.
UnsupportedCallbackException - If the implementation of this method does not support one or more of the Callbacks specified in the callbacks parameter.

SPT Core API