Search in sources :

Example 1 with OpenGrayReleaseRuleItemDTO

use of com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO in project apollo by ctripcorp.

the class OpenApiBeanUtils method transformToGrayReleaseRuleDTO.

public static GrayReleaseRuleDTO transformToGrayReleaseRuleDTO(OpenGrayReleaseRuleDTO openGrayReleaseRuleDTO) {
    Preconditions.checkArgument(openGrayReleaseRuleDTO != null);
    String appId = openGrayReleaseRuleDTO.getAppId();
    String branchName = openGrayReleaseRuleDTO.getBranchName();
    String clusterName = openGrayReleaseRuleDTO.getClusterName();
    String namespaceName = openGrayReleaseRuleDTO.getNamespaceName();
    GrayReleaseRuleDTO grayReleaseRuleDTO = new GrayReleaseRuleDTO(appId, clusterName, namespaceName, branchName);
    Set<OpenGrayReleaseRuleItemDTO> openGrayReleaseRuleItemDTOSet = openGrayReleaseRuleDTO.getRuleItems();
    openGrayReleaseRuleItemDTOSet.forEach(openGrayReleaseRuleItemDTO -> {
        String clientAppId = openGrayReleaseRuleItemDTO.getClientAppId();
        Set<String> clientIpList = openGrayReleaseRuleItemDTO.getClientIpList();
        Set<String> clientLabelList = openGrayReleaseRuleItemDTO.getClientLabelList();
        GrayReleaseRuleItemDTO ruleItem = new GrayReleaseRuleItemDTO(clientAppId, clientIpList, clientLabelList);
        grayReleaseRuleDTO.addRuleItem(ruleItem);
    });
    return grayReleaseRuleDTO;
}
Also used : OpenGrayReleaseRuleDTO(com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO) GrayReleaseRuleDTO(com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO) OpenGrayReleaseRuleItemDTO(com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO) OpenGrayReleaseRuleItemDTO(com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO) GrayReleaseRuleItemDTO(com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO)

Aggregations

GrayReleaseRuleDTO (com.ctrip.framework.apollo.common.dto.GrayReleaseRuleDTO)1 GrayReleaseRuleItemDTO (com.ctrip.framework.apollo.common.dto.GrayReleaseRuleItemDTO)1 OpenGrayReleaseRuleDTO (com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleDTO)1 OpenGrayReleaseRuleItemDTO (com.ctrip.framework.apollo.openapi.dto.OpenGrayReleaseRuleItemDTO)1