private boolean evaluateCommand()

in gepard-core/src/main/java/com/epam/gepard/common/threads/RemoteControlHandlerThread.java [134:163]


    private boolean evaluateCommand(final String command) throws IOException {
        boolean keepAlive = true;
        if ("shutdown".equals(command)) {
            //graceful shutdown is requested
            String s = handler.remoteShutdown();
            os.println(s);
        }
        if ("status".equals(command)) {
            //get full status
            String s = handler.remoteGetStatus();
            os.println(s);
        }
        if ("exit".equals(command)) {
            //close connection is requested
            clientSocket.close();
            clientSocket = null; //clean it up
            keepAlive = false;
        }
        if ("kill".equals(command)) {
            //immediate exit is requested
            running = false;
            keepAlive = false;
            os.println("Gepard is exiting (brute force)...");
            clientSocket.close();
            gepardServerSocket.close();
            killCommandHandler.handleCommand();
        }
        os.println(command + " ?");
        return keepAlive;
    }