Class HttpTriggerListener
- java.lang.Object
-
- org.apache.solr.cloud.autoscaling.TriggerListenerBase
-
- org.apache.solr.cloud.autoscaling.HttpTriggerListener
-
- All Implemented Interfaces:
Closeable,AutoCloseable,TriggerListener
public class HttpTriggerListener extends TriggerListenerBase
Simple HTTP callback that POSTs event data to a URL. URL, payload and headers may contain property substitution patterns, with the following properties available:- config.* - listener configuration
- event.* - event properties
- stage - current stage of event processing
- actionName - optional current action name
- context.* - optional
ActionContextproperties - error - optional error string (from
Throwable.toString()) - message - optional message
- url - a URL template
- payload - string, optional payload template. If absent a JSON map of all properties listed above will be used.
- contentType - string, optional payload content type. If absent then
application/jsonwill be used. - header.* - string, optional header template(s). The name of the property without "header." prefix defines the literal header name.
- timeout - int, optional connection and socket timeout in milliseconds. Default is 60 seconds.
- followRedirects - boolean, optional setting to follow redirects. Default is false.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.cloud.autoscaling.TriggerListenerBase
cloudManager, config, enabled, loader, requiredProperties, validProperties, validPropertyPrefixes
-
-
Constructor Summary
Constructors Constructor Description HttpTriggerListener()
-
Method Summary
All Methods Instance Methods Concrete 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.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.-
Methods inherited from class org.apache.solr.cloud.autoscaling.TriggerListenerBase
close, getConfig, init, isEnabled
-
-
-
-
Method Detail
-
configure
public void configure(SolrResourceLoader loader, SolrCloudManager cloudManager, AutoScalingConfig.TriggerListenerConfig config) throws TriggerValidationException
Description copied from interface:TriggerListenerCalled 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.- Specified by:
configurein interfaceTriggerListener- Overrides:
configurein classTriggerListenerBase- Parameters:
loader- loader to use for instantiating sub-componentscloudManager- current instance of SolrCloudManagerconfig- coniguration- Throws:
TriggerValidationException- contains details of invalid configuration parameters.
-
onEvent
public void onEvent(TriggerEvent event, TriggerEventProcessorStage stage, String actionName, ActionContext context, Throwable error, String message)
Description copied from interface:TriggerListenerThis 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
-
-