Class PerNodeStatisticsCollectionScheduler
java.lang.Object
com.atlassian.crowd.analytics.statistics.scheduler.PerNodeStatisticsCollectionScheduler
- All Implemented Interfaces:
StatisticsCollectorRunner,com.atlassian.scheduler.JobRunner
Schedules and runs per node statistics collection.
-
Constructor Summary
ConstructorsConstructorDescriptionPerNodeStatisticsCollectionScheduler(com.atlassian.scheduler.SchedulerService schedulerService, com.atlassian.analytics.api.services.AnalyticsConfigService analyticsConfigService, com.atlassian.event.api.EventPublisher eventPublisher, List<StatisticsCollector<?>> collectors) -
Method Summary
Modifier and TypeMethodDescriptionvoidcollect()protected com.atlassian.scheduler.config.JobIdgetJobId()Returns job ID.protected com.atlassian.scheduler.config.JobRunnerKeyReturns job runner key.protected com.atlassian.scheduler.config.RunModevoidonApplicationReady(ApplicationReadyEvent applicationStartedEvent) voidonCreate()voidvoidonXMLRestore(XMLRestoreFinishedEvent restoreFinishedEvent) com.atlassian.scheduler.JobRunnerResponserunJob(com.atlassian.scheduler.JobRunnerRequest request) protected Predicate<StatisticsCollector<?>>Returns a predicate used to filter statistics collectors.
-
Constructor Details
-
PerNodeStatisticsCollectionScheduler
@Inject public PerNodeStatisticsCollectionScheduler(com.atlassian.scheduler.SchedulerService schedulerService, com.atlassian.analytics.api.services.AnalyticsConfigService analyticsConfigService, com.atlassian.event.api.EventPublisher eventPublisher, List<StatisticsCollector<?>> collectors)
-
-
Method Details
-
shouldBeProcessed
Returns a predicate used to filter statistics collectors. Implementation should return their own predicate which will filter only statistics collectors they are interested in running.- Returns:
- predicate describing whether given statistics collector will be run by scheduler (predicate returns true) or not (predicate return false)
-
getJobId
protected com.atlassian.scheduler.config.JobId getJobId()Returns job ID. Implementations MUST provide unique job ID.- Returns:
- job ID
-
getJobRunnerKey
protected com.atlassian.scheduler.config.JobRunnerKey getJobRunnerKey()Returns job runner key. Implementations MUST provide unique job runner key.- Returns:
- job runner key
-
getRunMode
protected com.atlassian.scheduler.config.RunMode getRunMode()- Returns:
- run mode
-
onCreate
@PostConstruct public void onCreate() throws com.atlassian.scheduler.SchedulerServiceException- Throws:
com.atlassian.scheduler.SchedulerServiceException
-
onDestroy
@PreDestroy public void onDestroy() -
onApplicationReady
@EventListener public void onApplicationReady(ApplicationReadyEvent applicationStartedEvent) throws com.atlassian.scheduler.SchedulerServiceException - Throws:
com.atlassian.scheduler.SchedulerServiceException
-
onXMLRestore
@EventListener public void onXMLRestore(XMLRestoreFinishedEvent restoreFinishedEvent) throws com.atlassian.scheduler.SchedulerServiceException - Throws:
com.atlassian.scheduler.SchedulerServiceException
-
runJob
public com.atlassian.scheduler.JobRunnerResponse runJob(com.atlassian.scheduler.JobRunnerRequest request) - Specified by:
runJobin interfacecom.atlassian.scheduler.JobRunner
-
collect
public void collect()- Specified by:
collectin interfaceStatisticsCollectorRunner
-