Class Server
-
- All Implemented Interfaces:
-
java.lang.Runnable
public final class Server implements Runnable
Server proxies Bolt data to a Neo4j (5+ compatible) database and performs dynamic message transformation through the plugin.
Initialize a Server that performs realtime Schema validation of intercepted queries via the Schema.Validator.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceServer.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.
public interfaceServer.EventA Server event.
public classServer.StartedThe Server has started.
public final classServer.ConnectedThe Server established a connection.
public final classServer.DisconnectedThe Server closed the connection.
public interfaceServer.ConnectionA proxy connection.
public final classServer.ProxiedThe Server proxied the intercepted Bolt.Message from the source to the destination.
public classServer.StoppedThe Server has stopped.
-
Field Summary
Fields Modifier and Type Field Description private final URIgraphprivate final InetSocketAddressaddress
-
Constructor Summary
Constructors Constructor Description Server(URI graph, Server.Plugin plugin, InetSocketAddress address, Integer parallelism)
-
Method Summary
Modifier and Type Method Description final URIgetGraph()the URI of the graph database to proxy data to/from final InetSocketAddressgetAddress()the InetSocketAddress to bind the Server to Unitrun()Start the proxy server on the address, connecting to the graph. -
-
Constructor Detail
-
Server
Server(URI graph, Server.Plugin plugin, InetSocketAddress address, Integer parallelism)
- Parameters:
plugin- the Server.Plugin to use to intercept proxied messages and observe server events
-
-
Method Detail
-
getAddress
final InetSocketAddress getAddress()
the InetSocketAddress to bind the Server to
-
run
Unit run()
Start the proxy server on the address, connecting to the graph.
Server.run blocks indefinitely. To stop the server, java.lang.Thread.interrupt the blocked thread.
-
-
-
-