Skip to main content
Hitachi Vantara Lumada and Pentaho Documentation

RefreshEngine

cdf.dashboard. RefreshEngine

Class that manages the periodic refresh of components.

AMD Module

require(["cdf/dashboard/RefreshEngine"], function(RefreshEngine) { /* code goes here */ });

Constructor

Name Description
new RefreshEngine(dashboard)

Class that manages the periodic refresh of components.

Methods

Name Description
fireGlobalRefresh()

Updates all components that do not have a valid refresh period.

fireRefresh()

Pops up due items from the queue, refreshes components and sets the next timeout.

getRefreshPeriod(component) : number

Gets the refresh period for a component.

processComponent(component) : boolean

Removes and adds the given component into the refresh queue restarting the timer if it is the first in the queue.

processComponents() : boolean

Clears the queue, adds all the dashboard components into the queue, and restarts the timer.

registerComponent(component, refreshPeriod) : boolean

Sets a components refresh period and clears it from the queue.

setGlobalRefresh(refreshPeriod)

Sets the global refresh period.

Constructor Details

new RefreshEngine(dashboard)

Builds a new refresh engine for the provided dashboard.

Source: dashboard/RefreshEngine.js, line 18

Parameters:
Name Default Value Summary
dashboard : cdf.dashboard.Dashboard

The dashboard instance to be managed by the refresh engine.

Methods Details

fireGlobalRefresh()

Called when a valid globalRefreshPeriod exists. It updates all components that do not have a valid refresh period.

Source: dashboard/RefreshEngine.js, line 423

fireRefresh()

Pops up due items from the queue, refreshes components and sets the next timeout.

Source: dashboard/RefreshEngine.js, line 395

getRefreshPeriod(component) : number

Gets the refresh period for a component.

Source: dashboard/RefreshEngine.js, line 352

Parameters:
Name Default Value Summary
component : cdf.components.BaseComponent

The target component.

Returns:
Name Description
number

The components refresh period value or the value of NO_REFRESH.

processComponent(component) : boolean

Removes and adds the given component into the refresh queue. If the component is the first in the sorted queue, {cdf.dashboard.RefreshEngine.restartTimer|restartTimer} is executed.

Source: dashboard/RefreshEngine.js, line 368

Parameters:
Name Default Value Summary
component : cdf.components.BaseComponent

The component to process.

Returns:
Name Description
boolean

true after the component was correctly processed.

processComponents() : boolean

Clears the queue, adds all the dashboard components into the queue, and restarts the timer.

Source: dashboard/RefreshEngine.js, line 382

Returns:
Name Description
boolean

true after the components are processed.

registerComponent(component, refreshPeriod) : boolean

Sets a components refresh period and clears it from the queue. processComponent must be called to activate the refresh timer for the component.

Source: dashboard/RefreshEngine.js, line 334

Parameters:
Name Default Value Summary
component : cdf.components.BaseComponent

The component to register.

refreshPeriod : number

The associated refresh period.

Returns:
Name Description
boolean

true if registration succeeds, false otherwise.

setGlobalRefresh(refreshPeriod)

Sets the global refresh period.

Source: dashboard/RefreshEngine.js, line 440

Parameters:
Name Default Value Summary
refreshPeriod : number

Refresh period to set.