Class StreamedOutput


  • public class StreamedOutput
    extends Output
    Immediately as the data or error messages are added they are streamed via http connection. So the data can not be retrieved later. Before streaming they are formatted with associated formatter.
    Author:
    Jakub Kulaviak, Alex Kalderimis
    • Constructor Detail

      • StreamedOutput

        public StreamedOutput​(java.io.PrintWriter writer,
                              Formatter formatter)
        Constructor.
        Parameters:
        writer - writer where the data will be printed
        formatter - associated formatter that formats data before printing
      • StreamedOutput

        public StreamedOutput​(java.io.PrintWriter writer,
                              Formatter formatter,
                              java.lang.String separator)
        Constructor.
        Parameters:
        writer - writer where the data will be printed
        formatter - associated formatter that formats data before printing
        separator - Platform specific line-separator for the request.
    • Method Detail

      • writeLn

        public void writeLn​(java.lang.String s)
        Parameters:
        s - string to write
      • addResultItem

        public void addResultItem​(java.util.List<java.lang.String> item)
        Forwards data to associated writer
        Specified by:
        addResultItem in class Output
        Parameters:
        item - data
      • getWriter

        public java.io.PrintWriter getWriter()
        Returns associated writer
        Returns:
        writer
      • setWriter

        public void setWriter​(java.io.PrintWriter writer)
        Sets associated writer
        Parameters:
        writer - writer
      • flush

        public void flush()
        Finish writing. Writes footer ...
        Specified by:
        flush in class Output
      • writeFooter

        public void writeFooter()
        Writes footer
      • setHeaderAttributes

        public void setHeaderAttributes​(java.util.Map<java.lang.String,​java.lang.Object> attributes)
        Sets header attributes that are displayed for example in xml header.
        Overrides:
        setHeaderAttributes in class Output
        Parameters:
        attributes - header attributes
      • getResultsCount

        public int getResultsCount()
        Specified by:
        getResultsCount in class Output
        Returns:
        number of written results