Package net.shibboleth.sp.profile.impl
Class DoSessionCacheOperation
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.impl.DoSessionCacheOperation
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
Action that implements a remote API for SP agents to mamage sessions remotely.
This is implememnted internally with a StorageService but implements
the operations somewhat more efficiently with more awareness of the purpose.
- Event:
EventIds.PROCEED_EVENT_ID,EventIds.INVALID_PROFILE_CTX,EventIds.INVALID_MESSAGE,EventIds.IO_ERROR,EventIds.UNABLE_TO_DECODE,EventIds.UNABLE_TO_ENCODE,EventIds.MESSAGE_PROC_ERROR,INVALID_SESSION,MISSING_SESSION,EXPIRED_SESSION,VERSION_MISMATCH- Precondition:
AgentRequestContext.getOutput().isstruct()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCustom event for expired session.private IdentifierGenerationStrategyIdentifier generation.private DDFInput message.static final StringCustom event for invalid session.static final StringInput member for session key.private org.slf4j.LoggerClass logger.private DurationUpper bound on agent-supplied storage timeout.static final StringCustom event for invalid session.static final StringInput member for operation.private DDFOutput message.static final StringInput member for session data.static final StringStorage context for sessions.static final StringMember for session timeout.private StorageServiceStorageServiceto operate on.static final StringMember for session timeout.static final StringMember for session version.static final StringCustom event for version mismatch on conditional update. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voiddoCreate(ProfileRequestContext profileRequestContext) Perform create operation.private voiddoDelete(ProfileRequestContext profileRequestContext) Perform delete operation.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected voidprotected booleandoPreExecute(ProfileRequestContext profileRequestContext) private voiddoRead(ProfileRequestContext profileRequestContext) Perform read operation.private voiddoTouch(ProfileRequestContext profileRequestContext) Perform touch operation to update expiration (and thus time of last access).private voiddoUpdate(ProfileRequestContext profileRequestContext) Perform update operation.private StringCompute agent-specific storage context.private LongGet Agent-supplied storage timeout in seconds, bounded by configured maximum.voidSetIdentifierGenerationStrategyto use.voidsetMaxStorageTimeout(Duration timeout) Sets the maximum storage life for session records that an Agent may request.voidsetStorageService(StorageService storage) Sets theStorageServiceto use.Methods 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
-
STORAGE_CONTEXT
Storage context for sessions.- See Also:
-
INVALID_SESSION
Custom event for invalid session.- See Also:
-
MISSING_SESSION
Custom event for invalid session.- See Also:
-
EXPIRED_SESSION
Custom event for expired session.- See Also:
-
VERSION_MISMATCH
Custom event for version mismatch on conditional update.- See Also:
-
OP
Input member for operation.- See Also:
-
SESSION
Input member for session data.- See Also:
-
STORAGE_TIMEOUT
Member for session timeout.- See Also:
-
KEY
Input member for session key.- See Also:
-
TIMEOUT
Member for session timeout.- See Also:
-
VERSION
Member for session version.- See Also:
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
storageService
StorageServiceto operate on. -
identifierStrategy
Identifier generation. -
maxStorageTimeout
Upper bound on agent-supplied storage timeout. -
input
Input message. -
output
Output message.
-
-
Constructor Details
-
DoSessionCacheOperation
public DoSessionCacheOperation()Constructor.
-
-
Method Details
-
setStorageService
Sets theStorageServiceto use.- Parameters:
storage- storage service
-
setMaxStorageTimeout
Sets the maximum storage life for session records that an Agent may request.Defaults to 1 day.
- Parameters:
timeout- maximum storage lifetime
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doPreExecute
- Overrides:
doPreExecutein classAbstractAgentAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
doCreate
Perform create operation.- Parameters:
profileRequestContext- profile request context- Throws:
IOException- if an error is raised
-
doRead
Perform read operation.- Parameters:
profileRequestContext- profile request context- Throws:
IOException- if an error is raised
-
doUpdate
Perform update operation.- Parameters:
profileRequestContext- profile request context- Throws:
IOException- if an error is raised
-
doTouch
Perform touch operation to update expiration (and thus time of last access).- Parameters:
profileRequestContext- profile request context- Throws:
IOException- if an error is raised
-
doDelete
Perform delete operation.- Parameters:
profileRequestContext- profile request context- Throws:
IOException- if an error is raised
-
getStorageTimeout
Get Agent-supplied storage timeout in seconds, bounded by configured maximum.- Returns:
- effective timeout in seconds
-
getStorageContext
Compute agent-specific storage context.- Returns:
- storage context with agent qualifier
-