KeeperContainerServiceImpl extends AbstractConsoleService<KeepercontainerTblDao> implements KeeperContainerService { @Override public List<KeeperContainerCreateInfo> getDcAllKeeperContainers(String dc) { List<KeepercontainerTbl> keepercontainerTbls = queryHandler.handleQuery(() -> dao.findByDcName(dc, KeepercontainerTblEntity.READSET_FULL)); OrgInfoTranslator translator = new OrgInfoTranslator(); return Lists.newArrayList(Lists.transform(keepercontainerTbls, new Function<KeepercontainerTbl, KeeperContainerCreateInfo>() { @Override public KeeperContainerCreateInfo apply(KeepercontainerTbl input) { OrganizationTbl org = translator.getFromXPipeId(input.getKeepercontainerOrgId()); KeeperContainerCreateInfo info = new KeeperContainerCreateInfo() .setDcName(dc).setActive(input.isKeepercontainerActive()) .setKeepercontainerIp(input.getKeepercontainerIp()) .setKeepercontainerPort(input.getKeepercontainerPort()); if(org != null) { info.setKeepercontainerOrgId(org.getOrgId()).setOrgName(org.getOrgName()); } else { info.setKeepercontainerOrgId(0L); } return info; } })); }  @Override KeepercontainerTbl find(final long id); @Override List<KeepercontainerTbl> findAllByDcName(final String dcName); @Override List<KeepercontainerTbl> findAllActiveByDcName(String dcName); @Override List<KeepercontainerTbl> findKeeperCount(String dcName); @Override List<KeepercontainerTbl> findBestKeeperContainersByDcCluster(String dcName, String clusterName); @Override void addKeeperContainer(final KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerCreateInfo> getDcAllKeeperContainers(String dc); @Override void updateKeeperContainer(KeeperContainerCreateInfo createInfo); @Override List<KeeperContainerInfoModel> findAllInfos();  }
@Test public void testGetDcAllKeeperContainers() { List<KeeperContainerCreateInfo> keepers = keeperContainerService.getDcAllKeeperContainers(dcNames[0]); keepers.forEach(kc -> logger.info("[keeper] {}", kc)); }