Class NetworkCoreFactory.Builder

  • Enclosing class:
    NetworkCoreFactory

    public static final class NetworkCoreFactory.Builder
    extends Object
    A builder for NetworkCoreFactory.
    • Method Detail

      • enableServer

        public NetworkCoreFactory.Builder enableServer()
        Enable a server so that other hubs can connect to and control this one. By default the port number will be automatic and the socket bound to the loopback address to only allow local connections.
        Returns:
        this for chaining
      • serverPort

        public NetworkCoreFactory.Builder serverPort​(int port)
        Specify a port for the server. Only has effect when server is enabled.
        Parameters:
        port - between 1 and 65535, or 0 for automatic
        Returns:
        this for chaining
      • allowRemoteServerConnection

        public NetworkCoreFactory.Builder allowRemoteServerConnection()
        Allow remote connections. Only has effect when server is enabled. Allowing connections from other than localhost may require consideration of security concerns.
        Returns:
        this for chaining
      • allowRemoteServerConnection

        public NetworkCoreFactory.Builder allowRemoteServerConnection​(String cidr)
        Allow remote connections. Inbound connections will be matched against the provide CIDR mask if specified. See https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing.

        Only has effect when server is enabled. Allowing connections from other than localhost may require consideration of security concerns.

        Parameters:
        cidr - mask
        Returns:
        this for chaining
      • exposeServices

        public NetworkCoreFactory.Builder exposeServices​(List<Class<? extends Service>> services)
        List of services that will be exposed to connected hubs. Currently only used by child proxies, and will override their default implementation.
        Parameters:
        services - list of services to expose
        Returns:
        this for chaining
      • childLauncher

        public NetworkCoreFactory.Builder childLauncher​(ChildLauncher launcher)
        Provide an implementation of ChildLauncher for proxies that require to auto-launch a local child process of the current one.
        Parameters:
        launcher - child launcher implementation
        Returns:
        this for chaining
      • hubConfiguration

        public NetworkCoreFactory.Builder hubConfiguration​(HubConfiguration configuration)
        Provide a HubConfiguration programmatically. This will lock the configuration and stop it being configurable via the hub-configure command.
        Parameters:
        configuration - hub configuration
        Returns:
        this for chaining
      • build

        public NetworkCoreFactory build()
        Build a NetworkCoreFactory based on the builder configuration.
        Returns:
        NetworkCoreFactory