public final class EventEmitter
extends java.lang.Object
Module to communicate with the elastic.io runtime.
The implementation of this class has been inspired by the Node.js
EventEmitter class.Module| Modifier and Type | Class and Description |
|---|---|
static class |
EventEmitter.Builder
Used to build
EventEmitter instances. |
static interface |
EventEmitter.Callback
This interface defines a callback to pass errors, data and snapshots to its callee.
|
| Modifier and Type | Method and Description |
|---|---|
EventEmitter |
emitData(Message message)
Emits a
Message. |
EventEmitter |
emitException(java.lang.Exception e)
Emits an
Exception. |
EventEmitter |
emitHttpReply(HttpReply reply)
Emits the httpReply event.
|
EventEmitter |
emitRebound(java.lang.Object reason)
Emits the rebound event specifying a
Object reason. |
EventEmitter |
emitSnapshot(javax.json.JsonObject snapshot)
Emits
JsonObject snapshot. |
EventEmitter |
emitUpdateKeys(javax.json.JsonObject object)
Emits the updateKeys event.
|
public EventEmitter emitException(java.lang.Exception e)
Exception. Used to emit an exception from component
written in asynchronous style, for example using
Reactive Extensions for the JVM .
Any non-asynchronous may throw an exception instead of using this method.e - exception to emitpublic EventEmitter emitData(Message message)
Message.message - message to emitpublic EventEmitter emitSnapshot(javax.json.JsonObject snapshot)
JsonObject snapshot.snapshot - snapshot to emitpublic EventEmitter emitRebound(java.lang.Object reason)
Object reason.reason - reason for reboundpublic EventEmitter emitUpdateKeys(javax.json.JsonObject object)
object - object containing the tokenspublic EventEmitter emitHttpReply(HttpReply reply)
reply - HTTP reply