class RedisXmlELParser extends ClassXmlFlowELParser {

    private final RedisParserHelper redisParserHelper;

    private static final String ERROR_COMMON_MSG = "ruleSourceExtData or map is empty";

    private static final String ERROR_MSG_PATTERN = "ruleSourceExtData {} is blank";

    public RedisXmlELParser() {
        LiteflowConfig liteflowConfig = LiteflowConfigGetter.get();

        try {
            RedisParserVO redisParserVO = null;
            String configJson;
            if (MapUtil.isNotEmpty((liteflowConfig.getRuleSourceExtDataMap()))) {
                configJson = JsonUtil.toJsonString(liteflowConfig.getRuleSourceExtDataMap());
            }else if (StrUtil.isNotBlank(liteflowConfig.getRuleSourceExtData())) {
                configJson = liteflowConfig.getRuleSourceExtData();
            }else{
                throw new RedisException(ERROR_COMMON_MSG);
            }

            redisParserVO = JsonUtil.parseObject(configJson, RedisParserVO.class);

            if (Objects.isNull(redisParserVO)) {
                throw new RedisException(ERROR_COMMON_MSG);
            }

            //检查配置文件
            checkParserVO(redisParserVO);

            //选择订阅机制 or 轮询机制
            RedisParserMode mode = redisParserVO.getMode();
            switch (mode) {
                case SUB:
                case SUBSCRIBE:
                    redisParserHelper = new RedisParserSubscribeMode(redisParserVO);
                    break;
                case POLL:
                default:
                    redisParserHelper = new RedisParserPollingMode(redisParserVO);
                    break;
            }

        }
        catch (RedisException redisException) {
            throw redisException;
        }
        catch (Exception e) {
            throw new RedisException(e.getMessage());
        }
    }

    @Override
    public String parseCustom() {
        try {
            String content = redisParserHelper.getContent();
            FlowInitHook.addHook(() -> {
                redisParserHelper.listenRedis();
                return true;
            });
            return content;

        }
        catch (Exception e) {
            throw new RedisException(e.getMessage());
        }
    }

    private void checkParserVO(RedisParserVO redisParserVO) {<FILL_FUNCTION_BODY>}
}

        if (redisParserVO.getRedisMode().equals(RedisMode.SINGLE) && StrUtil.isBlank(redisParserVO.getHost())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "host"));
        }
        if (redisParserVO.getRedisMode().equals(RedisMode.SINGLE) && ObjectUtil.isNull(redisParserVO.getPort())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "port"));
        }
        if (redisParserVO.getRedisMode().equals(RedisMode.SENTINEL) && StrUtil.isBlank(redisParserVO.getMasterName())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "master name"));
        }
        if (redisParserVO.getRedisMode().equals(RedisMode.SENTINEL) && CollectionUtil.isEmpty(redisParserVO.getSentinelAddress())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "sentinel address list"));
        }
        if (ObjectUtil.isNull(redisParserVO.getChainDataBase())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "chainDataBase"));
        }
        if (StrUtil.isBlank(redisParserVO.getChainKey())) {
            throw new RedisException(StrFormatter.format(ERROR_MSG_PATTERN, "chainKey"));
        }
    
<methods>public non-sealed void <init>() ,public abstract java.lang.String parseCustom() ,public void parseMain(List<java.lang.String>) throws java.lang.Exception<variables>