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 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 one
        metrics - Metrics about the assembly of the current SIP
        Returns:
        true if a new SIP should be started for the given domain object, or false 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 SIP
        digitalObjectsExtraction - 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 SIP
        iterator - used to iterate over the digital objects contained in the domain object
        Returns:
        the size of the domain object in bytes