Class AbstractConsentStorageAction

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.profile.action.ProfileAction, Aware, MessageSource, MessageSourceAware, Action
    Direct Known Subclasses:
    AbstractConsentIndexedStorageAction, ReadConsentFromStorage, UpdateCounter

    public abstract class AbstractConsentStorageAction
    extends AbstractConsentAction
    Base class for consent actions which interact with a StorageService. This action ensures that the storage service, serializer, storageContext, and storageKey are available. The storage service is provided by the profile interceptor flow descriptor. The storage serializer defaults to a ConsentSerializer. The storage context defaults to the flow ID provided by a FlowIdLookupFunction.
    Precondition:
    InterceptorContext.getAttemptedFlow() != null
    ,
    FlowDescriptor.getStorageService() != null
    ,
    StorageSerializer != null
    ,
    StorageContextLookupStrategy != null
    ,
    StorageKeyLookupStrategy != null
    ,
    storageContextLookupStrategy.apply(profileRequestContext) != null
    ,
    storageKeyLookupStrategy.apply(profileRequestContext) != null
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doInitialize()
      protected boolean doPreExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.profile.context.ProfileInterceptorContext interceptorContext)
      String getStorageContext()
      Get the storage context resulting from applying the storage context lookup strategy.
      Function<org.opensaml.profile.context.ProfileRequestContext,​String> getStorageContextLookupStrategy()
      Get the storage context lookup strategy.
      String getStorageKey()
      Get the storage key resulting from applying the storage key lookup strategy.
      Function<org.opensaml.profile.context.ProfileRequestContext,​String> getStorageKeyLookupStrategy()
      Get the storage key lookup strategy.
      org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>> getStorageSerializer()
      Get the storage serializer.
      org.opensaml.storage.StorageService getStorageService()
      Get the storage service from the ProfileInterceptorFlowDescriptor.
      void setStorageContextLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set the storage context lookup strategy.
      void setStorageKeyLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set the storage key lookup strategy.
      void setStorageSerializer​(org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>> serializer)
      Set the storage serializer.
      • Methods inherited from class net.shibboleth.idp.profile.interceptor.AbstractProfileInterceptorAction

        doExecute, doExecute, doPreExecute, setLookupStrategy
      • Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

        doExecute, execute, getMessage, getMessage, getMessage, 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, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponse
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

        destroy, doDestroy, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • log

        @Nonnull
        private final Logger log
        Class logger.
      • storageContextLookupStrategy

        @NonnullAfterInit
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> storageContextLookupStrategy
        Strategy used to determine the storage context.
      • storageKeyLookupStrategy

        @NonnullAfterInit
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> storageKeyLookupStrategy
        Strategy used to determine the storage key.
      • storageSerializer

        @NonnullAfterInit
        private org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>> storageSerializer
        Storage serializer.
      • storageService

        @Nullable
        private org.opensaml.storage.StorageService storageService
        Storage service from the ProfileInterceptorFlowDescriptor.
      • storageContext

        @Nullable
        private String storageContext
        Storage context resulting from lookup strategy.
      • storageKey

        @Nullable
        private String storageKey
        Storage key resulting from lookup strategy.
    • Constructor Detail

      • AbstractConsentStorageAction

        public AbstractConsentStorageAction()
        Constructor.
    • Method Detail

      • getStorageContextLookupStrategy

        @NonnullAfterInit
        public Function<org.opensaml.profile.context.ProfileRequestContext,​String> getStorageContextLookupStrategy()
        Get the storage context lookup strategy.
        Returns:
        the storage context lookup strategy
      • getStorageKeyLookupStrategy

        @NonnullAfterInit
        public Function<org.opensaml.profile.context.ProfileRequestContext,​String> getStorageKeyLookupStrategy()
        Get the storage key lookup strategy.
        Returns:
        the storage key lookup strategy
      • getStorageSerializer

        @NonnullAfterInit
        public org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>> getStorageSerializer()
        Get the storage serializer.
        Returns:
        the storage serializer
      • setStorageSerializer

        public void setStorageSerializer​(@Nonnull
                                         org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>> serializer)
        Set the storage serializer.
        Parameters:
        serializer - storage serializer
      • setStorageContextLookupStrategy

        public void setStorageContextLookupStrategy​(@Nonnull
                                                    Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set the storage context lookup strategy.
        Parameters:
        strategy - the storage context lookup strategy
      • setStorageKeyLookupStrategy

        public void setStorageKeyLookupStrategy​(@Nonnull
                                                Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set the storage key lookup strategy.
        Parameters:
        strategy - the storage key lookup strategy
      • getStorageService

        @Nullable
        public org.opensaml.storage.StorageService getStorageService()
        Get the storage service from the ProfileInterceptorFlowDescriptor.
        Returns:
        the storage service
      • getStorageContext

        @Nullable
        public String getStorageContext()
        Get the storage context resulting from applying the storage context lookup strategy.
        Returns:
        the storage context
      • getStorageKey

        @Nullable
        public String getStorageKey()
        Get the storage key resulting from applying the storage key lookup strategy.
        Returns:
        the storage key
      • doInitialize

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                       @Nonnull
                                       net.shibboleth.idp.profile.context.ProfileInterceptorContext interceptorContext)
        Overrides:
        doPreExecute in class AbstractConsentAction