org.opensaml.saml2.metadata.support
public class AttributeConsumingServiceSelector extends Object
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:
SPSSODescriptor
AttributeQueryDescriptorType
Subclasses should override getCandidates()
if support for additional sources of attribute consuming services
is needed.
The selection algorithm is:
isOnBadIndexUseDefault()
is true, then the default service is returned as described below; otherwise null is
returned.Modifier and Type | Field and Description |
---|---|
private Integer |
index
The requested service index.
|
private org.slf4j.Logger |
log
Class logger.
|
private boolean |
onBadIndexUseDefault
Flag which determines whether, in the case of an invalid index, to return the default AttributeConsumingService.
|
private RoleDescriptor |
roleDescriptor
The AttributeConsumingService's parent role descriptor.
|
Constructor and Description |
---|
AttributeConsumingServiceSelector() |
Modifier and Type | Method and Description |
---|---|
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.
|
private AttributeConsumingService |
selectByIndex(List<AttributeConsumingService> candidates)
Select the service based on the index value.
|
private AttributeConsumingService |
selectDefault(List<AttributeConsumingService> candidates)
Select the default service.
|
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.
|
private org.slf4j.Logger log
private Integer index
private RoleDescriptor roleDescriptor
private boolean onBadIndexUseDefault
public Integer getIndex()
public void setIndex(Integer requestedIndex)
requestedIndex
- The index to set.public RoleDescriptor getRoleDescriptor()
public void setRoleDescriptor(RoleDescriptor descriptor)
descriptor
- The roleDescriptor to set.public void setOnBadIndexUseDefault(boolean flag)
flag
- The onBadIndexUseDefault to set.public boolean isOnBadIndexUseDefault()
public AttributeConsumingService selectService()
protected List<AttributeConsumingService> getCandidates()
This implementation supports selecting an AttributeConsumingService from parent role descriptors of the following types:
SPSSODescriptor
AttributeQueryDescriptorType
Subclasses should override if support for additional sources of attribute consuming services is needed.
private AttributeConsumingService selectByIndex(List<AttributeConsumingService> candidates)
candidates
- the list of candiate servicesprivate AttributeConsumingService selectDefault(List<AttributeConsumingService> candidates)
candidates
- the list of candiate servicesCopyright © 1999-2013 JBoss by Red Hat. All Rights Reserved.