Package org.digidoc4j

Class TimestampBuilder

java.lang.Object
org.digidoc4j.TimestampBuilder
All Implemented Interfaces:
Serializable, TimestampParameters
Direct Known Subclasses:
AsicContainerTimestampBuilder

public abstract class TimestampBuilder extends Object implements Serializable, TimestampParameters
A builder for creating timestamps that cover the contents of specific containers.
See Also:
  • Constructor Details

    • TimestampBuilder

      public TimestampBuilder()
  • Method Details

    • aTimestamp

      public static TimestampBuilder aTimestamp(Container container)
      Creates an instance of a timestamp builder for the contents of the specified container.
      Parameters:
      container - container to be timestamped
      Returns:
      builder for creating a timestamp
    • invokeTimestamping

      public Timestamp invokeTimestamping()
      Invokes timestamping process based on the current state of this builder and returns the newly created timestamp.
      Returns:
      the newly created timestamp
    • withReferenceDigestAlgorithm

      public TimestampBuilder withReferenceDigestAlgorithm(DigestAlgorithm digestAlgorithm)
      Configures the reference digest algorithm to be used by this builder. Reference digest algorithm is used when a timestamp will cover a collection of references (e.g. an ASiCArchiveManifest.xml file), and each reference needs to incorporate the digest of the entity it references. For more information about the defaults used when this is not configured, see getReferenceDigestAlgorithm().
      Parameters:
      digestAlgorithm - reference digest algorithm
      Returns:
      builder for creating a timestamp
    • getReferenceDigestAlgorithm

      public DigestAlgorithm getReferenceDigestAlgorithm()
      Returns the configured reference digest algorithm, falling back to the value from Configuration.getArchiveTimestampReferenceDigestAlgorithm(), falling back to the value from getTimestampDigestAlgorithm().
      Specified by:
      getReferenceDigestAlgorithm in interface TimestampParameters
      Returns:
      configured reference digest algorithm or a default
    • withTimestampDigestAlgorithm

      public TimestampBuilder withTimestampDigestAlgorithm(DigestAlgorithm digestAlgorithm)
      Configures the timestamp digest algorithm to be used by this builder. For more information about the defaults used when this is not configured, see getTimestampDigestAlgorithm().
      Parameters:
      digestAlgorithm - timestamp digest algorithm
      Returns:
      builder for creating a timestamp
    • getTimestampDigestAlgorithm

      public DigestAlgorithm getTimestampDigestAlgorithm()
      Returns the configured timestamp digest algorithm, falling back to the value from Configuration.getArchiveTimestampDigestAlgorithm(), falling back to the value of Constant.Default.ARCHIVE_TIMESTAMP_DIGEST_ALGORITHM.
      Specified by:
      getTimestampDigestAlgorithm in interface TimestampParameters
      Returns:
      configured timestamp digest algorithm or a default
    • withTspSource

      public TimestampBuilder withTspSource(String tspSource)
      Configures the TSP source URL string to be used by this builder. For more information about the defaults used when this is not configured, see getTspSource().
      Parameters:
      tspSource - TSP source URL string
      Returns:
      builder for creating a timestamp
    • getTspSource

      public String getTspSource()
      Returns the configured TSP source URL string, falling back to the value from Configuration.getTspSourceForArchiveTimestamps().
      Specified by:
      getTspSource in interface TimestampParameters
      Returns:
      configured TSP source URL string or a default