Package net.shibboleth.idp.attribute.resolver.dc.saml.impl

# Class ExecutableQueryBuilder

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.attribute.resolver.dc.saml.impl.ExecutableQueryBuilder

All Implemented Interfaces:
  `ExecutableSearchBuilder<ExecutableQuery>`, `Component`, `DestructableComponent`, `InitializableComponent`

public class ExecutableQueryBuilder extends AbstractInitializableComponent implements ExecutableSearchBuilder<ExecutableQuery>
Component which builds an `ExecutableQuery` used with the `SAMLDataConnector`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private final class`
`ExecutableQueryBuilder.StandardExecutableQuery`
Standard implementation of the `ExecutableQuery`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private EndpointResolver<AttributeService>`
`authorityEndpointResolver`
Resolver for AttributeService endpoints.
`private AttributeAuthorityEntityIDResolver`
`authorityEntityIDStrategy`
Strategy for resolving the authority entityID.
`private IdentifierGenerationStrategy`
`idStrategy`
Identifier generation strategy.
`private final org.slf4j.Logger`
`log`
Logger.
`private List<Attribute>`
`requestedAttributes`
Optional list of saml2:Attributes to request in the query.
`private RoleDescriptorResolver`
`roleDescriptorResolver`
Role descriptor resolver.
`private SelfEntityIDResolver`
`selfEntityIDStrategy`
Strategy for resolving the authority entityID.
`private String`
`soapClientSecurityConfigurationProfileId`
SOAP client security configuration profile ID.
`private String`
`soapPipelineName`
The SOAP client message pipeline name.
`private SubjectResolver`
`subjectStrategy`
Strategy for resolving the authority entityID.

## Constructor Summary

Constructors
Constructor
Description
`ExecutableQueryBuilder()`

## Method Summary

Modifier and Type
Method
Description
`ExecutableQuery`
`build(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)`
Creates an executable search that can be executed against a data source in order to produce results.
`private SAMLObject`
`buildAttributeQueryMessage(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor, String endpoint, String selfEntityID)`
Build the attribute query message to be sent to the attribute authority.
`private Issuer`
`buildIssuer(String selfEntityID)`
Build the SAML protocol message Issuer element.
`private InOutOperationContext`
`buildOperationContext(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor, String endpoint)`
Build the SOAP client operation context.
`private List<Attribute>`
`buildRequestAttributes(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor)`
Build the list of requested attributes for the SAML protocol message.
`private Subject`
`buildSubject(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor)`
Build SAML protocol message Subject element.
`protected void`
`doInitialize()`
`EndpointResolver<AttributeService>`
`getAuthorityEndpointResolver()`
Get the attribute authority endpoint resolver.
`AttributeAuthorityEntityIDResolver`
`getAuthorityEntityIDStrategy()`
Get the attribute authority entity ID resolution strategy.
`IdentifierGenerationStrategy`
`getIdentifierGenerationStrategy()`
Get the identifier generation strategy.
`List<Attribute>`
`getRequestedAttributes()`
Get the optional list of saml2:Attributes to request in the query.
`RoleDescriptorResolver`
`getRoleDescriptorResolver()`
Get the role descriptor resolver.
`SelfEntityIDResolver`
`getSelfEntityIDStrategy()`
Get the self entity ID resolution strategy.
`String`
`getSOAPClientSecurityConfigurationProfileId()`
Get the SOAP client security configuration profile ID to use.
`String`
`getSOAPPipelineName()`
Get the name of the specific SOAP client message pipeline to use, for example with `PipelineFactoryHttpSOAPClient`.
`SubjectResolver`
`getSubjectStrategy()`
Get the Subject resolution strategy.
`private String`
`resolveAttributeAuthorityEntityID(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes)`
Resolve the attribute authority entityID.
`private String`
`resolveAuthorityEndpoint(String authorityEntityID, AttributeAuthorityDescriptor authorityRoleDescriptor)`
Resolve the attribute authority endpoint.
`private AttributeAuthorityDescriptor`
`resolveAuthorityRoleDescriptor(String authorityEntityID)`
Resolve the attribute authority role descriptor.
`private String`
`resolveSelfEntityID(AttributeResolutionContext resolutionContext, Map<String,List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor)`
Resolve the entity ID of the protocol message issuer (this entity).
`void`
`setAuthorityEndpointResolver(EndpointResolver<AttributeService> resolver)`
Set the attribute authority endpoint resolver.
`void`
`setAuthorityEntityIDStrategy(AttributeAuthorityEntityIDResolver strategy)`
Set the attribute authority entity ID resolution strategy.
`void`
`setIdentifierGenerationStrategy(IdentifierGenerationStrategy strategy)`
Set the identifier generation strategy.
`void`
`setRequestedAttributes(List<Attribute> attributes)`
Set the optional list of saml2:Attributes to request in the query.
`void`
`setRoleDescriptorResolver(RoleDescriptorResolver resolver)`
Set the role descriptor resolver.
`void`
`setSelfEntityIDStrategy(SelfEntityIDResolver strategy)`
Set the self entity ID resolution strategy.
`void`
`setSOAPClientSecurityConfigurationProfileId(String profileId)`
Set the SOAP client security configuration profile ID to use.
`void`
`setSOAPPipelineName(String name)`
Set the name of the specific SOAP client message pipeline to use, for example with `PipelineFactoryHttpSOAPClient`.
`void`
`setSubjectStrategy(SubjectResolver strategy)`
Set the Subject resolution strategy.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Logger.

### authorityEndpointResolver

@NonnullAfterInit private EndpointResolver<AttributeService> authorityEndpointResolver
Resolver for AttributeService endpoints.

### roleDescriptorResolver

@NonnullAfterInit private RoleDescriptorResolver roleDescriptorResolver
Role descriptor resolver.

### soapPipelineName

@NonnullAfterInit private String soapPipelineName
The SOAP client message pipeline name.

### idStrategy

@NonnullAfterInit private IdentifierGenerationStrategy idStrategy
Identifier generation strategy.

### soapClientSecurityConfigurationProfileId

@NonnullAfterInit private String soapClientSecurityConfigurationProfileId
SOAP client security configuration profile ID.

### authorityEntityIDStrategy

@NonnullAfterInit private AttributeAuthorityEntityIDResolver authorityEntityIDStrategy
Strategy for resolving the authority entityID.

### selfEntityIDStrategy

@NonnullAfterInit private SelfEntityIDResolver selfEntityIDStrategy
Strategy for resolving the authority entityID.

### subjectStrategy

@NonnullAfterInit private SubjectResolver subjectStrategy
Strategy for resolving the authority entityID.

### requestedAttributes

@Nonnull private List<Attribute> requestedAttributes
Optional list of saml2:Attributes to request in the query.

## Constructor Details

### ExecutableQueryBuilder

public ExecutableQueryBuilder()

## Method Details

### getAuthorityEndpointResolver

@NonnullAfterInit public EndpointResolver<AttributeService> getAuthorityEndpointResolver()
Get the attribute authority endpoint resolver.

Returns:
  the endpoint resolver

### setAuthorityEndpointResolver

public void setAuthorityEndpointResolver(@Nullable EndpointResolver<AttributeService> resolver)
Set the attribute authority endpoint resolver.

Parameters:
  `resolver` - the new resolver

### getRoleDescriptorResolver

@NonnullAfterInit public RoleDescriptorResolver getRoleDescriptorResolver()
Get the role descriptor resolver.

Returns:
  the role descriptor resolver

### setRoleDescriptorResolver

public void setRoleDescriptorResolver(@Nullable RoleDescriptorResolver resolver)
Set the role descriptor resolver.

Parameters:
  `resolver` - the role descriptor resolver

### getSOAPPipelineName

@NonnullAfterInit public String getSOAPPipelineName()
Get the name of the specific SOAP client message pipeline to use, for example with `PipelineFactoryHttpSOAPClient`.

Returns:
  the pipeline name, or null

### setSOAPPipelineName

public void setSOAPPipelineName(@Nullable String name)
Set the name of the specific SOAP client message pipeline to use, for example with `PipelineFactoryHttpSOAPClient`.

Parameters:
  `name` - the pipeline name, or null

### getIdentifierGenerationStrategy

@NonnullAfterInit public IdentifierGenerationStrategy getIdentifierGenerationStrategy()
Get the identifier generation strategy.

Returns:
  Returns the identifier generation strategy

### setIdentifierGenerationStrategy

public void setIdentifierGenerationStrategy(@Nonnull IdentifierGenerationStrategy strategy)
Set the identifier generation strategy.

Parameters:
  `strategy` - the identifier generation strategy

### getSOAPClientSecurityConfigurationProfileId

@NonnullAfterInit public String getSOAPClientSecurityConfigurationProfileId()
Get the SOAP client security configuration profile ID to use.

Returns:
  the client security configuration profile ID, or null

### setSOAPClientSecurityConfigurationProfileId

public void setSOAPClientSecurityConfigurationProfileId(@Nullable String profileId)
Set the SOAP client security configuration profile ID to use.

Parameters:
  `profileId` - the profile ID, or null

### getAuthorityEntityIDStrategy

@NonnullAfterInit public AttributeAuthorityEntityIDResolver getAuthorityEntityIDStrategy()
Get the attribute authority entity ID resolution strategy.

Returns:
  the strategy

### setAuthorityEntityIDStrategy

public void setAuthorityEntityIDStrategy(@Nonnull AttributeAuthorityEntityIDResolver strategy)
Set the attribute authority entity ID resolution strategy.

Parameters:
  `strategy` - the entityID resolution strategy

### getSelfEntityIDStrategy

@NonnullAfterInit public SelfEntityIDResolver getSelfEntityIDStrategy()
Get the self entity ID resolution strategy.

Returns:
  the strategy

### setSelfEntityIDStrategy

public void setSelfEntityIDStrategy(@Nonnull SelfEntityIDResolver strategy)
Set the self entity ID resolution strategy.

Parameters:
  `strategy` - the entityID resolution strategy

### getSubjectStrategy

@NonnullAfterInit public SubjectResolver getSubjectStrategy()
Get the Subject resolution strategy.

Returns:
  the strategy

### setSubjectStrategy

public void setSubjectStrategy(@Nonnull SubjectResolver strategy)
Set the Subject resolution strategy.

Parameters:
  `strategy` - the entityID resolution strategy

### getRequestedAttributes

@Unmodifiable @NotLive @Nonnull public List<Attribute> getRequestedAttributes()
Get the optional list of saml2:Attributes to request in the query.

Returns:
  the list of attributes, may be null or empty

### setRequestedAttributes

public void setRequestedAttributes(@Nullable List<Attribute> attributes)
Set the optional list of saml2:Attributes to request in the query.

Parameters:
  `attributes` - the list of attributes to request, may be null or empty

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### build

@Nonnull public ExecutableQuery build(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes) throws ResolutionException
Creates an executable search that can be executed against a data source in order to produce results.

Specified by:
  `build` in interface `ExecutableSearchBuilder<ExecutableQuery>`
Parameters:
  `resolutionContext` - current request context
  `dependencyAttributes` - made available to the executable search
Returns:
  executable search
Throws:
  `ResolutionException` - throw if their is a problem creating the executable search

### resolveAttributeAuthorityEntityID

@Nonnull private String resolveAttributeAuthorityEntityID(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes) throws ResolutionException
Resolve the attribute authority entityID.

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
Returns:
  the entityID of the attribute authority being processed
Throws:
  `ResolutionException` - if there is a fatal error during processing

### resolveAuthorityRoleDescriptor

@Nonnull private AttributeAuthorityDescriptor resolveAuthorityRoleDescriptor(@Nonnull String authorityEntityID) throws ResolutionException
Resolve the attribute authority role descriptor.

Parameters:
  `authorityEntityID` - the entityID of the attribute authority being processed
Returns:
  the the role descriptor of the attribute authority being processed
Throws:
  `ResolutionException` - if there is a fatal error during processing

### resolveAuthorityEndpoint

@Nonnull private String resolveAuthorityEndpoint(@Nonnull String authorityEntityID, @Nonnull AttributeAuthorityDescriptor authorityRoleDescriptor) throws ResolutionException
Resolve the attribute authority endpoint.

Parameters:
  `authorityEntityID` - the entityID of the attribute authority being processed
  `authorityRoleDescriptor` - the role descriptor of the attribute authority being processed
Returns:
  the attribute authority endpoint
Throws:
  `ResolutionException` - if there is a fatal error during processing

### buildOperationContext

@Nonnull private InOutOperationContext buildOperationContext(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor, @Nonnull String endpoint) throws ResolutionException
Build the SOAP client operation context.

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
  `roleDescriptor` - the role descriptor of the attribute authority being processed
  `endpoint` - the attribute authority endpoint
Returns:
  the SOAP client operation context
Throws:
  `ResolutionException` - if there is a fatal error during processing

### resolveSelfEntityID

@Nonnull private String resolveSelfEntityID(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor) throws ResolutionException
Resolve the entity ID of the protocol message issuer (this entity).

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
  `roleDescriptor` - the role descriptor of the attribute authority being processed
Returns:
  the entity ID of the protocol message issuer (this entity)
Throws:
  `ResolutionException` - if there is a fatal error during processing

### buildAttributeQueryMessage

@Nonnull private SAMLObject buildAttributeQueryMessage(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor, @Nonnull String endpoint, @Nonnull String selfEntityID) throws ResolutionException
Build the attribute query message to be sent to the attribute authority.

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
  `roleDescriptor` - the role descriptor of the attribute authority being processed
  `endpoint` - the attribute authority endpoint
  `selfEntityID` - the entity ID of the protocol message issuer (this entity)
Returns:
  the new attribute query message to be sent to the attribute authority
Throws:
  `ResolutionException` - if there is a fatal error during processing

### buildIssuer

@Nonnull private Issuer buildIssuer(@Nonnull String selfEntityID) throws ResolutionException
Build the SAML protocol message Issuer element.

Parameters:
  `selfEntityID` - the entity ID of the protocol message issuer (this entity)
Returns:
  the Issuer element
Throws:
  `ResolutionException` - if there is a fatal error during processing

### buildSubject

@Nonnull private Subject buildSubject(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor) throws ResolutionException
Build SAML protocol message Subject element.

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
  `roleDescriptor` - the role descriptor of the protocol message issuer (this entity)
Returns:
  the subject to be used in the attribute query message
Throws:
  `ResolutionException` - if there is a fatal error during processing

### buildRequestAttributes

@Nonnull private List<Attribute> buildRequestAttributes(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String,List<IdPAttributeValue>> dependencyAttributes, @Nonnull AttributeAuthorityDescriptor roleDescriptor) throws ResolutionException
Build the list of requested attributes for the SAML protocol message.

Parameters:
  `resolutionContext` - the current attribute resolution context
  `dependencyAttributes` - the current set of dependency attributes
  `roleDescriptor` - the role descriptor of the attribute authority being processed
Returns:
  the list of requested attributes to be used in the attribute query message
Throws:
  `ResolutionException` - if there is a fatal error during processing