org.apache.jackrabbit.core.security.principal
Class ProviderRegistryImpl

java.lang.Object
  extended by org.apache.jackrabbit.core.security.principal.ProviderRegistryImpl
All Implemented Interfaces:
PrincipalProviderRegistry

public class ProviderRegistryImpl
extends Object
implements PrincipalProviderRegistry

This is the default implementation of the PrincipalProviderRegistry interface.


Constructor Summary
ProviderRegistryImpl(PrincipalProvider defaultPrincipalProvider)
          Create an instance of ProviderRegistryImpl with the given default principal provider.
 
Method Summary
 PrincipalProvider getDefault()
           
 PrincipalProvider getProvider(String className)
           
 PrincipalProvider[] getProviders()
          Returns all registered providers.
 PrincipalProvider registerProvider(Properties config)
          Registers a new provider by means of a configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProviderRegistryImpl

public ProviderRegistryImpl(PrincipalProvider defaultPrincipalProvider)
Create an instance of ProviderRegistryImpl with the given default principal provider. NOTE that the provider must be initialized by the caller.

Parameters:
defaultPrincipalProvider - The default principal provider.
Method Detail

registerProvider

public PrincipalProvider registerProvider(Properties config)
                                   throws RepositoryException
Description copied from interface: PrincipalProviderRegistry
Registers a new provider by means of a configuration. The registry expects the properties to contain a LoginModuleConfig.PARAM_PRINCIPAL_PROVIDER_CLASS to be able to create a instance of PrincipalProvider.

The Properties will be passed to the instanciated Provider via PrincipalProvider.init(Properties)

Specified by:
registerProvider in interface PrincipalProviderRegistry
Parameters:
config - Properties for the Provider
Returns:
the newly added Provider or null if the configuration was incomplete.
Throws:
RepositoryException - if an error occurs while creating the provider instance.
See Also:
PrincipalProviderRegistry.registerProvider(Properties)

getDefault

public PrincipalProvider getDefault()
Specified by:
getDefault in interface PrincipalProviderRegistry
Returns:
the default principal provider
See Also:
PrincipalProviderRegistry.getDefault()

getProvider

public PrincipalProvider getProvider(String className)
Specified by:
getProvider in interface PrincipalProviderRegistry
Parameters:
className - Name of the principal provider class.
Returns:
PrincipalProvider or null if no provider with the given class name was registered.
See Also:
PrincipalProviderRegistry.getProviders()

getProviders

public PrincipalProvider[] getProviders()
Description copied from interface: PrincipalProviderRegistry
Returns all registered providers.

Specified by:
getProviders in interface PrincipalProviderRegistry
Returns:
all registered providers.
See Also:
PrincipalProviderRegistry.getProviders()


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.