Class RollupHelper

java.lang.Object
com.illumon.iris.console.events.rollup.RollupHelper

public class RollupHelper
extends Object
Contains logic to rollup a table contained and a DBTableModel into an IrisTreeTableModel and display it in its existing view. Also contains logic to revert the rollup.
  • Constructor Details

    • RollupHelper

      public RollupHelper​(com.fishlib.io.logger.Logger log)
  • Method Details

    • revertRollup

      public void revertRollup​(IrisTable table, IrisTreeTableModel treeModel, boolean redraw)
      Reverts a rollup.
      Parameters:
      table - the IrisTable containing the rolled up model
      treeModel - the rolled up model
      redraw - if the revert should attempt to redraw
    • showRollup

      public void showRollup​(IrisTable table, DBTableModel model, com.illumon.iris.treetable.RollupDefinition definition, org.jdom2.Element rolledupWorkspace)
      Shows a rollup.
      Parameters:
      table - the IrisTable to display the rollup
      model - the model to rollup
      definition - the rollup info containing groupby columns and aggregations
      rolledupWorkspace - optional workspace info for the resulting IrisTable, may be null
    • editRollup

      public void editRollup​(IrisTable table, IrisTreeTableModel treeModel, com.illumon.iris.treetable.RollupDefinition definition)
      Edits an existing rollup.
      Parameters:
      table - the IrisTable to display the rollup
      treeModel - the current tree model
      definition - the new rollup info to apply
    • reapplyRollup

      public void reapplyRollup​(IrisTable table, DBTableModel model)
      Reapplies a rollup that has previously been removed.
      Parameters:
      table - the IrisTable to display the rollup
      model - the table model that has been unrolled
    • saveRollup

      public void saveRollup​(IrisTreeTableModel treeTableModel, IrisTable table, String name)
      Save the currently applied rollup to the model's workspace.
      Parameters:
      treeTableModel - the model
      table - the table
      name - the name to save the rollup as
    • getSavedRollups

      public List<SavedRollup> getSavedRollups​(DBTableModel model)
      Get a list of the model's saved rollups.
      Parameters:
      model - the model
      Returns:
      a list of saved rollups
    • deleteRollup

      public void deleteRollup​(DBTableModel model, String name)
      Delete the specified rollup from the model.
      Parameters:
      model - the model
      name - the rollup to delete
    • getImportableRollups

      public Map<String,​Map<String,​SavedRollup>> getImportableRollups​(DBTableModel model)
      Returns rollup definitions which are compatible with the given model, which may then be imported to a specific table. Any rollup which has been stored within the given model already will be excluded
      Parameters:
      model - the model which is querying for potentially importable rollup definitions
      Returns:
      a map of a map of SavedRollups, mapped by rollupName and modelName