public String interpretCommand(ClientCommand clientQuery) throws ServiceException
    {
        if(clientQuery == null)
            throw new ServiceException("Client Query object not initialized");
        if(clientQuery.getCmd().isEmpty())
            throw new ServiceException("Client Query object not properly initialized"
                    + ": blank command. Unable to serve the request.");
        // command interpretation: it checks what it can do (help, history, status)
        if(clientQuery.getCmd().equalsIgnoreCase("help")) {
            return handleHelpRequest();
        }else if(clientQuery.getCmd().equalsIgnoreCase("history")) {
            return handlerHistoryRequest();
        }else if(clientQuery.getCmd().equalsIgnoreCase("status")) {
            return handleStatusRequest();
        }else if(clientQuery.getCmd().equalsIgnoreCase("quit")) {
            return handleQuitRequest();
        }else { // the command must be piped
            // retrieve the server session from the context
            if(actualSession == null)
                actualSession = ServerContext.getInstance().getServerSession(sessionId);
            // start the command execution
            ExecutionReport cmdRep = chainOfHandlers.handleCommand(clientQuery, actualSession);
            // interpret the result
            if(!cmdRep.isSuccess())
                actualSession.increaseServiceFailures();
            actualSession.addCommandToHistory(clientQuery.getOriginalQuery());
            // return the actual command output
            return cmdRep.getExecutionOutput();
        }
    }