Package net.shibboleth.sp.profile
Class PreserveStateDataAction
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.PreserveStateDataAction
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Base class for an action that maps
StateData from a StateDataContext to a token
suitable for safe transmission to a peer such that it can be used later to recover the information.
Errors may be ignored or result in an EventIds.IO_ERROR event.
The action will bypass execution if no StateDataContext exists or if
StateDataContext.getStateToken() is non-nul or StateDataContext.getStateData() is null.
The default implementation simply generates the token and stores it to the context. Subclasses
may override the processToken(ProfileRequestContext,String) action to perform protocol-specific
processing of the token.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_MESSAGE,EventIds.IO_ERROR- Precondition:
AgentRequestContext.getOutput().isstruct()
,AgentRequestContext.getRemotedServletResponse() != null
- Postcondition:
- ProfileRequestContext.getSubcontext(StateDataContext.class) == null or ProfileRequestContext.getSubcontext(StateDataContext.class).getStateData() == null or ProfileRequestContext.getSubcontext(StateDataContext.class).getStateToken() != null
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether an error constructing a state token is fatal.private org.slf4j.LoggerClass logger.private StateDataContextContext to operate on.Strategy used to locate theStateDataContextto preserve. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext) protected voidprocessToken(ProfileRequestContext profileRequestContext, String token) Perform additional processing on the generated state token as required by a particular protocol.voidsetErrorFatal(boolean flag) Sets whether an error computing a state token should result in a fatal event.voidSets the strategy used to lookup theStateDataContext.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, doInitialize, 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 org.slf4j.Logger logClass logger. -
stateDataContextLookupStrategy
Strategy used to locate theStateDataContextto preserve. -
errorFatal
private boolean errorFatalWhether an error constructing a state token is fatal. -
stateDataContext
Context to operate on.
-
-
Constructor Details
-
PreserveStateDataAction
public PreserveStateDataAction()Constructor.
-
-
Method Details
-
setStateDataContextLookupStrategy
public void setStateDataContextLookupStrategy(@Nonnull Function<ProfileRequestContext, StateDataContext> strategy) Sets the strategy used to lookup theStateDataContext.- Parameters:
strategy- lookup strategy
-
setErrorFatal
public void setErrorFatal(boolean flag) Sets whether an error computing a state token should result in a fatal event.Defaults to false.
- Parameters:
flag- flag to set
-
doPreExecute
- Overrides:
doPreExecutein classAbstractApplicationAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
processToken
protected void processToken(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull @NotEmpty String token) Perform additional processing on the generated state token as required by a particular protocol.The default implementation is a no-op.
- Parameters:
profileRequestContext- profile request contexttoken- state token
-