Interface CrankerRouter


  • public interface CrankerRouter
    This class creates MuHandler instances for receiving HTTP requests from clients, and a handler for receiving websocket registrations from cranker connectors.

    You are responsible for creating Mu Server instance(s) that the handlers are added to. When shutting down, the stop() method should be called after stopping your Mu Server(s).

    This class is created by using the CrankerRouterBuilder.crankerRouter() builder.

    • Method Detail

      • createRegistrationHandler

        io.muserver.MuHandler createRegistrationHandler()
        Creates the endpoint that cranker connectors connect to.
        Returns:
        Returns a MuHandler that you can add to a MuServer.
      • idleConnectionCount

        int idleConnectionCount()
        Returns:
        The total number of websocket connections for all routes that are currently connected and ready to receive requests
      • createHttpHandler

        io.muserver.MuHandler createHttpHandler()
        Creates the handler that receives HTTP requests from clients and then forwards them on to connectors.
        Returns:
        A MuHandler that can be added to a MuServer
      • collectInfo

        RouterInfo collectInfo()
        Gets meta data about the connected services.
        Returns:
        A new object containing service information.
      • stop

        void stop()
        Disconnects all sockets and cleans up. This should be called after shutting down the registration server.
      • darkModeManager

        DarkModeManager darkModeManager()
        Returns:
        A manager that allows you to stop or start requests going to specific hosts.
      • muCrankerVersion

        static String muCrankerVersion()
        Returns:
        The version of mu-cranker-router being used, e.g. 1.0.0