private QuickLinkVO getQuickLink()

in bigtop-manager-server/src/main/java/org/apache/bigtop/manager/server/service/impl/ComponentServiceImpl.java [108:135]


    private QuickLinkVO getQuickLink(ComponentPO componentPO) {
        ComponentDTO componentDTO = StackUtils.getComponentDTO(componentPO.getName());

        QuickLinkDTO quickLinkDTO = componentDTO.getQuickLink();
        if (quickLinkDTO == null) {
            return null;
        }

        // Use HTTP for now, need to handle https in the future
        List<ServiceConfigPO> serviceConfigPOList = serviceConfigDao.findByServiceId(componentPO.getServiceId());
        String httpPort = quickLinkDTO.getHttpPortDefault();
        for (ServiceConfigPO serviceConfigPO : serviceConfigPOList) {
            ServiceConfigDTO serviceConfigDTO = ServiceConfigConverter.INSTANCE.fromPO2DTO(serviceConfigPO);
            for (PropertyDTO propertyDTO : serviceConfigDTO.getProperties()) {
                if (propertyDTO.getName().equals(quickLinkDTO.getHttpPortProperty())) {
                    httpPort = propertyDTO.getValue().contains(":")
                            ? propertyDTO.getValue().split(":")[1]
                            : propertyDTO.getValue();
                }
            }
        }

        QuickLinkVO quickLinkVO = new QuickLinkVO();
        quickLinkVO.setDisplayName(quickLinkDTO.getDisplayName());
        String url = "http://" + componentPO.getHostname() + ":" + httpPort;
        quickLinkVO.setUrl(url);
        return quickLinkVO;
    }