Class BasicSAMLArtifactMap

  • 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.saml.common.binding.artifact.SAMLArtifactMap

    public class BasicSAMLArtifactMap
    extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
    implements org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
    Basic artifact map implementation.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  BasicSAMLArtifactMap.Cleanup
      A cleanup task that relies on the weakly consistent iterator support in the map implementation.
      • Nested classes/interfaces inherited from interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap

        org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntry, org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntryFactory
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Duration artifactLifetime
      Lifetime of an artifact.
      private Map<String,​org.opensaml.saml.common.binding.artifact.ExpiringSAMLArtifactMapEntry> artifactStore
      Artifact mapping storage.
      private Duration cleanupInterval
      Time between cleanup checks.
      private TimerTask cleanupTask
      Task that cleans up expired records.
      private Timer cleanupTaskTimer
      Timer used to schedule cleanup tasks.
      private org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
      Factory for SAMLArtifactMapEntry instances.
      private org.slf4j.Logger log
      Class Logger.
    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class Logger.
      • artifactStore

        @NonnullAfterInit
        private Map<String,​org.opensaml.saml.common.binding.artifact.ExpiringSAMLArtifactMapEntry> artifactStore
        Artifact mapping storage.
      • artifactLifetime

        @Nonnull
        private Duration artifactLifetime
        Lifetime of an artifact.
      • entryFactory

        @Nonnull
        private org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntryFactory entryFactory
        Factory for SAMLArtifactMapEntry instances.
      • cleanupInterval

        @Nonnull
        private Duration cleanupInterval
        Time between cleanup checks. Default value: (5 mins)
      • cleanupTaskTimer

        @NonnullAfterInit
        private Timer cleanupTaskTimer
        Timer used to schedule cleanup tasks.
      • cleanupTask

        @Nullable
        private TimerTask cleanupTask
        Task that cleans up expired records.
    • Constructor Detail

      • BasicSAMLArtifactMap

        public BasicSAMLArtifactMap()
        Constructor.
    • Method Detail

      • 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
      • doDestroy

        protected void doDestroy()
        Overrides:
        doDestroy in class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
      • getArtifactLifetime

        @Nonnull
        public Duration getArtifactLifetime()
        Get the artifact entry lifetime.
        Returns:
        the artifact entry lifetime
      • getEntryFactory

        @Nonnull
        public org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntryFactory getEntryFactory()
        Get the map entry factory.
        Returns:
        the map entry factory
      • setArtifactLifetime

        public void setArtifactLifetime​(@Nonnull
                                        Duration lifetime)
        Set the artifact entry lifetime.
        Parameters:
        lifetime - artifact entry lifetime
      • setCleanupInterval

        public void setCleanupInterval​(@Nonnull
                                       Duration interval)
        Set the cleanup interval, or 0 for none.
        Parameters:
        interval - cleanup interval
      • setEntryFactory

        public void setEntryFactory​(@Nonnull
                                    org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
        Set the map entry factory.
        Parameters:
        factory - map entry factory
      • contains

        public boolean contains​(@Nonnull @NotEmpty
                                String artifact)
                         throws IOException
        Specified by:
        contains in interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
        Throws:
        IOException
      • get

        @Nullable
        public org.opensaml.saml.common.binding.artifact.SAMLArtifactMap.SAMLArtifactMapEntry get​(@Nonnull @NotEmpty
                                                                                                  String artifact)
                                                                                           throws IOException
        Specified by:
        get in interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
        Throws:
        IOException
      • put

        public void put​(@Nonnull @NotEmpty
                        String artifact,
                        @Nonnull @NotEmpty
                        String relyingPartyId,
                        @Nonnull @NotEmpty
                        String issuerId,
                        @Nonnull
                        org.opensaml.saml.common.SAMLObject samlMessage)
                 throws IOException
        Specified by:
        put in interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
        Throws:
        IOException
      • remove

        public void remove​(@Nonnull @NotEmpty
                           String artifact)
                    throws IOException
        Specified by:
        remove in interface org.opensaml.saml.common.binding.artifact.SAMLArtifactMap
        Throws:
        IOException