D
- The type of domain object to assemble SIPs frompublic class BatchSipAssembler<D>
extends java.lang.Object
To create a batch of SIPs, simply add domain objects and end the assembly process. Then access the generated files and metrics about them using getSipsMetrics().
There are several factory methods available to create common segmentation strategies and you can also combine them.
Constructor and Description |
---|
BatchSipAssembler(SipAssembler<D> assembler,
SipSegmentationStrategy<D> segmentationStrategy)
Create an instance that assembles SIPs in a temporary directory.
|
BatchSipAssembler(SipAssembler<D> assembler,
SipSegmentationStrategy<D> segmentationStrategy,
java.io.File dir)
Create an instance that assembles SIPs in the given directory.
|
BatchSipAssembler(SipAssembler<D> assembler,
SipSegmentationStrategy<D> segmentationStrategy,
java.util.function.Supplier<java.io.File> fileSupplier)
Create an instance that assembles SIPs using the given supplier of SIP files.
|
Modifier and Type | Method and Description |
---|---|
void |
add(D domainObject)
Add a domain object to the batch of SIPs.
|
protected void |
closeCurrentSip() |
void |
end()
End the batch assembly process.
|
java.util.Collection<FileGenerationMetrics> |
getSipsMetrics()
Returns the files that were generated as part of this batch and metrics about the SIPs stored in them.
|
protected void |
setFinalSipInDss(boolean finalSipInDss) |
protected void |
sipEnded(FileGenerationMetrics metrics) |
public BatchSipAssembler(SipAssembler<D> assembler, SipSegmentationStrategy<D> segmentationStrategy)
assembler
- An assembler that builds up the SIPs in the batchsegmentationStrategy
- A strategy that determines when to start new SIPspublic BatchSipAssembler(SipAssembler<D> assembler, SipSegmentationStrategy<D> segmentationStrategy, java.io.File dir)
assembler
- An assembler that builds up the SIPs in the batchsegmentationStrategy
- A strategy that determines when to start new SIPsdir
- Directory in which to generate SIP filespublic BatchSipAssembler(SipAssembler<D> assembler, SipSegmentationStrategy<D> segmentationStrategy, java.util.function.Supplier<java.io.File> fileSupplier)
assembler
- An assembler that builds up the SIPs in the batchsegmentationStrategy
- A strategy that determines when to start new SIPsfileSupplier
- A supplier of files in which to store the SIPsprotected final void setFinalSipInDss(boolean finalSipInDss)
public void add(D domainObject) throws java.io.IOException
domainObject
- The domain object to addjava.io.IOException
- When an I/O error occursprotected final void closeCurrentSip() throws java.io.IOException
java.io.IOException
protected void sipEnded(FileGenerationMetrics metrics)
public void end() throws java.io.IOException
java.io.IOException
- When an I/O error occurspublic java.util.Collection<FileGenerationMetrics> getSipsMetrics()