Class BasicSAMLArtifactMap

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.saml.common.binding.artifact.impl.BasicSAMLArtifactMap
All Implemented Interfaces:
Component, DestructableComponent, InitializableComponent, SAMLArtifactMap

public class BasicSAMLArtifactMap extends AbstractInitializableComponent implements SAMLArtifactMap
Basic artifact map implementation.
  • Field Details

  • Constructor Details

    • BasicSAMLArtifactMap

      public BasicSAMLArtifactMap()
      Constructor.
  • Method Details

    • doInitialize

      protected void doInitialize() throws ComponentInitializationException
      Overrides:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException
    • teardownBasicSAMLArtifactMap

      @OnTeardown public final void teardownBasicSAMLArtifactMap()
      Tear down worker tasks when the containing service reloads.
    • getArtifactLifetime

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

      @Nonnull public 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 SAMLArtifactMap.SAMLArtifactMapEntryFactory factory)
      Set the map entry factory.
      Parameters:
      factory - map entry factory
    • contains

      public boolean contains(@Nonnull @NotEmpty String artifact) throws IOException
      Checks if a given artifact has a map entry.
      Specified by:
      contains in interface SAMLArtifactMap
      Parameters:
      artifact - the artifact to check
      Returns:
      true iff this map has an entry for the given artifact
      Throws:
      IOException - if an error occurs retrieving the information
    • get

      @Nullable public SAMLArtifactMap.SAMLArtifactMapEntry get(@Nonnull @NotEmpty String artifact) throws IOException
      Gets the artifact entry for the given artifact.
      Specified by:
      get in interface SAMLArtifactMap
      Parameters:
      artifact - the artifact to retrieve the entry for
      Returns:
      the entry, or null if the artifact has already expired or did not exist
      Throws:
      IOException - if an error occurs retrieving the information
    • put

      public void put(@Nonnull @NotEmpty String artifact, @Nonnull @NotEmpty String relyingPartyId, @Nonnull @NotEmpty String issuerId, @Nonnull SAMLObject samlMessage) throws IOException
      Creates a mapping between a given artifact and the SAML message to which it maps.
      Specified by:
      put in interface SAMLArtifactMap
      Parameters:
      artifact - the artifact
      relyingPartyId - ID of the party the artifact was sent to
      issuerId - ID of the issuer of the artifact
      samlMessage - the SAML message
      Throws:
      IOException - if an error occurs storing the information
    • remove

      public void remove(@Nonnull @NotEmpty String artifact) throws IOException
      Removes the artifact from this map.
      Specified by:
      remove in interface SAMLArtifactMap
      Parameters:
      artifact - artifact to be removed
      Throws:
      IOException - if an error occurs retrieving the information