Search in sources :

Example 1 with DisConfigTypeEnum

use of com.baidu.disconf.core.common.constants.DisConfigTypeEnum in project disconf by knightliao.

the class ConfigMgrImpl method getConfVoWithZk.

/**
     * 根据 配置ID获取ZK对比数据
     */
@Override
public MachineListVo getConfVoWithZk(Long configId) {
    Config config = configDao.get(configId);
    App app = appMgr.getById(config.getAppId());
    Env env = envMgr.getById(config.getEnvId());
    //
    //
    //
    DisConfigTypeEnum disConfigTypeEnum = DisConfigTypeEnum.FILE;
    if (config.getType().equals(DisConfigTypeEnum.ITEM.getType())) {
        disConfigTypeEnum = DisConfigTypeEnum.ITEM;
    }
    ZkDisconfData zkDisconfData = zkDeployMgr.getZkDisconfData(app.getName(), env.getName(), config.getVersion(), disConfigTypeEnum, config.getName());
    if (zkDisconfData == null) {
        return new MachineListVo();
    }
    MachineListVo machineListVo = getZkData(zkDisconfData.getData(), config);
    return machineListVo;
}
Also used : App(com.baidu.disconf.web.service.app.bo.App) ZkDisconfData(com.baidu.disconf.web.service.zookeeper.dto.ZkDisconfData) DisConfigTypeEnum(com.baidu.disconf.core.common.constants.DisConfigTypeEnum) Config(com.baidu.disconf.web.service.config.bo.Config) ApplicationPropertyConfig(com.baidu.disconf.web.config.ApplicationPropertyConfig) MachineListVo(com.baidu.disconf.web.service.config.vo.MachineListVo) Env(com.baidu.disconf.web.service.env.bo.Env)

Aggregations

DisConfigTypeEnum (com.baidu.disconf.core.common.constants.DisConfigTypeEnum)1 ApplicationPropertyConfig (com.baidu.disconf.web.config.ApplicationPropertyConfig)1 App (com.baidu.disconf.web.service.app.bo.App)1 Config (com.baidu.disconf.web.service.config.bo.Config)1 MachineListVo (com.baidu.disconf.web.service.config.vo.MachineListVo)1 Env (com.baidu.disconf.web.service.env.bo.Env)1 ZkDisconfData (com.baidu.disconf.web.service.zookeeper.dto.ZkDisconfData)1