Interface DataSetHandler

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean drillDown​(org.dashbuilder.dataset.group.DataSetGroup op)
      Applies the specified group interval selection operation over the existing group op.
      boolean drillUp​(org.dashbuilder.dataset.group.DataSetGroup op)
      Reverts the changes applied by a previous drillDown operation.
      void exportCurrentDataSetLookup​(ExportFormat format, int maxRows, ExportCallback callback, Map<String,​String> columnNameMap)
      Export the current data set to a file in the specified output format.
      boolean filter​(org.dashbuilder.dataset.filter.DataSetFilter op)
      Forces the underlying data set to be updated according the specified filter.
      boolean filter​(org.dashbuilder.dataset.group.DataSetGroup op)
      Forces the underlying data set to be updated according the group interval selection filter.
      org.dashbuilder.dataset.DataSetLookup getCurrentDataSetLookup()
      Get the current data set lookup (if any)
      org.dashbuilder.dataset.group.DataSetGroup getGroupOperation​(String columnId)
      Retrieves any group operation present in the current data set lookup for the target column specified.
      org.dashbuilder.dataset.group.Interval getInterval​(String columnId, int row)
      Get the interval at the given row for the column specified.
      org.dashbuilder.dataset.DataSet getLastDataSet()
      Get the data set get on the last lookup call (if any)
      void limitDataSetRows​(int offset, int rows)
      Forces the next data set lookup request to retrieve only the specified row sub set.
      void lookupDataSet​(org.dashbuilder.dataset.client.DataSetReadyCallback callback)
      Executes the current data set lookup request configured within this handler.
      void resetAllOperations()
      Restore the current data set lookup instance to its base status.
      void sort​(String columnId, org.dashbuilder.dataset.sort.SortOrder sortOrder)
      Set the sort order operation to apply to the data set.
      boolean unfilter​(org.dashbuilder.dataset.filter.DataSetFilter op)
      Reverts the changes applied by a previous filter operation.
      boolean unfilter​(org.dashbuilder.dataset.group.DataSetGroup op)
      Reverts the changes applied by a previous filter operation.
    • Method Detail

      • getGroupOperation

        org.dashbuilder.dataset.group.DataSetGroup getGroupOperation​(String columnId)
        Retrieves any group operation present in the current data set lookup for the target column specified.
        Parameters:
        columnId - The column id. to look for.
        Returns:
        The group operation that matches the given column id. Or null if no operation is found.
      • getInterval

        org.dashbuilder.dataset.group.Interval getInterval​(String columnId,
                                                           int row)
        Get the interval at the given row for the column specified.

        In case of grouped data sets, the interval may contain information related to the group operation. For instance, for a data set grouped by month, will return an interval containing the min/max dates of such month.

        For non-grouped or grouped by label data sets, will return only an interval with the value of the row/column selected.

        The interval information is useful for filtering purposes as the data provider needs all the information related to the selected interval.
        Parameters:
        columnId - The column id.
        row - The row which interval we want to retrieve.
        Returns:
        An interval with information related to the target row/column. Or null, if
        • the column does not exist,
        • the row index is out of bounds,
        • or the value is null.
      • filter

        boolean filter​(org.dashbuilder.dataset.group.DataSetGroup op)
        Forces the underlying data set to be updated according the group interval selection filter.
        Parameters:
        op - The group interval selection operation to apply op.getSelectedIntervalNames() MUST NOT BE EMPTY.
        Returns:
        false, if the target interval selection has already been applied - true, otherwise.
      • unfilter

        boolean unfilter​(org.dashbuilder.dataset.group.DataSetGroup op)
        Reverts the changes applied by a previous filter operation.
        Parameters:
        op - The operation to remove.
        Returns:
        false, if no filter has been applied for the target operation - true, otherwise.
      • filter

        boolean filter​(org.dashbuilder.dataset.filter.DataSetFilter op)
        Forces the underlying data set to be updated according the specified filter.
        Parameters:
        op - The filter operation to apply.
        Returns:
        false, if the filter requested has already been applied - true, otherwise.
      • unfilter

        boolean unfilter​(org.dashbuilder.dataset.filter.DataSetFilter op)
        Reverts the changes applied by a previous filter operation.
        Parameters:
        op - The operation to remove.
        Returns:
        false, if no filter has been applied for the target operation - true, otherwise.
      • drillDown

        boolean drillDown​(org.dashbuilder.dataset.group.DataSetGroup op)
        Applies the specified group interval selection operation over the existing group op.
        Parameters:
        op - The group interval selection operation to apply op.getSelectedIntervalNames() MUST NOT BE EMPTY.
        Returns:
        false, if drillDown is not applicable for the target operation - true, otherwise.
      • drillUp

        boolean drillUp​(org.dashbuilder.dataset.group.DataSetGroup op)
        Reverts the changes applied by a previous drillDown operation.
        Parameters:
        op - The operation to remove.
        Returns:
        false, if no drillDown has been applied for the target operation - true, otherwise.
      • sort

        void sort​(String columnId,
                  org.dashbuilder.dataset.sort.SortOrder sortOrder)
        Set the sort order operation to apply to the data set.
        Parameters:
        columnId - The name of the column to sort.
        sortOrder - The sort order.
      • limitDataSetRows

        void limitDataSetRows​(int offset,
                              int rows)
        Forces the next data set lookup request to retrieve only the specified row sub set.
        Parameters:
        offset - The position where the row sub set starts.
        rows - The number of rows to get.
      • resetAllOperations

        void resetAllOperations()
        Restore the current data set lookup instance to its base status.
      • lookupDataSet

        void lookupDataSet​(org.dashbuilder.dataset.client.DataSetReadyCallback callback)
                    throws Exception
        Executes the current data set lookup request configured within this handler.
        Parameters:
        callback - The callback interface that is invoked right after the data is available.
        Throws:
        Exception
      • getLastDataSet

        org.dashbuilder.dataset.DataSet getLastDataSet()
        Get the data set get on the last lookup call (if any)
      • getCurrentDataSetLookup

        org.dashbuilder.dataset.DataSetLookup getCurrentDataSetLookup()
        Get the current data set lookup (if any)
      • exportCurrentDataSetLookup

        void exportCurrentDataSetLookup​(ExportFormat format,
                                        int maxRows,
                                        ExportCallback callback,
                                        Map<String,​String> columnNameMap)
        Export the current data set to a file in the specified output format.
        Parameters:
        format - The output format
        maxRows - Max rows to be exported.
        callback - The callback instance to be notified
        columnNameMap - A map containing the column header names for every column in the data set lookup