edu.internet2.middleware.shibboleth.common.relyingparty.provider
Class SAMLMDRelyingPartyConfigurationManager

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.config.BaseService
      extended by edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
          extended by edu.internet2.middleware.shibboleth.common.relyingparty.provider.SAMLMDRelyingPartyConfigurationManager
All Implemented Interfaces:
RelyingPartyConfigurationManager, ReloadableService, Service, org.springframework.beans.factory.BeanNameAware, org.springframework.context.ApplicationContextAware

public class SAMLMDRelyingPartyConfigurationManager
extends BaseReloadableService
implements RelyingPartyConfigurationManager

A relying party manager that uses SAML metadata to lookup information about requested entities. Relying party configuration information is looked up as follows: If the given entity ID is null, empty, or contains only whitespace the anonymous relying party configuration is returned. Otherwise, the given relying party entity ID is looked for in the list of registered RelyingPartyConfigurations and if found is returned. If no configuration is registered for the specific entity ID the entity descriptor for the relying party is located using the MetadataProvider. The name of ancestral entities descriptors are then looked up, in ascending order (i.e. the parent entities descriptor, then the grandparent, great-grandparent, etc.), with the first configuration found being returned. If no configuration is found once the top of the tree is reached the default configuration is returned.


Nested Class Summary
 
Nested classes/interfaces inherited from class edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
BaseReloadableService.ConfigurationResourceListener
 
Field Summary
static String ANONYMOUS_RP_NAME
          ID used for anonymous relying party.
static String DEFAULT_RP_NAME
          ID used for default relying party.
 
Constructor Summary
SAMLMDRelyingPartyConfigurationManager()
          Constructor.
 
Method Summary
 RelyingPartyConfiguration getAnonymousRelyingConfiguration()
          Gets the relying party configuration to use for anonymous parties.
 RelyingPartyConfiguration getDefaultRelyingPartyConfiguration()
          Gets the default relying party configuration.
 org.opensaml.saml2.metadata.provider.MetadataProvider getMetadataProvider()
          Gets the metadata provider used to lookup information about entities.
 RelyingPartyConfiguration getRelyingPartyConfiguration(String relyingPartyEntityID)
          Gets the configuration for the given relying party.
 Map<String,RelyingPartyConfiguration> getRelyingPartyConfigurations()
          Gets the registered relying party configurations indexed by relying party ID.
protected  void onNewContextCreated(org.springframework.context.ApplicationContext newServiceContext)
          Called after a new context has been created but before it set as the service's context.
 void setMetadataProvider(org.opensaml.saml2.metadata.provider.MetadataProvider provider)
          Sets the metadata provider used to lookup information about entities.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.BaseReloadableService
destroy, getPollingFrequency, getPollingRetryAttempts, getPollingTimer, initialize, reload, setPollingFrequency, setPollingRetryAttempts, setPollingTimer
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.config.BaseService
getApplicationContext, getId, getReadWriteLock, getServiceConfigurations, getServiceContext, isDestroyed, isInitialized, loadContext, setApplicationContext, setBeanName, setInitialized, setServiceConfigurations, setServiceContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.internet2.middleware.shibboleth.common.service.Service
getId, isDestroyed, isInitialized
 

Field Detail

ANONYMOUS_RP_NAME

public static final String ANONYMOUS_RP_NAME
ID used for anonymous relying party.

See Also:
Constant Field Values

DEFAULT_RP_NAME

public static final String DEFAULT_RP_NAME
ID used for default relying party.

See Also:
Constant Field Values
Constructor Detail

SAMLMDRelyingPartyConfigurationManager

public SAMLMDRelyingPartyConfigurationManager()
Constructor.

Method Detail

getAnonymousRelyingConfiguration

public RelyingPartyConfiguration getAnonymousRelyingConfiguration()
Gets the relying party configuration to use for anonymous parties.

Specified by:
getAnonymousRelyingConfiguration in interface RelyingPartyConfigurationManager
Returns:
the relying party configuration to use for anonymous parties

getDefaultRelyingPartyConfiguration

public RelyingPartyConfiguration getDefaultRelyingPartyConfiguration()
Gets the default relying party configuration.

Specified by:
getDefaultRelyingPartyConfiguration in interface RelyingPartyConfigurationManager
Returns:
the default relying party configuration

getMetadataProvider

public org.opensaml.saml2.metadata.provider.MetadataProvider getMetadataProvider()
Gets the metadata provider used to lookup information about entities.

Returns:
metadata provider used to lookup information about entities

setMetadataProvider

public void setMetadataProvider(org.opensaml.saml2.metadata.provider.MetadataProvider provider)
Sets the metadata provider used to lookup information about entities.

Parameters:
provider - metadata provider used to lookup information about entities

getRelyingPartyConfiguration

public RelyingPartyConfiguration getRelyingPartyConfiguration(String relyingPartyEntityID)
Gets the configuration for the given relying party.

Specified by:
getRelyingPartyConfiguration in interface RelyingPartyConfigurationManager
Parameters:
relyingPartyEntityID - the entity of the relying part to get the configuration for
Returns:
configuration for the given relying party

getRelyingPartyConfigurations

public Map<String,RelyingPartyConfiguration> getRelyingPartyConfigurations()
Gets the registered relying party configurations indexed by relying party ID.

Specified by:
getRelyingPartyConfigurations in interface RelyingPartyConfigurationManager
Returns:
the registered relying party configurations

onNewContextCreated

protected void onNewContextCreated(org.springframework.context.ApplicationContext newServiceContext)
                            throws ServiceException
Called after a new context has been created but before it set as the service's context. If an exception is thrown the new context will not be set as the service's context and the current service context will be retained.

Specified by:
onNewContextCreated in class BaseService
Parameters:
newServiceContext - the newly created context for the service
Throws:
ServiceException - thrown if there is a problem with the given service context


Copyright © 2006-2008 Internet2. All Rights Reserved.