Package com.illumon.iris.console.utils
Class LivePivotWidget
java.lang.Object
com.illumon.util.referencecounting.ReferenceCounted
com.illumon.iris.db.util.liveness.LivenessArtifact
com.illumon.iris.console.utils.LivePivotWidget
- All Implemented Interfaces:
com.fishlib.base.log.LogOutputAppendable,Deflatable<LivePivotWidget>,CloseableWidget,ContextAwareLiveWidget<LivePivotWidget>,LiveWidget<LivePivotWidget>,LiveWidgetAclFilterable<LivePivotWidget>,LivenessManager,LivenessNode,LivenessReferent,Serializable
public class LivePivotWidget extends LivenessArtifact implements ContextAwareLiveWidget<LivePivotWidget>, Serializable, CloseableWidget, LiveWidgetAclFilterable<LivePivotWidget>
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLivePivotWidget.Aggregationstatic classLivePivotWidget.ColumnSortTypestatic classLivePivotWidget.OptionsDeprecated.This class has been replaced by PivotOptions and will be removed in a future release.static classLivePivotWidget.RowSortType -
Constructor Summary
Constructors Constructor Description LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, PivotOptions options, Function<Object,Object> colorFormat, Function<Object,Object> columnNameTransform)This constructor is used to create the widget.LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, PivotOptions options, Function<Object,Object> colorFormat, Function<Object,Object> columnNameTransform, Comparable<?>[] userRowOrder, Comparable<?>[] userColumnOrder)This constructor is used to create the widget.LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, PivotOptions options, Function<Object,Object> colorFormat, Map<String,Function<Object,Object>> colorFormats, Function<Object,Object> columnNameTransform)This constructor is used to create the widget.LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, PivotOptions options, Function<Object,Object> colorFormat, Map<String,Function<Object,Object>> colorFormats, Function<Object,Object> columnNameTransform, Comparable<?>[] userRowColumnOrder, Comparable<?>[] userColumnOrder)This constructor is used to create the widget.LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String valueColumn, LivePivotWidget.Aggregation aggregation, PivotOptions options)This constructor is used to create the widget. -
Method Summary
Modifier and Type Method Description LivePivotWidgetapplyAcls(com.fishlib.auth.UserContext userContext, RemoteQueryProcessor remoteQueryProcessor, String name)This method should apply ACLs to all tables in the widget.Inflatable<LivePivotWidget>deflate(ExportedObjectClient client)Convert this object into an Inflatable suitable for serialization.protected voiddestroy()Attempt to release (destructively when necessary) resources held by this object.voiddropReference()Drop a previously-retained reference to this referent.Function<Object,Object>getColorFormat()Map<String,Function<Object,Object>>getColorFormats()Function<Object,Object>getColumnNameTransform()JComponentgetComponent(AsyncPanel dataPanel, String viewId, Object view, String title, Object irisWidgetSupportObject, com.fishlib.io.logger.Logger log)Gets the UI component.StringgetName()Gets the name of the Live Widget.QueryProcessorConnectiongetProcessorConnection()gets the processor connection.intgetSessionId()Gets the session ID for console widgets.WeakReference<? extends LivenessReferent>getWeakReference()Get aWeakReferenceto this referent.static LiveWidget<LivePivotWidget>getWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String unitColumn, LivePivotWidget.Aggregation aggregation, PivotOptions options)voidinitializeTransientFieldsForLiveness()Package-private forSerializablesub-classes to use inreadObjectonly.voidonClose()protected voidonReferenceCountAtZero()Callback method that will be invoked when the reference count returns to zero.voidsetName(String name)Sets the name of the Live Widget.voidsetProcessorConnection(QueryProcessorConnection processorConnection)Sets the processor connection.voidsetSessionId(int sessionId)Sets the session ID for console widgets.LivePivotWidgetskipAcls()This method is called in the case that ACLs should be skipped.booleantryManage(LivenessReferent referent)Attempt to add the specified referent to this manager.booleantryRetainReference()If this referent is "live", behave asLivenessReferent.retainReference()and return true.Methods inherited from class com.illumon.iris.db.util.liveness.LivenessArtifact
manageWithCurrentScope, unmanage, unmanageMethods inherited from class com.illumon.util.referencecounting.ReferenceCounted
append, decrementReferenceCount, incrementReferenceCount, resetReferenceCount, toString, tryDecrementReferenceCount, tryIncrementReferenceCountMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.illumon.iris.db.util.liveness.LivenessReferent
getReferentDescription, retainReferenceMethods inherited from interface com.illumon.iris.db.tables.utils.LiveWidget
getComponent, updateTelemetryInfo
-
Constructor Details
-
LivePivotWidget
public LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String valueColumn, LivePivotWidget.Aggregation aggregation, @NotNull PivotOptions options)This constructor is used to create the widget.- Parameters:
tableToPivot- the table to pivotrows- the key columns for the rowscolumnTitleColumn- the column used as a title for each columnvalueColumn- the column containing the value of interestaggregation- how to aggregate the dataoptions- a struct of booleans that control how the widget presents the data
-
LivePivotWidget
public LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, @NotNull PivotOptions options, Function<Object,Object> colorFormat, Function<Object,Object> columnNameTransform)This constructor is used to create the widget.- Parameters:
tableToPivot- the table to pivotrows- the key columns for the rowscolumnTitleColumn- the column used as a title for each columnvalueColumns- the columns containing the values of interestaggregation- how to aggregate the dataoptions- a struct that control how the widget presents the datacolorFormat- an optional function for creating heatmap colorscolumnNameTransform- an optional function for transforming column names
-
LivePivotWidget
public LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, @NotNull PivotOptions options, Function<Object,Object> colorFormat, Function<Object,Object> columnNameTransform, Comparable<?>[] userRowOrder, Comparable<?>[] userColumnOrder)This constructor is used to create the widget.- Parameters:
tableToPivot- the table to pivotrows- the key columns for the rowscolumnTitleColumn- the column used as a title for each columnvalueColumns- the columns containing the values of interestaggregation- how to aggregate the dataoptions- a struct that control how the widget presents the datacolorFormat- an optional function for creating heatmap colorscolumnNameTransform- an optional function for transforming column namesuserRowOrder- A custom order for row-columns
-
LivePivotWidget
public LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, @NotNull PivotOptions options, Function<Object,Object> colorFormat, Map<String,Function<Object,Object>> colorFormats, Function<Object,Object> columnNameTransform)This constructor is used to create the widget.- Parameters:
tableToPivot- the table to pivotrows- the key columns for the rowscolumnTitleColumn- the column used as a title for each columnvalueColumns- the columns containing the values of interestaggregation- how to aggregate the dataoptions- a struct that control how the widget presents the datacolorFormat- an optional function for creating heatmap colorscolorFormats- an optional map of columns to functions for creating heatmap colorscolumnNameTransform- an optional function for transforming column names
-
LivePivotWidget
public LivePivotWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String[] valueColumns, String[] filterColumns, String[] requiredFilterColumns, LivePivotWidget.Aggregation aggregation, @NotNull PivotOptions options, Function<Object,Object> colorFormat, Map<String,Function<Object,Object>> colorFormats, Function<Object,Object> columnNameTransform, Comparable<?>[] userRowColumnOrder, Comparable<?>[] userColumnOrder)This constructor is used to create the widget.- Parameters:
tableToPivot- the table to pivotrows- the key columns for the rowscolumnTitleColumn- the column used as a title for each columnvalueColumns- the columns containing the values of interestaggregation- how to aggregate the dataoptions- a struct that control how the widget presents the datacolorFormat- an optional function for creating heatmap colorscolorFormats- an optional map of columns to functions for creating heatmap colorscolumnNameTransform- an optional function for transforming column namesuserRowColumnOrder- a user specified row column ordering
-
-
Method Details
-
onClose
public void onClose()- Specified by:
onClosein interfaceCloseableWidget
-
getColorFormat
-
getColorFormats
-
getColumnNameTransform
-
applyAcls
public LivePivotWidget applyAcls(com.fishlib.auth.UserContext userContext, RemoteQueryProcessor remoteQueryProcessor, String name)Description copied from interface:LiveWidgetAclFilterableThis method should apply ACLs to all tables in the widget. For each table in the widget, this method should call:
t = RemoteDatabase.applyAcls(t, userContext, remoteQueryProcessor, name);- Specified by:
applyAclsin interfaceLiveWidgetAclFilterable<LivePivotWidget>- Parameters:
userContext- the user contextremoteQueryProcessor- the remote queryname- the name of the widget
-
skipAcls
Description copied from interface:LiveWidgetAclFilterableThis method is called in the case that ACLs should be skipped.- Specified by:
skipAclsin interfaceLiveWidgetAclFilterable<LivePivotWidget>
-
setName
Description copied from interface:ContextAwareLiveWidgetSets the name of the Live Widget.- Specified by:
setNamein interfaceContextAwareLiveWidget<LivePivotWidget>- Parameters:
name- the name of the Live Widget
-
getName
Description copied from interface:ContextAwareLiveWidgetGets the name of the Live Widget.- Specified by:
getNamein interfaceContextAwareLiveWidget<LivePivotWidget>- Returns:
- the name of the Live Widget
-
setProcessorConnection
Description copied from interface:ContextAwareLiveWidgetSets the processor connection.- Specified by:
setProcessorConnectionin interfaceContextAwareLiveWidget<LivePivotWidget>- Parameters:
processorConnection- the processor connection
-
getProcessorConnection
Description copied from interface:ContextAwareLiveWidgetgets the processor connection.- Specified by:
getProcessorConnectionin interfaceContextAwareLiveWidget<LivePivotWidget>- Returns:
- the processor connection
-
setSessionId
public void setSessionId(int sessionId)Description copied from interface:ContextAwareLiveWidgetSets the session ID for console widgets.- Specified by:
setSessionIdin interfaceContextAwareLiveWidget<LivePivotWidget>- Parameters:
sessionId- the session ID
-
getSessionId
public int getSessionId()Description copied from interface:ContextAwareLiveWidgetGets the session ID for console widgets.- Specified by:
getSessionIdin interfaceContextAwareLiveWidget<LivePivotWidget>- Returns:
- the session ID
-
deflate
Description copied from interface:DeflatableConvert this object into an Inflatable suitable for serialization.- Specified by:
deflatein interfaceDeflatable<LivePivotWidget>- Parameters:
client- the ExportedObjectClient we are deflating for.- Returns:
- an Inflatable for serializing to the client
-
getWidget
public static LiveWidget<LivePivotWidget> getWidget(Table tableToPivot, String[] rows, String columnTitleColumn, String unitColumn, LivePivotWidget.Aggregation aggregation, PivotOptions options) -
getComponent
public JComponent getComponent(AsyncPanel dataPanel, String viewId, Object view, String title, Object irisWidgetSupportObject, com.fishlib.io.logger.Logger log)Description copied from interface:LiveWidgetGets the UI component.- Specified by:
getComponentin interfaceLiveWidget<LivePivotWidget>- Parameters:
dataPanel- data panelviewId- view idview- viewtitle- titleirisWidgetSupportObject- widget support objectlog- log- Returns:
- UI component
-
initializeTransientFieldsForLiveness
Package-private forSerializablesub-classes to use inreadObjectonly. Public to allow unit tests in another package to work around mock issues where the constructor is never invoked. -
tryRetainReference
public final boolean tryRetainReference()Description copied from interface:LivenessReferentIf this referent is "live", behave asLivenessReferent.retainReference()and return true. Otherwise, returns false rather than throwing an exception.- Specified by:
tryRetainReferencein interfaceLivenessReferent- Returns:
- True if this referent was retained, false otherwise
-
dropReference
public final void dropReference()Description copied from interface:LivenessReferentDrop a previously-retained reference to this referent.- Specified by:
dropReferencein interfaceLivenessReferent
-
getWeakReference
Description copied from interface:LivenessReferentGet aWeakReferenceto this referent. This may be cached, or newly created.- Specified by:
getWeakReferencein interfaceLivenessReferent- Returns:
- A new or cached reference to this referent
-
tryManage
Description copied from interface:LivenessManagerAttempt to add the specified referent to this manager.- Specified by:
tryManagein interfaceLivenessManager- Parameters:
referent- The referent to add- Returns:
- Whether the referent was in fact added
-
destroy
protected void destroy()Attempt to release (destructively when necessary) resources held by this object. This may render the object unusable for subsequent operations. Implementations should be sure to call super.destroy().
This is intended to only ever be used as a side effect of decreasing the reference count to 0.
-
onReferenceCountAtZero
protected final void onReferenceCountAtZero()Description copied from class:ReferenceCountedCallback method that will be invoked when the reference count returns to zero.- Specified by:
onReferenceCountAtZeroin classReferenceCounted
-