com.cafesoft.cams.auth.callback
Class MapCallbackHandler

java.lang.Object
  extended by com.cafesoft.cams.auth.callback.MapCallbackHandler
All Implemented Interfaces:
CallbackHandler

public class MapCallbackHandler
extends Object
implements CallbackHandler

MapCallbackHandler extends the standard JAAS CallbackHandler interface with methods to set/get callback values by name. This enables Cams to provide a generic, general purpose CallbackHandler that does not need a new set/get method for every callback value.

Since:
9/22/2008

Constructor Summary
MapCallbackHandler()
          Create a new MapCallbackHandler instance.
 
Method Summary
 void handle(Callback[] callbacks)
          Retrieve or display the information requested in the provided Callbacks.
 void setCallbackValue(String name, String value)
          Set a callback value.
 void setCallbackValues(Map srcMap)
          Set callback values from an existing Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapCallbackHandler

public MapCallbackHandler()
Create a new MapCallbackHandler instance.

Method Detail

setCallbackValue

public void setCallbackValue(String name,
                             String value)
Set a callback value.

Parameters:
name - the callback value name.
value - the callback value.

setCallbackValues

public void setCallbackValues(Map srcMap)
Set callback values from an existing Map.

Parameters:
srcMap - the source Map from wich callback values are to be copied.

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:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.