Class AdminSocketServer

    • Constructor Detail

      • AdminSocketServer

        public AdminSocketServer()
        Initializes socket with default thread pool size and port
      • AdminSocketServer

        public AdminSocketServer​(int port,
                                 int threads,
                                 ProductClient client)
        Initializes socket with custom port, threads, and client
        Parameters:
        port - Admind port
        threads - Thread pool size
        client - Product Client
    • Method Detail

      • processLine

        protected void processLine​(java.lang.String line,
                                   java.io.OutputStream out)
                            throws java.lang.Exception
        Process a line of input.
        Parameters:
        line - input
        out - write generated output to stream
        Throws:
        java.lang.Exception - if misconfigured or the client quits.
      • getPort

        public int getPort()
        Returns:
        port
      • setPort

        public void setPort​(int port)
        Parameters:
        port - port number
      • getThreads

        public int getThreads()
        Returns:
        threads
      • setThreads

        public void setThreads​(int threads)
        Parameters:
        threads - set number of threads
      • getClient

        public ProductClient getClient()
        Returns:
        product client
      • setClient

        public void setClient​(ProductClient client)
        Parameters:
        client - set product client