Package org.alfresco.heartbeat
Class HBBaseDataCollector
java.lang.Object
org.alfresco.heartbeat.HBBaseDataCollector
- Direct Known Subclasses:
AuthoritiesDataCollector,ConfigurationDataCollector,InfoDataCollector,ModelUsageDataCollector,SessionsUsageDataCollector,SystemUsageDataCollector
This class is to be extended by HeartBeat data collectors.
Every new collector needs to provide details of the data it collects. As an example use one
of the existing collectors AuthoritiesDataCollector, ConfigurationDataCollector,
InfoDataCollector, ModelUsageDataCollector, SystemUsageDataCollector.
Each collector provides a reference to a HeartBeatJobScheduler which
is then used by the HBDataCollectorService to schedule and unschedule jobs for this collector.
- Collector ID: a.collector.id
- Data:
- dataP1: data type - description
- dataP2: data type - description ...
- Author:
- eknizat
-
Constructor Summary
ConstructorsConstructorDescriptionHBBaseDataCollector(String collectorId, String collectorVersion, String cronExpression, HeartBeatJobScheduler hbJobScheduler) -
Method Summary
Modifier and TypeMethodDescriptionabstract List<org.alfresco.heartbeat.datasender.HBData>This method returns data to be collected.voidThis method is called by Spring at initialisation and will deregister this collector with the providedHBDataCollectorServicevoidregister()This method is called by Spring at initialisation and will register this collector with the providedHBDataCollectorServicevoidsetHbDataCollectorService(HBDataCollectorService hbDataCollectorService) voidsetHbJobScheduler(HeartBeatJobScheduler hbJobScheduler)
-
Constructor Details
-
HBBaseDataCollector
public HBBaseDataCollector(String collectorId, String collectorVersion, String cronExpression, HeartBeatJobScheduler hbJobScheduler) - Parameters:
collectorId- Unique collector ID e.g.: acs.repository.infocollectorVersion- Version of the collector e.g.: 1.0cronExpression- Cron expression that will be used to schedule jobs for this collector. e.g.: "0 0 0 ? * SUN" (Weekly)hbJobScheduler- Scheduler that will be used to schedule jobs for this collector.
-
-
Method Details
-
getCollectorId
-
getCollectorVersion
-
getCronExpression
-
setHbDataCollectorService
-
setHbJobScheduler
- Parameters:
hbJobScheduler- The scheduler which will be used to schedule jobs for this collector.
-
getHbJobScheduler
- Returns:
- JobScheduler used to schedule jobs for this collector.
-
register
public void register()This method is called by Spring at initialisation and will register this collector with the providedHBDataCollectorService -
deregister
public void deregister()This method is called by Spring at initialisation and will deregister this collector with the providedHBDataCollectorService -
collectData
This method returns data to be collected.- Returns:
- List of
HBData
-