Interface DataProvider<T>

Type Parameters:
T - The type of handled objects.

public interface DataProvider<T>
Provides objects for display within a report plug-in's results list.
Providers must implement functionality to support incremental result lists in order to enable dynamic result loading during continuous scrolling operations:
  • Whenever the report is first displayed or its filter parameters are changed by the user (requiring the generation of a completely new result list), a new object of this data provider class is instantiated; Client will then call start() first to allow for setup of local fields that will beused in subsequent calls of other methods, e.g. getNext() or isRunning().
  • Between filter configuration changes, the current object instance of this class is persisted; Client will repeatedly call getNext() and isRunning() in order to obtain incremental batches of result objects and to check if anyfurther results that haven't yet been returned in those incremental batches are available, respectively.
Since:
5.1.19
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Closure method; called if the report provider is no longer needed.
    deserialize(@NotNull String string)
    Returns the object for the given id or null if itcouldn't be found or is no longer available.
    getNext(int count)
    Returns an incremental result set of objects, potentially using start()'s parameter input as afilter configuration to limit the result set to match certain criteria.
    int
    Returns the total number of results that are available for display in the report's results list (based on the current filter parameters) or -1 if the object-providing process is still running.
    boolean
    Return the running state of this object.
    @Nullable String
    serialize(T object)
    Returns a string identifier for the given object or null if this elementhas no identifier.
    void
    start(SpecialistsBroker broker, ParameterMap parameter)
    Initialization; called before any other methods.
  • Method Details

    • start

      void start(SpecialistsBroker broker, ParameterMap parameter)
      Initialization; called before any other methods. Typically used to start the object-providing process when the report is first displayed and when the filter configuration is changed.
      Parameters:
      broker - Request local specialists broker
      parameter - Report parameter values (see WebeditReportPlugin).
      Since:
      5.1.19
    • getNext

      List<T> getNext(int count)
      Returns an incremental result set of objects, potentially using start()'s parameter input as afilter configuration to limit the result set to match certain criteria. The list should not contain more than the specified count of entries and not include duplicates of the same object in result lists during repeatedcalls of this method during the lifetime of this object.
      Parameters:
      count - The requested count of elements.
      Returns:
      A List of further objects that the client should include in the report's display.
      Since:
      5.1.19
    • isRunning

      boolean isRunning()
      Return the running state of this object. If getNext() has not yet returned all results that are available(based on whichever criteria), the provider should be considered running in order to communicate to the client that more results are available on-demand. If no further results can be returned by getNext(), the provider should be considered stopped ( isRunning() returns false) and remain that way for the remainder of the object's lifetime.
      Returns:
      true if this provider is still running and can provide more results; otherwise false.
      Since:
      5.1.19
    • getTotal

      int getTotal()
      Returns the total number of results that are available for display in the report's results list (based on the current filter parameters) or -1 if the object-providing process is still running.
      Returns:
      Total number of elements or -1 while the object-providing process is running.
      Since:
      5.1.19
    • close

      void close()
      Closure method; called if the report provider is no longer needed. Cleans up resources and stops object-providing processes.
      Since:
      5.1.19
    • serialize

      @Nullable @Nullable String serialize(@NotNull T object)
      Returns a string identifier for the given object or null if this elementhas no identifier. Note: This method will only be used in the ContentCreator (webclient).
      Parameters:
      object - to identify.
      Returns:
      string identifier or null.
      Since:
      5.1.19
    • deserialize

      @Nullable T deserialize(@NotNull @NotNull String string)
      Returns the object for the given id or null if itcouldn't be found or is no longer available. Note: This method will only be used in the ContentCreator (webclient).
      Parameters:
      string - object identifier, previously returned by serialize(Object).
      Returns:
      identified object or null.
      Since:
      5.1.19