Interface IBufferedStreamContent

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultBufferedStreamContent

public interface IBufferedStreamContent extends Serializable
Interface to access buffered content that is made available by writing into a stream. Every time you deal with "bigger" content that e.g. is downloaded you should select this variant of buffered content: while DefaultBufferedContent requires the content of what is downloaded to be kept in memory as a whole, this implementation does not require so but allows a direct writing of content to an output stream.

Instances of IBufferedContent need to be register in BufferedContentMgr using the method BufferedContentMgr.add(IBufferedStreamContent) to be active. Vice versa they can be de-registered when no longer used by calling method BufferedContentMgr.remove(IBufferedStreamContent).
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called directly before accessing the content.
    void
    Called directly after accessing the content.
    long
    Optional: return length of content in number of bytes.
    Content type of what is made available - e.g.
     
    URL that can be passed to the client side component.
    Deprecated.
    void
    passClientFileName(String clientFileName)
    If the access to the buffered content is associated with the download to a client file then the name of the file is passed through this method.
    void
    In case the buffered content is accessed from the client side then the query string of the access is passed.
    void
    In case the buffered content is accessed from the client side then the URL of the access is passed.
    void
    preProcessResponse(javax.servlet.http.HttpServletResponse response)
    This methods is called at the very beginning of the response processing.
    void
    This is the "central method" for writing the content.
  • Method Details

    • getId

      String getId()
    • getContentLength

      long getContentLength()
      Optional: return length of content in number of bytes. If you do not know the length of the content then just return -1.
    • preProcessResponse

      void preProcessResponse(javax.servlet.http.HttpServletResponse response)
      This methods is called at the very beginning of the response processing. It allows to e.g. set http-header parameters within the response.
    • writeStream

      void writeStream(OutputStream stream)
      This is the "central method" for writing the content. The writing directly is passed to the output stream of the e.g. servlet that manages a file download.
    • getContentType

      String getContentType()
      Content type of what is made available - e.g. "text/html" for plain HTML text. You only need to properly implement this method if you access buffered content e.g. from a browser - it is not required in file download scenarios.

      The getContentType() method is called just before you write data to the stream within the writeStream(OutputStream) method. You may change the content type until then, but as soon as you write first data the stream it cannot be changed anymore.
    • getURL

      String getURL()
      URL that can be passed to the client side component. In case of using the URL to be used within the BROWSER component you should use getURLForBROWSERUsage()
    • getURLForBROWSERUsage

      @Deprecated String getURLForBROWSERUsage()
      Deprecated.
      Deprecated - the RISC client does not support embedded mode. Use normal getURL() method.

      URL that can be passed into the BROWSER component. Background: CaptainCasa Enterprise Client can be run in embedded usage mode. In this case Tomcat is directly running inside the client - and not opening any http socket at all. In this case the URL that is passed back is a "file:///"-URL, instead of a normal "http(s)://"-URL.
    • passClientFileName

      void passClientFileName(String clientFileName)
      If the access to the buffered content is associated with the download to a client file then the name of the file is passed through this method. The method is called BEFORE #getContent() or getContentType() is called when a download is processed.
    • passCurrentRequestURL

      void passCurrentRequestURL(String url)
      In case the buffered content is accessed from the client side then the URL of the access is passed. The method is called BEFORE #getContent() or getContentType() is called when a download is processed.
    • passCurrentRequestQueryString

      void passCurrentRequestQueryString(String value)
      In case the buffered content is accessed from the client side then the query string of the access is passed. The method is called BEFORE #getContent() or getContentType() is called when a download is processed.
    • beginGetting

      void beginGetting()
      Called directly before accessing the content.
    • endGetting

      void endGetting()
      Called directly after accessing the content.