Package com.opentext.ia.sdk.sip
Interface SipSegmentationStrategy<D>
-
- Type Parameters:
D
- The type of domain objects to segment into different SIPs
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SipSegmentationStrategy<D>
Strategy for segmenting domain objects into different SIPs.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <D> SipSegmentationStrategy<D>
byMaxAius(long maxAiusPerSip)
Return a SipSegmentationStrategy that allows a maximum number of AIUs per SIP.static <D> SipSegmentationStrategy<D>
byMaxDigitalObjects(long maxDigitalObjects)
Return a SipSegmentationStrategy that allows a maximum number of digital objects per SIP.static <D> SipSegmentationStrategy<D>
byMaxDigitalObjectsSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of digital objects per SIP.static <D> SipSegmentationStrategy<D>
byMaxPdiSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum size (uncompressed) of the PDI per SIP.static <D> SipSegmentationStrategy<D>
byMaxProspectiveSipSize(long maxSize, DigitalObjectsExtraction<D> digitalObjectsExtraction)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of the SIP including the object being added, but NOT including the PDI.static <D> SipSegmentationStrategy<D>
byMaxSipSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of the SIP.static <D> SipSegmentationStrategy<D>
combining(SipSegmentationStrategy<D>... partialStrategies)
Return a SipSegmentationStrategy that combines a number of partial strategies.static long
getDomainObjectSize(java.util.Iterator<? extends DigitalObject> iterator, long maxSize)
Return the size of a domain object in bytes.boolean
shouldStartNewSip(D domainObject, SipMetrics metrics)
Determine whether to start a new SIP.
-
-
-
Method Detail
-
shouldStartNewSip
boolean shouldStartNewSip(D domainObject, SipMetrics metrics)
Determine whether to start a new SIP.- Parameters:
domainObject
- The domain object to be added to either the current SIP or a new onemetrics
- Metrics about the assembly of the current SIP- Returns:
true
if a new SIP should be started for the given domain object, orfalse
if the domain object should be stored in the current SIP
-
byMaxAius
static <D> SipSegmentationStrategy<D> byMaxAius(long maxAiusPerSip)
Return a SipSegmentationStrategy that allows a maximum number of AIUs per SIP.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxAiusPerSip
- The maximum number of AIUs that may go into a SIP- Returns:
- A SipSegmentationStrategy that allows a maximum number of AIUs per SIP
-
byMaxDigitalObjects
static <D> SipSegmentationStrategy<D> byMaxDigitalObjects(long maxDigitalObjects)
Return a SipSegmentationStrategy that allows a maximum number of digital objects per SIP.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxDigitalObjects
- The maximum number of AIUs that may go into a SIP- Returns:
- A SipSegmentationStrategy that allows a maximum number of digital objects per SIP
-
byMaxPdiSize
static <D> SipSegmentationStrategy<D> byMaxPdiSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum size (uncompressed) of the PDI per SIP.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxSize
- The maximum size of the PDI- Returns:
- A SipSegmentationStrategy that allows a maximum size of the PDI per SIP
-
byMaxDigitalObjectsSize
static <D> SipSegmentationStrategy<D> byMaxDigitalObjectsSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of digital objects per SIP.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxSize
- The maximum size of the digital objects- Returns:
- A SipSegmentationStrategy that allows a maximum total size of digital objects per SIP
-
byMaxSipSize
static <D> SipSegmentationStrategy<D> byMaxSipSize(long maxSize)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of the SIP. Does not take into account the size of the object currently being added to the SIP- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxSize
- The maximum size of the SIP- Returns:
- A SipSegmentationStrategy that allows a maximum total size of the SIP
-
byMaxProspectiveSipSize
static <D> SipSegmentationStrategy<D> byMaxProspectiveSipSize(long maxSize, DigitalObjectsExtraction<D> digitalObjectsExtraction)
Return a SipSegmentationStrategy that allows a maximum total size (uncompressed) of the SIP including the object being added, but NOT including the PDI.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
maxSize
- The maximum size of the SIPdigitalObjectsExtraction
- The extractor for the type of digital object being added.- Returns:
- A SipSegmentationStrategy that allows a maximum total size of the SIP including the object being added to the SIP
-
getDomainObjectSize
static long getDomainObjectSize(java.util.Iterator<? extends DigitalObject> iterator, long maxSize)
Return the size of a domain object in bytes.- Parameters:
maxSize
- this is the maximum allowed size for the SIPiterator
- used to iterate over the digital objects contained in the domain object- Returns:
- the size of the domain object in bytes
-
combining
@SafeVarargs static <D> SipSegmentationStrategy<D> combining(SipSegmentationStrategy<D>... partialStrategies)
Return a SipSegmentationStrategy that combines a number of partial strategies.- Type Parameters:
D
- The type of domain objects to segment into different SIPs- Parameters:
partialStrategies
- The partial strategies to combine- Returns:
- A SipSegmentationStrategy that combines a number of partial strategies
-
-