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 Summary
Constructors Constructor Description RollupHelper(com.fishlib.io.logger.Logger log)
-
Method Summary
Modifier and Type Method Description void
deleteRollup(DBTableModel model, String name)
Delete the specified rollup from the model.void
editRollup(IrisTable table, IrisTreeTableModel treeModel, com.illumon.iris.treetable.RollupDefinition definition)
Edits an existing rollup.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.List<SavedRollup>
getSavedRollups(DBTableModel model)
Get a list of the model's saved rollups.void
reapplyRollup(IrisTable table, DBTableModel model)
Reapplies a rollup that has previously been removed.void
revertRollup(IrisTable table, IrisTreeTableModel treeModel, boolean redraw)
Reverts a rollup.void
saveRollup(IrisTreeTableModel treeTableModel, IrisTable table, String name)
Save the currently applied rollup to the model's workspace.void
showRollup(IrisTable table, DBTableModel model, com.illumon.iris.treetable.RollupDefinition definition, org.jdom2.Element rolledupWorkspace)
Shows a rollup.
-
Constructor Details
-
RollupHelper
public RollupHelper(com.fishlib.io.logger.Logger log)
-
-
Method Details
-
revertRollup
Reverts a rollup.- Parameters:
table
- the IrisTable containing the rolled up modeltreeModel
- the rolled up modelredraw
- 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 rollupmodel
- the model to rollupdefinition
- the rollup info containing groupby columns and aggregationsrolledupWorkspace
- optional workspace info for the resultingIrisTable
, 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 rolluptreeModel
- the current tree modeldefinition
- the new rollup info to apply
-
reapplyRollup
Reapplies a rollup that has previously been removed.- Parameters:
table
- the IrisTable to display the rollupmodel
- the table model that has been unrolled
-
saveRollup
Save the currently applied rollup to the model's workspace.- Parameters:
treeTableModel
- the modeltable
- the tablename
- the name to save the rollup as
-
getSavedRollups
Get a list of the model's saved rollups.- Parameters:
model
- the model- Returns:
- a list of saved rollups
-
deleteRollup
Delete the specified rollup from the model.- Parameters:
model
- the modelname
- the rollup to delete
-
getImportableRollups
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
-