Package org.digidoc4j
Class TimestampBuilder
java.lang.Object
org.digidoc4j.TimestampBuilder
- All Implemented Interfaces:
Serializable
,TimestampParameters
- Direct Known Subclasses:
AsicContainerTimestampBuilder
A builder for creating timestamps that cover the contents of specific containers.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TimestampBuilder
aTimestamp
(Container container) Creates an instance of a timestamp builder for the contents of the specified container.Returns the configured reference digest algorithm, falling back to the value fromConfiguration.getArchiveTimestampReferenceDigestAlgorithm()
, falling back to the value fromgetTimestampDigestAlgorithm()
.Returns the configured timestamp digest algorithm, falling back to the value fromConfiguration.getArchiveTimestampDigestAlgorithm()
, falling back to the value ofConstant.Default.ARCHIVE_TIMESTAMP_DIGEST_ALGORITHM
.Returns the configured TSP source URL string, falling back to the value fromConfiguration.getTspSourceForArchiveTimestamps()
.Invokes timestamping process based on the current state of this builder and returns the newly created timestamp.withReferenceDigestAlgorithm
(DigestAlgorithm digestAlgorithm) Configures the reference digest algorithm to be used by this builder.withTimestampDigestAlgorithm
(DigestAlgorithm digestAlgorithm) Configures the timestamp digest algorithm to be used by this builder.withTspSource
(String tspSource) Configures the TSP source URL string to be used by this builder.
-
Constructor Details
-
TimestampBuilder
public TimestampBuilder()
-
-
Method Details
-
aTimestamp
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
Invokes timestamping process based on the current state of this builder and returns the newly created timestamp.- Returns:
- the newly created timestamp
-
withReferenceDigestAlgorithm
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. anASiCArchiveManifest.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, seegetReferenceDigestAlgorithm()
.- Parameters:
digestAlgorithm
- reference digest algorithm- Returns:
- builder for creating a timestamp
-
getReferenceDigestAlgorithm
Returns the configured reference digest algorithm, falling back to the value fromConfiguration.getArchiveTimestampReferenceDigestAlgorithm()
, falling back to the value fromgetTimestampDigestAlgorithm()
.- Specified by:
getReferenceDigestAlgorithm
in interfaceTimestampParameters
- Returns:
- configured reference digest algorithm or a default
-
withTimestampDigestAlgorithm
Configures the timestamp digest algorithm to be used by this builder. For more information about the defaults used when this is not configured, seegetTimestampDigestAlgorithm()
.- Parameters:
digestAlgorithm
- timestamp digest algorithm- Returns:
- builder for creating a timestamp
-
getTimestampDigestAlgorithm
Returns the configured timestamp digest algorithm, falling back to the value fromConfiguration.getArchiveTimestampDigestAlgorithm()
, falling back to the value ofConstant.Default.ARCHIVE_TIMESTAMP_DIGEST_ALGORITHM
.- Specified by:
getTimestampDigestAlgorithm
in interfaceTimestampParameters
- Returns:
- configured timestamp digest algorithm or a default
-
withTspSource
Configures the TSP source URL string to be used by this builder. For more information about the defaults used when this is not configured, seegetTspSource()
.- Parameters:
tspSource
- TSP source URL string- Returns:
- builder for creating a timestamp
-
getTspSource
Returns the configured TSP source URL string, falling back to the value fromConfiguration.getTspSourceForArchiveTimestamps()
.- Specified by:
getTspSource
in interfaceTimestampParameters
- Returns:
- configured TSP source URL string or a default
-