Interface ServerEventListener

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ServerEventListener
Callback invoked when a server connects to or disconnects from the CommandBridge network.

This is a @FunctionalInterface and may be used as a lambda expression. Register listeners via CommandBridgeAPI.onServerConnected(ServerEventListener) and CommandBridgeAPI.onServerDisconnected(ServerEventListener). Both methods return an Optional wrapping a Subscription on the Velocity proxy, and Optional.empty() on backend servers.

The listener receives the server that triggered the event:


 server -> Log.info("Server {}: {}", server.id(), server.type())
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Invoked when a server connects or disconnects from the bridge network.