コード例 #1
0
  private void removeOldServiceMaps(Service service, Map<String, ServiceLink> newServiceLinks) {
    List<? extends ServiceConsumeMap> existingMaps =
        consumeMapDao.findConsumedMapsToRemove(service.getId());
    List<ServiceLink> linksToRemove = new ArrayList<>();

    for (ServiceConsumeMap existingMap : existingMaps) {
      ServiceLink existingLink =
          new ServiceLink(existingMap.getConsumedServiceId(), existingMap.getName());
      if (!newServiceLinks.containsKey(existingLink.getUuid())) {
        linksToRemove.add(existingLink);
      }
    }

    for (ServiceLink linkToRemove : linksToRemove) {
      sdService.removeServiceLink(service, linkToRemove);
    }
  }
コード例 #2
0
 private void createNewServiceMaps(Service service, Map<String, ServiceLink> newServiceLinks) {
   for (ServiceLink newServiceLink : newServiceLinks.values()) {
     sdService.addServiceLink(service, newServiceLink);
   }
 }