Package io.github.cfraser.graphguard
Class Server.Plugin.Async
-
- All Implemented Interfaces:
-
io.github.cfraser.graphguard.Server.Plugin
public abstract class Server.Plugin.Async implements Server.Plugin
Server.Plugin.Async is an asynchronous Server.Plugin intended for use by Java code.
-
-
Constructor Summary
Constructors Constructor Description Server.Plugin.Async()
-
Method Summary
Modifier and Type Method Description abstract CompletableFuture<Bolt.Message>interceptAsync(String session, Bolt.Message message)Asynchronously intercept the message. abstract CompletableFuture<Void>observeAsync(Server.Event event)Asynchronously observe the event. final Bolt.Messageintercept(Bolt.Session session, Bolt.Message message)interceptAsync then await for the CompletableFuture to complete. final Unitobserve(Server.Event event)observeAsync then await for the CompletableFuture to complete. -
-
Method Detail
-
interceptAsync
abstract CompletableFuture<Bolt.Message> interceptAsync(String session, Bolt.Message message)
- Parameters:
session- the Bolt.Sessionmessage- the intercepted Bolt message- Returns:
a CompletableFuture with the Bolt.Message to send
-
observeAsync
abstract CompletableFuture<Void> observeAsync(Server.Event event)
- Parameters:
event- the Server.Event that occurred- Returns:
a CompletableFuture of Void
-
intercept
final Bolt.Message intercept(Bolt.Session session, Bolt.Message message)
interceptAsync then await for the CompletableFuture to complete.
- Parameters:
session- the Bolt.Sessionmessage- the intercepted Bolt message
-
observe
final Unit observe(Server.Event event)
observeAsync then await for the CompletableFuture to complete.
- Parameters:
event- the Server.Event that occurred
-
-
-
-