Package org.apache.nifi.reporting
Class AbstractReportingTask
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.reporting.AbstractReportingTask
- All Implemented Interfaces:
ConfigurableComponent
,ReportingTask
public abstract class AbstractReportingTask
extends AbstractConfigurableComponent
implements ReportingTask
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private ComponentLog
private String
private NodeTypeProvider
private long
private ControllerServiceLookup
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final ControllerServiceLookup
protected ComponentLog
protected String
getName()
protected final NodeTypeProvider
protected long
getSchedulingPeriod
(TimeUnit timeUnit) protected void
init
(ReportingInitializationContext config) Provides a mechanism by which subclasses can perform initialization of the Reporting Task before it is scheduled to be runfinal void
Provides the Reporting Task with access to objects that may be of use throughout the life of the servicevoid
setComponentInfo
(ConfigurationContext context) Sets various component information using the given contextMethods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, getSupportedPropertyDescriptors, hashCode, onPropertyModified, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
Methods inherited from interface org.apache.nifi.reporting.ReportingTask
isStateful, migrateProperties, onTrigger
-
Field Details
-
identifier
-
name
-
schedulingNanos
private long schedulingNanos -
serviceLookup
-
logger
-
nodeTypeProvider
-
-
Constructor Details
-
AbstractReportingTask
public AbstractReportingTask()
-
-
Method Details
-
initialize
Description copied from interface:ReportingTask
Provides the Reporting Task with access to objects that may be of use throughout the life of the service- Specified by:
initialize
in interfaceReportingTask
- Parameters:
config
- of initialization context- Throws:
InitializationException
- if unable to init
-
getControllerServiceLookup
- Returns:
- the
ControllerServiceLookup
that was passed to theinitialize(ReportingInitializationContext)
method
-
getNodeTypeProvider
- Returns:
- the
NodeTypeProvider
that was passed to theinitialize(ReportingInitializationContext)
method
-
getIdentifier
- Specified by:
getIdentifier
in interfaceConfigurableComponent
- Returns:
- the identifier of this Reporting Task
-
getName
- Returns:
- the name of this Reporting Task
-
setComponentInfo
Sets various component information using the given context- Parameters:
context
- the context to use for this reporting task
-
getSchedulingPeriod
- Parameters:
timeUnit
- of scheduling period- Returns:
- the amount of times that elapses between the moment that this
ReportingTask finishes its invocation of
ReportingTask.onTrigger(ReportingContext)
and the next time thatReportingTask.onTrigger(ReportingContext)
is called.
-
init
Provides a mechanism by which subclasses can perform initialization of the Reporting Task before it is scheduled to be run- Parameters:
config
- context- Throws:
InitializationException
- if failure to init
-
getLogger
- Returns:
- the logger that has been provided to the component by the framework in its initialize method
-