private Cmds getCommand(String message) {
        int begin = message.indexOf(' ') + 1;
        int end = message.indexOf(' ', begin);
        if(end == NOT_FOUND)
            end = message.length();
        String cmd = message.substring(begin, end);

        if(cmd.equals("start"))
            return Cmds.CMD_START_STOPWATCH;
        else if(cmd.equals("stop"))
            return Cmds.CMD_STOP_STOPWATCH;
        else if(cmd.equals("get"))
            return Cmds.CMD_GET_STOPWATCH;
        else if(cmd.equals("timer")) {
            begin = message.indexOf(' ', end);
            if(begin == NOT_FOUND)
                return Cmds.CMD_INVALID;
            return Cmds.CMD_SET_TIMER;
        }
        else if(cmd.equals("rmtimer"))
            return Cmds.CMD_REMOVE_TIMER;
        return Cmds.CMD_INVALID;
    }