Package net.shibboleth.idp.saml.profile.impl

# Class InitializeRelyingPartyContextFromSAMLPeer

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.saml.profile.impl.InitializeRelyingPartyContextFromSAMLPeer

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class InitializeRelyingPartyContextFromSAMLPeer extends AbstractProfileAction
Action that adds a `RelyingPartyContext` to the current `ProfileRequestContext` tree via a creation function. The context is populated via a lookup strategy to locate a `SAMLPeerEntityContext`, by default via `InOutOperationContext.getInboundMessageContext()`.

Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `IdPEventIds.INVALID_RELYING_PARTY_CTX`
Postcondition:
  ProfileRequestContext.getSubcontext(RelyingPartyContext.class) != null and populated as above.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,SAMLPeerEntityContext>`
`peerEntityContextLookupStrategy`
Strategy used to look up the `SAMLPeerEntityContext` to draw from.
`private SAMLPeerEntityContext`
`peerEntityCtx`
SAML peer entity context to populate from.
`private Function<ProfileRequestContext,RelyingPartyContext>`
`relyingPartyContextCreationStrategy`
Strategy that will return or create a `RelyingPartyContext`.
`private static final Function<RelyingPartyContext,String>`
`RPID_LOOKUP`
The relying party ID lookup function to inject.
`private static final Function<RelyingPartyContext,Boolean>`
`VERIFY_LOOKUP`
The verification lookup function to inject.

## Constructor Summary

Constructors
Constructor
Description
`InitializeRelyingPartyContextFromSAMLPeer()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`void`
`setPeerEntityContextLookupStrategy(Function<ProfileRequestContext,SAMLPeerEntityContext> strategy)`
Set the strategy used to look up the `SAMLPeerEntityContext` to draw from.
`void`
`setRelyingPartyContextCreationStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)`
Set the strategy used to return or create the `RelyingPartyContext`.

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy`

### Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

`getActivationCondition, setActivationCondition`

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

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

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

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

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

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### RPID_LOOKUP

@Nonnull private static final Function<RelyingPartyContext,String> RPID_LOOKUP
The relying party ID lookup function to inject.

### VERIFY_LOOKUP

@Nonnull private static final Function<RelyingPartyContext,Boolean> VERIFY_LOOKUP
The verification lookup function to inject.

### log

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

### relyingPartyContextCreationStrategy

@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextCreationStrategy
Strategy that will return or create a `RelyingPartyContext`.

### peerEntityContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,SAMLPeerEntityContext> peerEntityContextLookupStrategy
Strategy used to look up the `SAMLPeerEntityContext` to draw from.

### peerEntityCtx

@NonnullBeforeExec private SAMLPeerEntityContext peerEntityCtx
SAML peer entity context to populate from.

## Constructor Details

### InitializeRelyingPartyContextFromSAMLPeer

public InitializeRelyingPartyContextFromSAMLPeer()
Constructor.

## Method Details

### setRelyingPartyContextCreationStrategy

public void setRelyingPartyContextCreationStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
Set the strategy used to return or create the `RelyingPartyContext`.

Parameters:
  `strategy` - creation strategy

### setPeerEntityContextLookupStrategy

public void setPeerEntityContextLookupStrategy(@Nonnull Function<ProfileRequestContext,SAMLPeerEntityContext> strategy)
Set the strategy used to look up the `SAMLPeerEntityContext` to draw from.

Parameters:
  `strategy` - strategy used to look up the `SAMLPeerEntityContext`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`