Interface TriggerListener
-
- All Superinterfaces:
AutoCloseable
,Closeable
- All Known Implementing Classes:
HttpTriggerListener
,LoggingListener
,SystemLogListener
,TriggerListenerBase
public interface TriggerListener extends Closeable
Implementations of this interface are notified of stages in event processing that they were registered for. Note: instances may be closed and re-created on each auto-scaling config update.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
configure(SolrResourceLoader loader, SolrCloudManager cloudManager, AutoScalingConfig.TriggerListenerConfig config)
Called when listener is created but before it's initialized and used.AutoScalingConfig.TriggerListenerConfig
getConfig()
void
init()
boolean
isEnabled()
If this method returns false then the listener'sonEvent(TriggerEvent, TriggerEventProcessorStage, String, ActionContext, Throwable, String)
method should not be called.void
onEvent(TriggerEvent event, TriggerEventProcessorStage stage, String actionName, ActionContext context, Throwable error, String message)
This method is called when either a particularstage
oractionName
is reached during event processing.
-
-
-
Method Detail
-
configure
void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, AutoScalingConfig.TriggerListenerConfig config) throws TriggerValidationException
Called when listener is created but before it's initialized and used. This method should also verify that the configuration parameters are correct. It may be called multiple times.- Parameters:
loader
- loader to use for instantiating sub-componentscloudManager
- current instance of SolrCloudManagerconfig
- coniguration- Throws:
TriggerValidationException
- contains details of invalid configuration parameters.
-
isEnabled
boolean isEnabled()
If this method returns false then the listener'sonEvent(TriggerEvent, TriggerEventProcessorStage, String, ActionContext, Throwable, String)
method should not be called.
-
getConfig
AutoScalingConfig.TriggerListenerConfig getConfig()
-
onEvent
void onEvent(TriggerEvent event, TriggerEventProcessorStage stage, String actionName, ActionContext context, Throwable error, String message) throws Exception
This method is called when either a particularstage
oractionName
is reached during event processing.- Parameters:
event
- current event being processedstage
-TriggerEventProcessorStage
that this listener was registered for, or nullactionName
-TriggerAction
name that this listener was registered for, or nullcontext
- optionalActionContext
when the processing stage is related to an action, or nullerror
- optionalThrowable
error, or nullmessage
- optional message- Throws:
Exception
-
-