Class AbstractResponseShellAction<MessageType extends org.opensaml.saml.saml2.core.StatusResponseType>

  • Type Parameters:
    MessageType - the actual message type
    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

    public abstract class AbstractResponseShellAction<MessageType extends org.opensaml.saml.saml2.core.StatusResponseType>
    extends org.opensaml.profile.action.AbstractProfileAction
    Abstract action that creates an empty object derived from StatusResponseType, and sets it as the message returned by InOutOperationContext.getOutboundMessageContext().

    The Status is set to StatusCode.SUCCESS as a default assumption, and this can be overridden by subsequent actions.

    If an issuer value is returned via a lookup strategy, then it's set as the Issuer of the message.

    Event:
    EventIds.PROCEED_EVENT_ID, EventIds.INVALID_MSG_CTX
    Postcondition:
    ProfileRequestContext.getOutboundMessageContext().getMessage() != null
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy idGenerator
      The generator to use.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy> idGeneratorLookupStrategy
      Strategy used to locate the IdentifierGenerationStrategy to use.
      private String issuerId
      EntityID to populate into Issuer element.
      private Function<org.opensaml.profile.context.ProfileRequestContext,​String> issuerLookupStrategy
      Strategy used to obtain the response issuer value.
      private Logger log
      Class logger.
      private boolean overwriteExisting
      Overwrite an existing message?
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
      protected boolean doPreExecute​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
      protected abstract QName getMessageType()
      Get the type of message to build.
      void setIdentifierGeneratorLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy> strategy)
      Set the strategy used to locate the IdentifierGenerationStrategy to use.
      void setIssuerLookupStrategy​(Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
      Set the strategy used to locate the issuer value to use.
      void setOverwriteExisting​(boolean flag)
      Set whether to overwrite an existing message.
      • 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, doInitialize, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent

        initialize, isInitialized
    • Field Detail

      • log

        @Nonnull
        private Logger log
        Class logger.
      • overwriteExisting

        private boolean overwriteExisting
        Overwrite an existing message?
      • idGeneratorLookupStrategy

        @Nonnull
        private Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy> idGeneratorLookupStrategy
        Strategy used to locate the IdentifierGenerationStrategy to use.
      • issuerLookupStrategy

        @Nullable
        private Function<org.opensaml.profile.context.ProfileRequestContext,​String> issuerLookupStrategy
        Strategy used to obtain the response issuer value.
      • idGenerator

        @Nullable
        private net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy idGenerator
        The generator to use.
      • issuerId

        @Nullable
        private String issuerId
        EntityID to populate into Issuer element.
    • Constructor Detail

      • AbstractResponseShellAction

        public AbstractResponseShellAction()
        Constructor.
    • Method Detail

      • setOverwriteExisting

        public void setOverwriteExisting​(boolean flag)
        Set whether to overwrite an existing message.
        Parameters:
        flag - flag to set
      • setIdentifierGeneratorLookupStrategy

        public void setIdentifierGeneratorLookupStrategy​(@Nonnull
                                                         Function<org.opensaml.profile.context.ProfileRequestContext,​net.shibboleth.utilities.java.support.security.IdentifierGenerationStrategy> strategy)
        Set the strategy used to locate the IdentifierGenerationStrategy to use.
        Parameters:
        strategy - lookup strategy
      • setIssuerLookupStrategy

        public void setIssuerLookupStrategy​(@Nullable
                                            Function<org.opensaml.profile.context.ProfileRequestContext,​String> strategy)
        Set the strategy used to locate the issuer value to use.
        Parameters:
        strategy - lookup strategy
      • doPreExecute

        protected boolean doPreExecute​(@Nonnull
                                       org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
        Overrides:
        doPreExecute in class org.opensaml.profile.action.AbstractProfileAction
      • doExecute

        protected void doExecute​(@Nonnull
                                 org.opensaml.profile.context.ProfileRequestContext profileRequestContext)
        Overrides:
        doExecute in class org.opensaml.profile.action.AbstractProfileAction
      • getMessageType

        @Nonnull
        protected abstract QName getMessageType()
        Get the type of message to build.
        Returns:
        the type of message