Class DataFetchEndedEvent

All Implemented Interfaces:
Serializable

public class DataFetchEndedEvent extends AbstractDataFetchEvent
Event fired through the service event bus once a page of items has been loaded and consumed, or the fetch threw, on the thread that requested it.

Fired in reverse listener registration order, so that listeners nest around the matching DataFetchStartedEvent. Because a data provider may return a lazily evaluated Stream, this is fired after the returned items have been consumed, so the measured duration covers the backend round-trip rather than only the call that started it.

Since:
25.3
See Also:
  • Constructor Details

    • DataFetchEndedEvent

      public DataFetchEndedEvent(UI ui, Component component, int offset, int limit, boolean filtered, int rowsReturned)
      Creates a new event.
      Parameters:
      ui - the UI the fetching component belongs to, not null
      component - the component whose data is being fetched, or null if it could not be resolved
      offset - the index of the first item requested
      limit - the number of items requested
      filtered - whether a filter was set on the query
      rowsReturned - the number of items the data provider actually returned, which may be fewer than AbstractDataFetchEvent.getLimit(), or -1 if the fetch threw, in which case a DataFetchFailedEvent carrying the throwable was fired first
  • Method Details

    • getRowsReturned

      public int getRowsReturned()
      Gets the number of items the data provider actually returned.
      Returns:
      the row count, or -1 if the fetch threw