Class Server

  • Direct Known Subclasses:
    HTTPServer, HTTPSServer

    abstract class Server
    extends java.lang.Object
    Super class for HTTP and HTTPS server.
    Since:
    2.0
    • Field Detail

      • DEFAULT_ALLOWED_IPS

        protected static final java.util.Set<java.lang.String> DEFAULT_ALLOWED_IPS
      • port

        protected int port
      • host

        protected java.lang.String host
      • server

        protected com.sun.net.httpserver.HttpServer server
      • isRunning

        private boolean isRunning
    • Constructor Detail

      • Server

        Server()
    • Method Detail

      • getProtocol

        protected abstract java.lang.String getProtocol()
      • run

        public void run()
        Start the server.
      • stop

        public void stop()
        Stop the server. Once stopped, a server cannot be used again.
      • isRunning

        public boolean isRunning()
        Returns:
        whether the server is running
        Since:
        2.0
      • usageRequested

        protected static boolean usageRequested​(java.lang.String[] args)
      • printCommonConfigFileOptions

        protected static void printCommonConfigFileOptions()
      • printCommonOptions

        protected static void printCommonOptions()
      • checkForNonRootUser

        protected static void checkForNonRootUser()
      • getExecutorService

        protected java.util.concurrent.ThreadPoolExecutor getExecutorService​(java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> workQueue,
                                                                             HTTPServerConfig config)