Dashboard Builder Data Displayer API 6.2.0.CR2

org.jboss.dashboard.kpi
Interface KPIManager


public interface KPIManager

Manager class that it allows for the retrieval of KPI instances as well as DataProvider's.


Field Summary
static int EVENT_ALL
           
static int EVENT_KPI_CREATED
           
static int EVENT_KPI_DELETED
           
static int EVENT_KPI_SAVED
           
 
Method Summary
 void addKPIListener(KPIListener kpiListener, int eventId)
          Register a listener interested in all process events.
 KPI createKPI()
          Factory method for the creation of a KPI brand new instance.
 Set<KPI> getAllKPIs()
          Get all KPIs defined.
 KPI getKPIByCode(String code)
          Get a persistent KPI by its universal code.
 KPI getKPIById(Long id)
          Get a persistent KPI by its identifier.
 Map<Integer,List<KPIListener>> getKPIListenerMap()
          Retrieve registered kpi listeners.
 List<KPIListener> getKPIListeners(int eventId)
          Retrieve registered kpi listeners for a specified event.
 void notifyKPIListener(int eventId, KPI kpi)
          Notify the specified event to the registered listeners.
 void removeKPIListener(KPIListener kpiListener)
          Removes a registered listener.
 void removeKPIListener(KPIListener kpiListener, int eventId)
          Removes a registered listener.
 void sortKPIsByDescription(List<KPI> propList, boolean ascending)
          Sort a list of properties by name.
 

Field Detail

EVENT_ALL

static final int EVENT_ALL
See Also:
Constant Field Values

EVENT_KPI_CREATED

static final int EVENT_KPI_CREATED
See Also:
Constant Field Values

EVENT_KPI_SAVED

static final int EVENT_KPI_SAVED
See Also:
Constant Field Values

EVENT_KPI_DELETED

static final int EVENT_KPI_DELETED
See Also:
Constant Field Values
Method Detail

createKPI

KPI createKPI()
Factory method for the creation of a KPI brand new instance.


getAllKPIs

Set<KPI> getAllKPIs()
                    throws Exception
Get all KPIs defined.

Throws:
Exception

getKPIById

KPI getKPIById(Long id)
               throws Exception
Get a persistent KPI by its identifier.

Throws:
Exception

getKPIByCode

KPI getKPIByCode(String code)
                 throws Exception
Get a persistent KPI by its universal code.

Throws:
Exception

sortKPIsByDescription

void sortKPIsByDescription(List<KPI> propList,
                           boolean ascending)
Sort a list of properties by name.


getKPIListenerMap

Map<Integer,List<KPIListener>> getKPIListenerMap()
Retrieve registered kpi listeners.

Returns:
A map of eventId / eventListeners.

getKPIListeners

List<KPIListener> getKPIListeners(int eventId)
Retrieve registered kpi listeners for a specified event.

Parameters:
eventId - The event being listened.

addKPIListener

void addKPIListener(KPIListener kpiListener,
                    int eventId)
Register a listener interested in all process events.

WARNING: In order to solve the -lapsed listener- problem the reference to the listener stored by the manager is weak. This means that if the listener reference is lost then is also automatically removed from the listeners list. To avoid this issue ensure that your listener instance is referenced in your object model and exists as long as the manager is alive.

Parameters:
kpiListener - Be sure your listener instance added is referred by another object instance in order to avoid garbage collector to finalize your listener unexpectedly.
eventId - The event interested in.

removeKPIListener

void removeKPIListener(KPIListener kpiListener,
                       int eventId)
Removes a registered listener.

Parameters:
eventId - The event listener was interested in.

removeKPIListener

void removeKPIListener(KPIListener kpiListener)
Removes a registered listener.


notifyKPIListener

void notifyKPIListener(int eventId,
                       KPI kpi)
Notify the specified event to the registered listeners.


Dashboard Builder Data Displayer API 6.2.0.CR2

Copyright © 2012-2014 JBoss by Red Hat. All Rights Reserved.