java.lang.Object
se.swedenconnect.opensaml.saml2.metadata.AbstractMetadataContainer<T>
Type Parameters:
T - the contained type
All Implemented Interfaces:
MetadataContainer<T>
Direct Known Subclasses:
EntitiesDescriptorContainer, EntityDescriptorContainer

public abstract class AbstractMetadataContainer<T extends TimeBoundSAMLObject & SignableSAMLObject & CacheableSAMLObject> extends Object implements MetadataContainer<T>
Abstract base class for the MetadataContainer interface.
Author:
Martin Lindström (martin@idsec.se)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default size for the ID attribute string.
    static final float
    The default update factor for the metadata - 0,75 (75%), i.e.
    static final Duration
    The default validity for metadata - one week.
    protected T
    The encapsulated descriptor element.
    protected int
    The size of the ID attribute string.
    protected X509Credential
    The signature credentials for signing the metadata entry.
    Optional signing configuration.
    protected float
    The update factor.
    protected Duration
    The validity time for created entries.
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractMetadataContainer(T descriptor, X509Credential signatureCredentials)
    Constructor assigning the encapsulated descriptor element.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    assignID(T descriptor, String id)
    Assigns the supplied id to the ID attribute of the descriptor.
    Returns a deep clone of the descriptor element that is encapsulated by this object.
    Returns the metadata element that is encapsulated by this object.
    protected abstract String
    getID(T descriptor)
    Returns the ID attribute of the supplied descriptor.
    int
    Returns the size of the ID attribute that is generated.
    protected abstract String
    getLogString(T descriptor)
    Returns a log string of the supplied descriptor.
    float
    Returns the factor (between 0 and 1) that is used to compute whether it is time to update the contained descriptor.
    Returns the duration of the validity that the encapsulated descriptor has.
    Marshals the encapsulated descriptor into its XML representation.
    void
    setIdSize(int idSize)
    Assigns the size of the ID attribute that is generated.
    void
    void
    setUpdateFactor(float updateFactor)
    Assigns the factor (between 0 and 1) that is used to compute whether it is time to update the contained descriptor.
    void
    Assigns the duration of the validity that the encapsulated EntityDescriptor should have.
    Signs the encapsulated descriptor using the signature credentials configured for this object.
    update(boolean sign)
    Updates the encapsulated descriptor with a newly generated ID, a validity time according to this object's configuration, and then optionally signs the record.
    boolean
    updateRequired(boolean signatureRequired)
    Predicate that returns true if the contained descriptor needs to be updated regarding its signature status and validity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_VALIDITY

      public static final Duration DEFAULT_VALIDITY
      The default validity for metadata - one week.
    • DEFAULT_UPDATE_FACTOR

      public static final float DEFAULT_UPDATE_FACTOR
      The default update factor for the metadata - 0,75 (75%), i.e. "update the metadata when less than 75% of its original validity time remains".
      See Also:
    • DEFAULT_DESCRIPTOR_ID_SIZE

      public static final int DEFAULT_DESCRIPTOR_ID_SIZE
      Default size for the ID attribute string.
      See Also:
    • descriptor

      protected T extends TimeBoundSAMLObject & SignableSAMLObject & CacheableSAMLObject descriptor
      The encapsulated descriptor element.
    • validity

      protected Duration validity
      The validity time for created entries.
    • updateFactor

      protected float updateFactor
      The update factor.
    • idSize

      protected int idSize
      The size of the ID attribute string.
    • signatureCredentials

      protected X509Credential signatureCredentials
      The signature credentials for signing the metadata entry.
    • signingConfiguration

      protected SignatureSigningConfiguration signingConfiguration
      Optional signing configuration.
  • Constructor Details

    • AbstractMetadataContainer

      public AbstractMetadataContainer(T descriptor, X509Credential signatureCredentials)
      Constructor assigning the encapsulated descriptor element.
      Parameters:
      descriptor - the descriptor object
      signatureCredentials - the signature credentials for signing the descriptor. May be null, but then no signing will be possible
  • Method Details