Class HBBaseDataCollector

java.lang.Object
org.alfresco.heartbeat.HBBaseDataCollector
Direct Known Subclasses:
AuthoritiesDataCollector, ConfigurationDataCollector, InfoDataCollector, ModelUsageDataCollector, SessionsUsageDataCollector, SystemUsageDataCollector

public abstract class HBBaseDataCollector extends Object

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.

Example Javadoc for implementations:
  • Collector ID: a.collector.id
  • Data:
    • dataP1: data type - description
    • dataP2: data type - description
    • ...
Author:
eknizat
  • Constructor Details

    • HBBaseDataCollector

      public HBBaseDataCollector(String collectorId, String collectorVersion, String cronExpression, HeartBeatJobScheduler hbJobScheduler)
      Parameters:
      collectorId - Unique collector ID e.g.: acs.repository.info
      collectorVersion - Version of the collector e.g.: 1.0
      cronExpression - 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

      public String getCollectorId()
    • getCollectorVersion

      public String getCollectorVersion()
    • getCronExpression

      public String getCronExpression()
    • setHbDataCollectorService

      public void setHbDataCollectorService(HBDataCollectorService hbDataCollectorService)
    • setHbJobScheduler

      public void setHbJobScheduler(HeartBeatJobScheduler hbJobScheduler)
      Parameters:
      hbJobScheduler - The scheduler which will be used to schedule jobs for this collector.
    • getHbJobScheduler

      public HeartBeatJobScheduler 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 provided HBDataCollectorService
    • deregister

      public void deregister()
      This method is called by Spring at initialisation and will deregister this collector with the provided HBDataCollectorService
    • collectData

      public abstract List<org.alfresco.heartbeat.datasender.HBData> collectData()
      This method returns data to be collected.
      Returns:
      List of HBData