VistALink v1.6

gov.va.med.vistalink.security
Class CallbackHandlerSwing

java.lang.Object
  extended by gov.va.med.vistalink.security.CallbackHandlerSwing
All Implemented Interfaces:
javax.security.auth.callback.CallbackHandler
Direct Known Subclasses:
CallbackHandlerSwingCCOW

public class CallbackHandlerSwing
extends java.lang.Object

Implements the JAAS CallbackHandler interface. Use with the VistaLoginModule to invoke a Swing-based interactive logon. Input values (access code, verify code, division selection, and other "user input") is collected via a set of GUI dialogs when this callback handler is used.

  1. Create an instance of CallbackHandlerSwing. No parameters are needed.
  2. Create the JAAS LoginContext instance, passing the instance of the callback handler as one of the parameters.
  3. Invoke the JAAS login context's login method. The callback handler will invoke Swing dialogs to collect user input wherever required for login.
For example:

String cfgName = "RpcSampleServer";

// create the callback handler
CallbackHandlerSwing cbhSwing = new CallbackHandlerSwing(myFrame);

// create the LoginContext
loginContext = new LoginContext(cfgName, cbhSwing);

// login to server
loginContext.login();

See Also:
VistaLoginModule

Constructor Summary
CallbackHandlerSwing(java.awt.Frame windowParent)
          Instantiates a JAAS callback handler for Swing applications.
 
Method Summary
 void handle(javax.security.auth.callback.Callback[] arg0)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallbackHandlerSwing

public CallbackHandlerSwing(java.awt.Frame windowParent)
Instantiates a JAAS callback handler for Swing applications.

Parameters:
windowParent - Allows login dialogs to be centered over a parent frame (a top-level window with a title and border). If null is passed, login dialogs are centered based on the screen itself.
Method Detail

handle

public void handle(javax.security.auth.callback.Callback[] arg0)
            throws javax.security.auth.callback.UnsupportedCallbackException
Specified by:
handle in interface javax.security.auth.callback.CallbackHandler
Throws:
javax.security.auth.callback.UnsupportedCallbackException

VistALink v1.6

VistALink v1.6