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 voidconfigure(SolrResourceLoader loader, SolrCloudManager cloudManager, AutoScalingConfig.TriggerListenerConfig config)Called when listener is created but before it's initialized and used.AutoScalingConfig.TriggerListenerConfiggetConfig()voidinit()booleanisEnabled()If this method returns false then the listener'sonEvent(TriggerEvent, TriggerEventProcessorStage, String, ActionContext, Throwable, String)method should not be called.voidonEvent(TriggerEvent event, TriggerEventProcessorStage stage, String actionName, ActionContext context, Throwable error, String message)This method is called when either a particularstageoractionNameis 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 particularstageoractionNameis reached during event processing.- Parameters:
event- current event being processedstage-TriggerEventProcessorStagethat this listener was registered for, or nullactionName-TriggerActionname that this listener was registered for, or nullcontext- optionalActionContextwhen the processing stage is related to an action, or nullerror- optionalThrowableerror, or nullmessage- optional message- Throws:
Exception
-
-