Class ResourcePayload


  • public class ResourcePayload
    extends java.lang.Object
    Data carrier used by the Consumer to send back streaming payload result data to a caller
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourcePayload​(java.lang.String logicalId, java.time.Instant lastUpdated, long resourceId, java.io.InputStream decompressedPayload)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.time.Instant getLastUpdated()  
      java.lang.String getLogicalId()
      Getter for the logicalId of this resource
      long getResourceId()
      Getter for the resourceId
      long transferTo​(java.io.OutputStream os)
      Copy the contents of the payload stream into the given OutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResourcePayload

        public ResourcePayload​(java.lang.String logicalId,
                               java.time.Instant lastUpdated,
                               long resourceId,
                               java.io.InputStream decompressedPayload)
        Parameters:
        logicalId - the non-null row identifier from the logical_resources table for this resource
        lastUpdated - the non-null lastUpdated time for this resource
        resourceId - the non-null row identifier from the x_resources table for this resource
        decompressedPayload - a non-null InputStream with the contents of a given resource in JSON format
    • Method Detail

      • getLogicalId

        public java.lang.String getLogicalId()
        Getter for the logicalId of this resource
        Returns:
      • getResourceId

        public long getResourceId()
        Getter for the resourceId
        Returns:
      • transferTo

        public long transferTo​(java.io.OutputStream os)
                        throws java.io.IOException
        Copy the contents of the payload stream into the given OutputStream
        Parameters:
        os - the OutputStream to transfer the bytes into
        Returns:
        the number of bytes transferred into the OutputStream
        Throws:
        java.io.IOException
      • getLastUpdated

        public java.time.Instant getLastUpdated()
        Returns:
        the lastUpdated