Class GatewayEventHandler
java.lang.Object
com.inductiveautomation.eventstream.gateway.handlers.GatewayEventHandler
- All Implemented Interfaces:
EventStreamHandler
This handler sends events to a
GatewayEventSource, through the EventStreamEventBus.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.inductiveautomation.eventstream.gateway.api.EventStreamHandler
EventStreamHandler.Descriptor, EventStreamHandler.Factory -
Constructor Summary
ConstructorsConstructorDescriptionGatewayEventHandler(EventStreamEventBus eventBus, GatewayEventHandlerConfig config) -
Method Summary
Modifier and TypeMethodDescriptionstatic EventStreamHandler.FactorycreateFactory(EventStreamEventBus eventBus) voidhandle(List<EventPayload> events, boolean testMode) Called when a batch of events is ready to be processed.voidonStartup(EventStreamExpressionFactory expressionFactory) Called when Event Stream first starts and before theEventStreamHandlerstarts receiving events throughEventStreamHandler.handle(java.util.List<com.inductiveautomation.eventstream.EventPayload>, boolean).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.inductiveautomation.eventstream.gateway.api.EventStreamHandler
onShutdown
-
Constructor Details
-
GatewayEventHandler
-
-
Method Details
-
createFactory
-
onStartup
Description copied from interface:EventStreamHandlerCalled when Event Stream first starts and before theEventStreamHandlerstarts receiving events throughEventStreamHandler.handle(java.util.List<com.inductiveautomation.eventstream.EventPayload>, boolean).- Specified by:
onStartupin interfaceEventStreamHandler- Parameters:
expressionFactory- Factory for creatingEventStreamExpressionfrom expression fields.- Throws:
Exception- An exception here will prevent the Event Stream for subscribing to source. This is useful if something fails in onStartup() thatEventStreamHandler.handle(java.util.List<com.inductiveautomation.eventstream.EventPayload>, boolean)requires to successfully process events.
-
handle
Description copied from interface:EventStreamHandlerCalled when a batch of events is ready to be processed. It's important that an exception is throw on errors encountered during handling of events. If an exception is encountered, it should be expected that the method may be called again in the future with the same events. This is determined by the failure strategy specified by the Event Stream configuration.- Specified by:
handlein interfaceEventStreamHandler- Parameters:
events- List of events to process.testMode- True, if Event Stream is running in test mode. If running in testMode, expressions should be evaluated with no other side effects.- Throws:
Exception- Exception thrown during processing.
-