コード例 #1
0
 private void handleEndpointsAdded(Network tzone, Collection<String> endpoints)
     throws IOException {
   // find if the endpoints exit in some old transport zone
   Map<String, Network> transportZoneMap =
       NetworkAssociationHelper.getNetworksMap(endpoints, dbClient);
   if (!transportZoneMap.isEmpty()) {
     _log.info("Added endpoints {} to transport zone {}", endpoints.toArray(), tzone.getLabel());
     // before we add the endpoints, they need to be removed from their old transport zones
     NetworkAssociationHelper.handleRemoveFromOldNetworks(
         transportZoneMap, tzone, dbClient, _coordinator);
   }
   // now, add the the endpoints
   NetworkAssociationHelper.handleEndpointsAdded(tzone, endpoints, dbClient, _coordinator);
 }