org.opensaml.saml2.metadata.support
Class AttributeConsumingServiceSelector

java.lang.Object
  extended by org.opensaml.saml2.metadata.support.AttributeConsumingServiceSelector

public class AttributeConsumingServiceSelector
extends Object

Metadata support class which selects an AttributeConsumingService based on input of a mandatory RoleDescriptor and an optional index.

This implementation supports selecting an AttributeConsumingService from parent role descriptors of the following types:

  1. the standard SAML 2 metadata type SPSSODescriptor
  2. the extension type AttributeQueryDescriptorType

Subclasses should override getCandidates() if support for additional sources of attribute consuming services is needed.

The selection algorithm is:

  1. If an index is supplied, the service with that index is returned. If no such service exists in metadata: if isOnBadIndexUseDefault() is true, then the default service is returned as described below; otherwise null is returned.
  2. If an index is not supplied, then the default service is returned as follows: The service with an explicit isDefault of true is returned. If no such service exists, then the first service without an explicit isDefault is returned. If no service is yet selected, then the first service listed in metadata is returned.


Constructor Summary
AttributeConsumingServiceSelector()
           
 
Method Summary
protected  List<AttributeConsumingService> getCandidates()
          Get the list of candidate attribute consuming services.
 Integer getIndex()
          Get the index of the desired service.
 RoleDescriptor getRoleDescriptor()
          Get the AttributeConsumingServie's parent RoleDescriptor.
 boolean isOnBadIndexUseDefault()
          Get the flag which determines whether, in the case of an invalid index, to return the default AttributeConsumingService.
 AttributeConsumingService selectService()
          Select the AttributeConsumingService.
 void setIndex(Integer requestedIndex)
          Set the index of the desired service.
 void setOnBadIndexUseDefault(boolean flag)
          Set the flag which determines whether, in the case of an invalid index, to return the default AttributeConsumingService.
 void setRoleDescriptor(RoleDescriptor descriptor)
          Set the AttributeConsumingServie's parent RoleDescriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeConsumingServiceSelector

public AttributeConsumingServiceSelector()
Method Detail

getIndex

public Integer getIndex()
Get the index of the desired service.

Returns:
Returns the index.

setIndex

public void setIndex(Integer requestedIndex)
Set the index of the desired service.

Parameters:
requestedIndex - The index to set.

getRoleDescriptor

public RoleDescriptor getRoleDescriptor()
Get the AttributeConsumingServie's parent RoleDescriptor.

Returns:
Returns the spSSODescriptor.

setRoleDescriptor

public void setRoleDescriptor(RoleDescriptor descriptor)
Set the AttributeConsumingServie's parent RoleDescriptor.

Parameters:
descriptor - The roleDescriptor to set.

setOnBadIndexUseDefault

public void setOnBadIndexUseDefault(boolean flag)
Set the flag which determines whether, in the case of an invalid index, to return the default AttributeConsumingService. Defaults to false.

Parameters:
flag - The onBadIndexUseDefault to set.

isOnBadIndexUseDefault

public boolean isOnBadIndexUseDefault()
Get the flag which determines whether, in the case of an invalid index, to return the default AttributeConsumingService. Defaults to false.

Returns:
Returns the onBadIndexUseDefault.

selectService

public AttributeConsumingService selectService()
Select the AttributeConsumingService.

Returns:
the selected AttributeConsumingService, or null

getCandidates

protected List<AttributeConsumingService> getCandidates()
Get the list of candidate attribute consuming services.

This implementation supports selecting an AttributeConsumingService from parent role descriptors of the following types:

  1. the standard SAML 2 metadata type SPSSODescriptor
  2. the extension type AttributeQueryDescriptorType

Subclasses should override if support for additional sources of attribute consuming services is needed.

Returns:
the list of candidate AttributeConsumingServices, or null if none could be resolved


Copyright © 2006-2011 Internet2. All Rights Reserved.