Package net.shibboleth.idp.profile
Class RequestContextBuilder
- java.lang.Object
-
- net.shibboleth.idp.profile.RequestContextBuilder
-
public class RequestContextBuilder extends Object
Builder used to constructRequestContextused inActionexecutions.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.servlet.http.HttpServletRequesthttpRequestTheHttpServletRequestused when building the request context.private javax.servlet.http.HttpServletResponsehttpResponseTheHttpServletResponseused when building the request context.private ObjectinboundMessageThe inbound message.private StringinboundMessageIdThe ID of the inbound message.private InstantinboundMessageIssueInstantThe issue instant of the inbound message.private StringinboundMessageIssuerThe issuer of the inbound message.private StringNO_VALValue used to represent a string value that has not be set.private ObjectoutboundMessageThe outbound message.private StringoutboundMessageIdThe ID of the outbound message.private InstantoutboundMessageIssueInstantThe issue instant of the outbound message.private StringoutboundMessageIssuerThe issuer of the outbound message.private Collection<net.shibboleth.idp.profile.config.ProfileConfiguration>relyingPartyProfileConfigurationsThe profile configurations associated with the relying party.private javax.servlet.ServletContextservletContextTheServletContextused when building the request context.
-
Constructor Summary
Constructors Constructor Description RequestContextBuilder()Constructor.RequestContextBuilder(RequestContextBuilder prototype)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.opensaml.messaging.context.MessageContextbuildInboundMessageContext()Builds a inboundMessageContext.protected org.opensaml.messaging.context.MessageContextbuildOutboundMessageContext()Builds a outboundMessageContext.org.opensaml.profile.context.ProfileRequestContextbuildProfileRequestContext()Builds aProfileRequestContext.protected net.shibboleth.idp.relyingparty.RelyingPartyConfigurationbuildRelyingPartyConfiguration()Builds aRelyingPartyConfiguration.protected net.shibboleth.idp.profile.context.RelyingPartyContextbuildRelyingPartyContext(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)BuildsRelyingPartyContext.RequestContextbuildRequestContext()Builds aMockRequestContext.ServletExternalContextbuildServletExternalContext()Builds aServletExternalContext.protected net.shibboleth.idp.profile.config.ProfileConfigurationselectProfileConfiguration(Map<String,net.shibboleth.idp.profile.config.ProfileConfiguration> rpProfileConfigs)Selects the active profile configurations from the set of registered profile configuration from the relying party configuration built bybuildRelyingPartyConfiguration().RequestContextBuildersetHttpRequest(javax.servlet.http.HttpServletRequest request)Sets theHttpServletRequestused when building the request context.RequestContextBuildersetHttpResponse(javax.servlet.http.HttpServletResponse response)Sets theHttpServletResponseused when building the request context.RequestContextBuildersetInboundMessage(Object message)Sets the inbound message.RequestContextBuildersetInboundMessageId(String id)Sets the ID of the inbound message.RequestContextBuildersetInboundMessageIssueInstant(Instant instant)Sets the issue instant of the inbound messageRequestContextBuildersetInboundMessageIssuer(String issuer)Sets the issuer of the inbound message.RequestContextBuildersetOutboundMessage(Object message)Sets the outbound message.RequestContextBuildersetOutboundMessageId(String id)Sets the ID of the outbound message.RequestContextBuildersetOutboundMessageIssueInstant(Instant instant)Sets the issue instant of the outbound messageRequestContextBuildersetOutboundMessageIssuer(String issuer)Sets the issuer of the outbound message.RequestContextBuildersetRelyingPartyProfileConfigurations(Collection<net.shibboleth.idp.profile.config.ProfileConfiguration> configs)Sets the profile configurations associated with the relying party.RequestContextBuildersetServletContext(javax.servlet.ServletContext context)Sets theServletContextused when building the request context.
-
-
-
Field Detail
-
NO_VAL
private final String NO_VAL
Value used to represent a string value that has not be set.- See Also:
- Constant Field Values
-
servletContext
private javax.servlet.ServletContext servletContext
TheServletContextused when building the request context.
-
httpRequest
private javax.servlet.http.HttpServletRequest httpRequest
TheHttpServletRequestused when building the request context.
-
httpResponse
private javax.servlet.http.HttpServletResponse httpResponse
TheHttpServletResponseused when building the request context.
-
inboundMessageId
private String inboundMessageId
The ID of the inbound message.
-
inboundMessageIssueInstant
private Instant inboundMessageIssueInstant
The issue instant of the inbound message.
-
inboundMessageIssuer
private String inboundMessageIssuer
The issuer of the inbound message.
-
inboundMessage
private Object inboundMessage
The inbound message.
-
outboundMessageId
private String outboundMessageId
The ID of the outbound message.
-
outboundMessageIssueInstant
private Instant outboundMessageIssueInstant
The issue instant of the outbound message.
-
outboundMessageIssuer
private String outboundMessageIssuer
The issuer of the outbound message.
-
outboundMessage
private Object outboundMessage
The outbound message.
-
relyingPartyProfileConfigurations
private Collection<net.shibboleth.idp.profile.config.ProfileConfiguration> relyingPartyProfileConfigurations
The profile configurations associated with the relying party.
-
-
Constructor Detail
-
RequestContextBuilder
public RequestContextBuilder()
Constructor.
-
RequestContextBuilder
public RequestContextBuilder(RequestContextBuilder prototype)
Constructor.- Parameters:
prototype- prototype whose properties are copied onto this builder
-
-
Method Detail
-
setServletContext
@Nonnull public RequestContextBuilder setServletContext(@Nullable javax.servlet.ServletContext context)
Sets theServletContextused when building the request context.- Parameters:
context- theServletContextused when building the request context- Returns:
- this builder
-
setHttpRequest
@Nonnull public RequestContextBuilder setHttpRequest(@Nullable javax.servlet.http.HttpServletRequest request)
Sets theHttpServletRequestused when building the request context.- Parameters:
request- theHttpServletRequestused when building the request context- Returns:
- this builder
-
setHttpResponse
@Nonnull public RequestContextBuilder setHttpResponse(@Nullable javax.servlet.http.HttpServletResponse response)
Sets theHttpServletResponseused when building the request context.- Parameters:
response- theHttpServletResponseused when building the request context- Returns:
- this builder
-
setInboundMessageId
@Nonnull public RequestContextBuilder setInboundMessageId(@Nullable String id)
Sets the ID of the inbound message.- Parameters:
id- ID of the inbound message- Returns:
- this builder
-
setInboundMessageIssueInstant
@Nonnull public RequestContextBuilder setInboundMessageIssueInstant(@Nullable Instant instant)
Sets the issue instant of the inbound message- Parameters:
instant- issue instant of the inbound message- Returns:
- this builder
-
setInboundMessageIssuer
@Nonnull public RequestContextBuilder setInboundMessageIssuer(@Nullable String issuer)
Sets the issuer of the inbound message.- Parameters:
issuer- issuer of the inbound message- Returns:
- this builder
-
setInboundMessage
@Nonnull public RequestContextBuilder setInboundMessage(@Nullable Object message)
Sets the inbound message.- Parameters:
message- the inbound message- Returns:
- this builder
-
setOutboundMessageId
@Nonnull public RequestContextBuilder setOutboundMessageId(@Nullable String id)
Sets the ID of the outbound message.- Parameters:
id- ID of the outbound message- Returns:
- this builder
-
setOutboundMessageIssueInstant
@Nonnull public RequestContextBuilder setOutboundMessageIssueInstant(@Nullable Instant instant)
Sets the issue instant of the outbound message- Parameters:
instant- issue instant of the outbound message- Returns:
- this builder
-
setOutboundMessageIssuer
public RequestContextBuilder setOutboundMessageIssuer(@Nullable String issuer)
Sets the issuer of the outbound message.- Parameters:
issuer- issuer of the outbound message- Returns:
- this builder
-
setOutboundMessage
@Nonnull public RequestContextBuilder setOutboundMessage(@Nullable Object message)
Sets the outbound message.- Parameters:
message- the outbound message- Returns:
- this builder
-
setRelyingPartyProfileConfigurations
@Nonnull public RequestContextBuilder setRelyingPartyProfileConfigurations(@Nullable Collection<net.shibboleth.idp.profile.config.ProfileConfiguration> configs)
Sets the profile configurations associated with the relying party.- Parameters:
configs- profile configurations associated with the relying party- Returns:
- this builder
-
buildRequestContext
@Nonnull public RequestContext buildRequestContext() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
Builds aMockRequestContext. The default implementation builds aMockRequestContextthat contains a:ServletExternalContext, viaRequestContext.getExternalContext(), created bybuildServletExternalContext()ProfileRequestContextcreated bybuildProfileRequestContext()
- Returns:
- the constructed
MockRequestContext - Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException- ...
-
buildServletExternalContext
@Nonnull public ServletExternalContext buildServletExternalContext()
Builds aServletExternalContext. The default implementations builds aServletExternalContextthat contains a:- the
ServletContextprovided bysetServletContext(ServletContext)or aMockServletContextif none was provided - the
HttpServletRequestprovided bysetHttpRequest(HttpServletRequest)or aMockHttpServletRequestif none was provided - the
HttpServletResponseprovided bysetHttpResponse(HttpServletResponse)or aMockHttpServletResponseif none was provided
- Returns:
- the constructed
ServletContext
- the
-
buildProfileRequestContext
@Nonnull public org.opensaml.profile.context.ProfileRequestContext buildProfileRequestContext() throws net.shibboleth.utilities.java.support.component.ComponentInitializationExceptionBuilds aProfileRequestContext. The default implementation builds aProfileRequestContextthat contains a:- inbound message context created by
buildInboundMessageContext() - outbound message context created by
buildOutboundMessageContext() RelyingPartyContextcreated bybuildRelyingPartyContext(ProfileRequestContext)
- Returns:
- the constructed {
- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException- @link ProfileRequestContext
- inbound message context created by
-
buildInboundMessageContext
@Nonnull protected org.opensaml.messaging.context.MessageContext buildInboundMessageContext()
Builds a inboundMessageContext. The default implementation builds aMessageContextthat contains:- the message provided by
setInboundMessage(Object)
- Returns:
- the constructed
MessageContext
- the message provided by
-
buildOutboundMessageContext
@Nonnull protected org.opensaml.messaging.context.MessageContext buildOutboundMessageContext()
Builds a outboundMessageContext. The default implementation builds aMessageContextthat contains:- the message provided by
setOutboundMessage(Object)
- Returns:
- the constructed
MessageContext
- the message provided by
-
buildRelyingPartyContext
@Nonnull protected net.shibboleth.idp.profile.context.RelyingPartyContext buildRelyingPartyContext(@Nonnull org.opensaml.profile.context.ProfileRequestContext profileRequestContext) throws net.shibboleth.utilities.java.support.component.ComponentInitializationExceptionBuildsRelyingPartyContext. The default implementations builds aRelyingPartyContextwith:- a relying party ID provided by
setInboundMessageIssuer(String)orActionTestingSupport.INBOUND_MSG_ISSUERif none is given - a relying party configuration built by
buildRelyingPartyConfiguration() - the active profile selected, out of the profiles registered with the built relying party configuration, by
selectProfileConfiguration(Map)
- Parameters:
profileRequestContext- ...- Returns:
- the constructed
RelyingPartyContext - Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException- ...
- a relying party ID provided by
-
buildRelyingPartyConfiguration
@Nonnull protected net.shibboleth.idp.relyingparty.RelyingPartyConfiguration buildRelyingPartyConfiguration() throws net.shibboleth.utilities.java.support.component.ComponentInitializationExceptionBuilds aRelyingPartyConfiguration. The default implementation of this method builds aRelyingPartyConfigurationsuch that:- configuration ID is 'mock'
- the responder ID provided by
setOutboundMessageIssuer(String)orActionTestingSupport.OUTBOUND_MSG_ISSUERif none is given - the activation criteria is
Predicates.alwaysTrue() - the profile configurations provided
setRelyingPartyProfileConfigurations(Collection)or oneMockProfileConfigurationif none is provided
- Returns:
- the constructed
RelyingPartyConfiguration - Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException- ...
-
selectProfileConfiguration
@Nullable protected net.shibboleth.idp.profile.config.ProfileConfiguration selectProfileConfiguration(@Nonnull Map<String,net.shibboleth.idp.profile.config.ProfileConfiguration> rpProfileConfigs)Selects the active profile configurations from the set of registered profile configuration from the relying party configuration built bybuildRelyingPartyConfiguration(). The default implementation of this method simply returns the first value of theMap.values()collection.- Parameters:
rpProfileConfigs- the set of profile configurations associated with the constructed relying party- Returns:
- the active
ProfileConfiguration
-
-