org.apache.qpid.client.security
Class CallbackHandlerRegistry

java.lang.Object
  extended by org.apache.qpid.client.security.CallbackHandlerRegistry

public class CallbackHandlerRegistry
extends Object

CallbackHandlerRegistry is a registry for call back handlers for user authentication and interaction during user authentication. It is capable of reading its configuration from a properties file containing call back handler implementing class names for different SASL mechanism names. Instantiating this registry also has the effect of configuring and registering the SASL client factory implementations using DynamicSaslRegistrar.

The callback configuration should be specified in a properties file, refered to by the System property "amp.callbackhandler.properties". The format of the properties file is:

 CallbackHanlder.mechanism=fully.qualified.class.name
 

Where mechanism is an IANA-registered mechanism name and the fully qualified class name refers to a class that implements org.apache.qpid.client.security.AMQCallbackHanlder and provides a call back handler for the specified mechanism.

CRC Card
Responsibilities Collaborations
Parse callback properties.
Provide mapping from SASL mechanisms to callback implementations.


Field Summary
static String DEFAULT_RESOURCE_NAME
          The default name of the callback handler properties resource.
 
Method Summary
 Class getCallbackHandlerClass(String mechanism)
          Gets the callback handler class for a given SASL mechanism name.
static CallbackHandlerRegistry getInstance()
          Gets the singleton instance of this registry.
 String getMechanisms()
          Gets a space delimited list of supported SASL mechanisms.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RESOURCE_NAME

public static final String DEFAULT_RESOURCE_NAME
The default name of the callback handler properties resource.

See Also:
Constant Field Values
Method Detail

getInstance

public static CallbackHandlerRegistry getInstance()
Gets the singleton instance of this registry.

Returns:
The singleton instance of this registry.

getCallbackHandlerClass

public Class getCallbackHandlerClass(String mechanism)
Gets the callback handler class for a given SASL mechanism name.

Parameters:
mechanism - The SASL mechanism name.
Returns:
The callback handler class for the mechanism, or null if none is configured for that mechanism.

getMechanisms

public String getMechanisms()
Gets a space delimited list of supported SASL mechanisms.

Returns:
A space delimited list of supported SASL mechanisms.


Licensed to the Apache Software Foundation