Class PartEntryFactory


  • class PartEntryFactory
    extends java.lang.Object
    This PartEntryFactory object provides a factory for creating part entry consumers. The part entry consumers created read individual entries from a list of parts within a stream. This is basically a convenience factory for the list consumer.
    See Also:
    PartSeriesConsumer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Allocator allocator
      This is used to allocate the buffers used by the entry.
      private long length
      This is the length of the parent part series body.
      private PartSeries series
      This is used to accumulate all the parts of the upload.
      private byte[] terminal
      This is the terminal token used to delimiter the upload.
    • Constructor Summary

      Constructors 
      Constructor Description
      PartEntryFactory​(Allocator allocator, PartSeries series, byte[] terminal, long length)
      Constructor for the PartEntryFactory object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      PartEntryConsumer getInstance()
      This creates a new part entry consumer that can be used to read the next part from the list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • series

        private final PartSeries series
        This is used to accumulate all the parts of the upload.
      • allocator

        private final Allocator allocator
        This is used to allocate the buffers used by the entry.
      • terminal

        private final byte[] terminal
        This is the terminal token used to delimiter the upload.
      • length

        private final long length
        This is the length of the parent part series body.
    • Constructor Detail

      • PartEntryFactory

        public PartEntryFactory​(Allocator allocator,
                                PartSeries series,
                                byte[] terminal,
                                long length)
        Constructor for the PartEntryFactory object. This is used to create a factory for entry consumers that can be used to read an entry from a part list.
        Parameters:
        allocator - this is the allocator used for buffers
        series - this is the list of parts that are extracted
        terminal - this is the terminal buffer to be used
        length - this is the length of the parent part series
    • Method Detail

      • getInstance

        public PartEntryConsumer getInstance()
        This creates a new part entry consumer that can be used to read the next part from the list. The consumer instantiated by this factory acquires the allocator, list and boundary from the enclosing part list consumer instance.
        Returns:
        a part entry consumer for this part list consumer