Interface Server.Plugin
-
- All Implemented Interfaces:
public interface Server.PluginServer.Plugin enables Server functionality to be augmented and/or observed.
Server.Plugin function execution is non-blocking, but occurs synchronously within Server proxy operations. Therefore, implement Server.Plugin functions judiciously, considering that long suspension time will impact Server throughput.
Server.Plugin function invocation is not thread-safe. Thus, perform any necessary synchronization in the Server.Plugin implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public abstract classServer.Plugin.AsyncServer.Plugin.Async is an asynchronous Server.Plugin intended for use by Java code.
public classServer.Plugin.DSLServer.Plugin.DSL to build a Server.Plugin with the Server.Plugin.Builder.
public final classServer.Plugin.BuilderServer.Plugin.Builder builds a Server.Plugin.
-
Method Summary
Modifier and Type Method Description abstract Bolt.Messageintercept(Bolt.Session session, Bolt.Message message)Intercept, and optionally transform, the message. abstract Unitobserve(Server.Event event)Observe the event. Server.Pluginthen(Server.Plugin that)Run thisServer.Plugin then that.-
-
Method Detail
-
intercept
abstract Bolt.Message intercept(Bolt.Session session, Bolt.Message message)
Intercept, and optionally transform, the message.
If the returned Bolt.Message is a Bolt.Request then it's sent to the graph server, otherwise the Bolt.Response is sent to the proxy client.
- Parameters:
session- the Bolt.Sessionmessage- the intercepted Bolt message- Returns:
the Bolt.Message to send
-
observe
abstract Unit observe(Server.Event event)
Observe the event.
- Parameters:
event- the Server.Event that occurred
-
then
Server.Plugin then(Server.Plugin that)
Run
thisServer.Plugin then that.- Parameters:
that- the Server.Plugin to chain withthis- Returns:
a Server.Plugin that invokes
thisthen that
-
-
-
-