コード例 #1
0
  @Override
  public void removeServiceMaps(Service service) {
    // 1. remove all maps to the services consumed by service specified
    for (ServiceConsumeMap map : consumeMapDao.findConsumedMapsToRemove(service.getId())) {
      objectProcessManager.scheduleProcessInstance(
          ServiceDiscoveryConstants.PROCESS_SERVICE_CONSUME_MAP_REMOVE, map, null);
    }

    // 2. remove all maps to the services consuming service specified
    for (ServiceConsumeMap map : consumeMapDao.findConsumingMapsToRemove(service.getId())) {
      objectProcessManager.scheduleProcessInstance(
          ServiceDiscoveryConstants.PROCESS_SERVICE_CONSUME_MAP_REMOVE, map, null);
    }
  }
  @Override
  public void removeServiceLink(Service service, ServiceLink serviceLink) {
    ServiceConsumeMap map =
        consumeMapDao.findMapToRemove(service.getId(), serviceLink.getServiceId());

    if (map != null) {
      objectProcessManager.scheduleProcessInstance(
          ServiceDiscoveryConstants.PROCESS_SERVICE_CONSUME_MAP_REMOVE, map, null);
    }
  }
コード例 #3
0
 @Override
 public void cleanupLoadBalancerService(Service service) {
   // 1) remove load balancer
   LoadBalancer lb =
       objectManager.findOne(
           LoadBalancer.class,
           LOAD_BALANCER.SERVICE_ID,
           service.getId(),
           LOAD_BALANCER.REMOVED,
           null);
   if (lb != null) {
     objectProcessManager.scheduleProcessInstance(
         LoadBalancerConstants.PROCESS_LB_REMOVE, lb, null);
   }
 }