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 ClassesModifier and TypeClassDescriptionprivate final classStandard implementation of theExecutableQuery. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate EndpointResolver<AttributeService>Resolver for AttributeService endpoints.Strategy for resolving the authority entityID.private IdentifierGenerationStrategyIdentifier generation strategy.private final org.slf4j.LoggerLogger.Optional list of saml2:Attributes to request in the query.private RoleDescriptorResolverRole descriptor resolver.private SelfEntityIDResolverStrategy for resolving the authority entityID.private StringSOAP client security configuration profile ID.private StringThe SOAP client message pipeline name.private SubjectResolverStrategy for resolving the authority entityID. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(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 SAMLObjectbuildAttributeQueryMessage(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 IssuerbuildIssuer(String selfEntityID) Build the SAML protocol message Issuer element.private InOutOperationContextbuildOperationContext(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor, String endpoint) Build the SOAP client operation context.buildRequestAttributes(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor) Build the list of requested attributes for the SAML protocol message.private SubjectbuildSubject(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor) Build SAML protocol message Subject element.protected voidGet the attribute authority endpoint resolver.Get the attribute authority entity ID resolution strategy.Get the identifier generation strategy.Get the optional list of saml2:Attributes to request in the query.Get the role descriptor resolver.Get the self entity ID resolution strategy.Get the SOAP client security configuration profile ID to use.Get the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.Get the Subject resolution strategy.private StringresolveAttributeAuthorityEntityID(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes) Resolve the attribute authority entityID.private StringresolveAuthorityEndpoint(String authorityEntityID, AttributeAuthorityDescriptor authorityRoleDescriptor) Resolve the attribute authority endpoint.private AttributeAuthorityDescriptorresolveAuthorityRoleDescriptor(String authorityEntityID) Resolve the attribute authority role descriptor.private StringresolveSelfEntityID(AttributeResolutionContext resolutionContext, Map<String, List<IdPAttributeValue>> dependencyAttributes, AttributeAuthorityDescriptor roleDescriptor) Resolve the entity ID of the protocol message issuer (this entity).voidSet the attribute authority endpoint resolver.voidSet the attribute authority entity ID resolution strategy.voidSet the identifier generation strategy.voidsetRequestedAttributes(List<Attribute> attributes) Set the optional list of saml2:Attributes to request in the query.voidSet the role descriptor resolver.voidsetSelfEntityIDStrategy(SelfEntityIDResolver strategy) Set the self entity ID resolution strategy.voidSet the SOAP client security configuration profile ID to use.voidsetSOAPPipelineName(String name) Set the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.voidsetSubjectStrategy(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
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logLogger. -
authorityEndpointResolver
Resolver for AttributeService endpoints. -
roleDescriptorResolver
Role descriptor resolver. -
soapPipelineName
The SOAP client message pipeline name. -
idStrategy
Identifier generation strategy. -
soapClientSecurityConfigurationProfileId
SOAP client security configuration profile ID. -
authorityEntityIDStrategy
Strategy for resolving the authority entityID. -
selfEntityIDStrategy
Strategy for resolving the authority entityID. -
subjectStrategy
Strategy for resolving the authority entityID. -
requestedAttributes
Optional list of saml2:Attributes to request in the query.
-
-
Constructor Details
-
ExecutableQueryBuilder
public ExecutableQueryBuilder()
-
-
Method Details
-
getAuthorityEndpointResolver
Get the attribute authority endpoint resolver.- Returns:
- the endpoint resolver
-
setAuthorityEndpointResolver
Set the attribute authority endpoint resolver.- Parameters:
resolver- the new resolver
-
getRoleDescriptorResolver
Get the role descriptor resolver.- Returns:
- the role descriptor resolver
-
setRoleDescriptorResolver
Set the role descriptor resolver.- Parameters:
resolver- the role descriptor resolver
-
getSOAPPipelineName
Get the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.- Returns:
- the pipeline name, or null
-
setSOAPPipelineName
Set the name of the specific SOAP client message pipeline to use, for example withPipelineFactoryHttpSOAPClient.- Parameters:
name- the pipeline name, or null
-
getIdentifierGenerationStrategy
Get the identifier generation strategy.- Returns:
- Returns the identifier generation strategy
-
getSOAPClientSecurityConfigurationProfileId
Get the SOAP client security configuration profile ID to use.- Returns:
- the client security configuration profile ID, or null
-
setSOAPClientSecurityConfigurationProfileId
Set the SOAP client security configuration profile ID to use.- Parameters:
profileId- the profile ID, or null
-
getAuthorityEntityIDStrategy
Get the attribute authority entity ID resolution strategy.- Returns:
- the strategy
-
setAuthorityEntityIDStrategy
Set the attribute authority entity ID resolution strategy.- Parameters:
strategy- the entityID resolution strategy
-
getSelfEntityIDStrategy
Get the self entity ID resolution strategy.- Returns:
- the strategy
-
setSelfEntityIDStrategy
Set the self entity ID resolution strategy.- Parameters:
strategy- the entityID resolution strategy
-
getSubjectStrategy
Get the Subject resolution strategy.- Returns:
- the strategy
-
setSubjectStrategy
Set the Subject resolution strategy.- Parameters:
strategy- the entityID resolution strategy
-
getRequestedAttributes
Get the optional list of saml2:Attributes to request in the query.- Returns:
- the list of attributes, may be null or empty
-
setRequestedAttributes
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
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
build
@Nonnull public ExecutableQuery build(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull Map<String, List<IdPAttributeValue>> dependencyAttributes) throws ResolutionExceptionCreates an executable search that can be executed against a data source in order to produce results.- Specified by:
buildin interfaceExecutableSearchBuilder<ExecutableQuery>- Parameters:
resolutionContext- current request contextdependencyAttributes- 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 ResolutionExceptionResolve the attribute authority entityID.- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- 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 processedauthorityRoleDescriptor- 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 ResolutionExceptionBuild the SOAP client operation context.- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- the current set of dependency attributesroleDescriptor- the role descriptor of the attribute authority being processedendpoint- 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 ResolutionExceptionResolve the entity ID of the protocol message issuer (this entity).- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- the current set of dependency attributesroleDescriptor- 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 ResolutionExceptionBuild the attribute query message to be sent to the attribute authority.- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- the current set of dependency attributesroleDescriptor- the role descriptor of the attribute authority being processedendpoint- the attribute authority endpointselfEntityID- 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
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 ResolutionExceptionBuild SAML protocol message Subject element.- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- the current set of dependency attributesroleDescriptor- 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 ResolutionExceptionBuild the list of requested attributes for the SAML protocol message.- Parameters:
resolutionContext- the current attribute resolution contextdependencyAttributes- the current set of dependency attributesroleDescriptor- 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
-