Package net.shibboleth.sp.profile.impl
Class RecoverStateData
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.sp.profile.AbstractAgentRequestAction
net.shibboleth.sp.profile.AbstractAgentAction
net.shibboleth.sp.profile.AbstractApplicationAction
net.shibboleth.sp.profile.impl.RecoverStateData
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that maps a state token into a
StateData (or subclass) object.
The state token comes from a pluggable function.
The token and the recovered object will be set into a StateDataContext
created by a pluggable strategy.
Errors resulting from the absence of a state token or a failure to recover associated state
may be ignored or result in an EventIds.IO_ERROR event. For example, if the protocol supports
unsolicited requests, a failure to retrieve prior state may be expected and should be ignored.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,EventIds.IO_ERROR- Precondition:
AgentRequestContext.getOutput().isstruct()
,AgentRequestContext.getRemotedServletResponse() != null
- Postcondition:
- a
StateDataContextis created and populated as directed
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classDefault lookup strategy locates state token from Agent request. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether any failure to recover previously stored state should result in a fatal event.private final org.slf4j.LoggerClass logger.Specific class to be recovered.Strategy used to create theStateDataContextto populate.private StringState token returned by lookup function.private Function<ProfileRequestContext,String> Lookup strategy for state token. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) voidsetErrorFatal(boolean flag) Sets whether any failure to recover previously stored state should result in a fatal event.voidsetStateDataClass(Class<? extends StateData> type) Sets the type ofStateDatasubclass to recover from the state token.voidSets the strategy used to create theStateDataContext.voidSets the lookup strategy to obtain the protocol specific state token.Methods inherited from class net.shibboleth.sp.profile.AbstractApplicationAction
ensureApplication, getApplicationMethods inherited from class net.shibboleth.sp.profile.AbstractAgentAction
ensureAgent, getAgentMethods inherited from class net.shibboleth.sp.profile.AbstractAgentRequestAction
ensureAgentRequestContext, getAgentRequestContext, setAgentRequestContextLookupStrategyMethods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
stateDataContextCreationStrategy
Strategy used to create theStateDataContextto populate. -
stateTokenLookupStrategy
Lookup strategy for state token. -
errorFatal
private boolean errorFatalWhether any failure to recover previously stored state should result in a fatal event. -
stateDataClass
Specific class to be recovered. -
stateToken
State token returned by lookup function.
-
-
Constructor Details
-
RecoverStateData
public RecoverStateData()Constructor.
-
-
Method Details
-
setStateDataContextCreationStrategy
public void setStateDataContextCreationStrategy(@Nonnull Function<ProfileRequestContext, StateDataContext> strategy) Sets the strategy used to create theStateDataContext.- Parameters:
strategy- creation strategy
-
setStateTokenLookupStrategy
Sets the lookup strategy to obtain the protocol specific state token.- Parameters:
strategy- lookup strategy
-
setErrorFatal
public void setErrorFatal(boolean flag) Sets whether any failure to recover previously stored state should result in a fatal event.Defaults to false.
- Parameters:
flag- flag to set
-
setStateDataClass
Sets the type ofStateDatasubclass to recover from the state token.- Parameters:
type- subtype to recover
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractApplicationAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-