Klasse CachedOutput

java.lang.Object
com.inet.report.cache.store.CachedOutput
Alle implementierten Schnittstellen:
DocumentOutput, Comparable<CachedOutput>

public class CachedOutput extends Object implements DocumentOutput, Comparable<CachedOutput>
Implementation of DocumentOutput that saves in the report cache.
Seit:
16.2
  • Konstruktordetails

    • CachedOutput

      public CachedOutput(ReportCacheKey key, ReportGenerator engine)
      Create a new instance.
      Parameter:
      key - the report key
      engine - the related Engine
      Seit:
      16.2
  • Methodendetails

    • getPageCount

      public int getPageCount()
      Get the current count of pages.
      Angegeben von:
      getPageCount in Schnittstelle DocumentOutput
      Gibt zurück:
      the page count
    • clear

      public void clear()
      Reset this output in the initial state. So getPageCount() == 0 and getFontCount() == 0.
      Angegeben von:
      clear in Schnittstelle DocumentOutput
    • getPageData

      public byte[] getPageData(int idx) throws ArrayIndexOutOfBoundsException
      Get the binary data of a page/chunk.
      Angegeben von:
      getPageData in Schnittstelle DocumentOutput
      Parameter:
      idx - the index, starts with 1
      Gibt zurück:
      the data, never null
      Löst aus:
      ArrayIndexOutOfBoundsException - if index is out of range
    • getGroupTree

      public byte[] getGroupTree()
      Get the data of the group tree.
      Angegeben von:
      getGroupTree in Schnittstelle DocumentOutput
      Gibt zurück:
      Can be null, if not set.
    • addPage

      public void addPage(byte[] page) throws IllegalStateException
      Add a page/chunk. Increment DocumentOutput.getPageCount()
      Angegeben von:
      addPage in Schnittstelle DocumentOutput
      Parameter:
      page - the binary data, never null
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • setPageData

      public void setPageData(byte[] page, int idx) throws IllegalStateException
      Override/patched an existing page/chunk.
      Angegeben von:
      setPageData in Schnittstelle DocumentOutput
      Parameter:
      page - die binary data, never null
      idx - the index, starts with 1
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • setGroupTree

      public void setGroupTree(byte[] data) throws IllegalStateException
      Set the group tree. After this call this output is finish and any try to change this object should throw an exception. This call does not change DocumentOutput.getPageCount().
      Angegeben von:
      setGroupTree in Schnittstelle DocumentOutput
      Parameter:
      data - the binary data, never null, but can be an empty array
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • setErrorData

      public void setErrorData(byte[] error) throws IllegalStateException
      Set error data. After this call this output is finish and any try to change this object should throw an exception.
      Angegeben von:
      setErrorData in Schnittstelle DocumentOutput
      Parameter:
      error - serialized Exception
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • stop

      public void stop(String cause)
      The rendering was stopped. This is called from Engine.stop(). After this call any try to change this object should throw an exception.
      Angegeben von:
      stop in Schnittstelle DocumentOutput
      Parameter:
      cause - an optional message
    • addFontData

      public void addFontData(byte[] fontData) throws IllegalStateException
      Add the data for an embedded font. Increment DocumentOutput.getFontCount(). This method is only used from the Java/C# output format.
      Angegeben von:
      addFontData in Schnittstelle DocumentOutput
      Parameter:
      fontData - binary data in the current protocol format.
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • setFontData

      public void setFontData(byte[] fontData, int idx) throws IllegalStateException
      Override the font data with a new version.
      Angegeben von:
      setFontData in Schnittstelle DocumentOutput
      Parameter:
      fontData - binary data in the current protocol format.
      idx - the index, starts with 0
      Löst aus:
      IllegalStateException - if this output is finish or stopped.
    • getFontData

      public byte[] getFontData(int idx) throws ArrayIndexOutOfBoundsException
      Get the font data from the given index.
      Angegeben von:
      getFontData in Schnittstelle DocumentOutput
      Parameter:
      idx - the index, starts with 0
      Gibt zurück:
      the font data, never null
      Löst aus:
      ArrayIndexOutOfBoundsException - if index is out of range
    • getFontCount

      public int getFontCount()
      Get the count of added fonts.
      Angegeben von:
      getFontCount in Schnittstelle DocumentOutput
      Gibt zurück:
      the font count
    • setPageLimitExceeded

      public void setPageLimitExceeded()
      Set that a PageLimitException exception occur.
      Angegeben von:
      setPageLimitExceeded in Schnittstelle DocumentOutput
    • isPageLimitExceeded

      public boolean isPageLimitExceeded()
      Check if the rendering of the report ran into a page limit. This means does not all possible pages exist.
      Angegeben von:
      isPageLimitExceeded in Schnittstelle DocumentOutput
      Gibt zurück:
      true, if PageLimitException was occur
    • setUsingTotalPage

      public void setUsingTotalPage()
      Set that a total page is used in the report.
      Angegeben von:
      setUsingTotalPage in Schnittstelle DocumentOutput
    • getKey

      public ReportCacheKey getKey()
      Get the key of this DocumentOutput.
      Gibt zurück:
      the key
      Seit:
      16.3
    • getEngine

      public ReportGenerator getEngine()
      Get the Engine/EngineBundle that produce the data for this output.
      Gibt zurück:
      the engine
      Seit:
      16.2
    • compareTo

      public int compareTo(CachedOutput o)
      Angegeben von:
      compareTo in Schnittstelle Comparable<CachedOutput>