When node disconnects from master controller, no node takes over
[controller.git] / opendaylight / clustering / services_implementation / src / main / java / org / opendaylight / controller / clustering / services_implementation / internal / ClusterGlobalManager.java
index ce33ac8639cf89977c1c1f7f79d19e15a2da3dae..e05f9dfe169555237e4b3469c917e5c09f11b882 100644 (file)
@@ -10,6 +10,7 @@
 package org.opendaylight.controller.clustering.services_implementation.internal;
 
 import java.util.Map;
+
 import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
 import org.slf4j.Logger;
@@ -22,7 +23,7 @@ public class ClusterGlobalManager
 
     @Override
     void setCacheUpdateAware(Map props, ICacheUpdateAware s) {
-        logger.trace("setCacheUpdateAware");
+        logger.trace("setCacheUpdateAware: {}",s);
         if (props.get("containerName") != null) {
             // If we got a reference with the containerName property
             // that is not what we are looking for, so filter it out.
@@ -33,7 +34,7 @@ public class ClusterGlobalManager
 
     @Override
     void unsetCacheUpdateAware(Map props, ICacheUpdateAware s) {
-        logger.trace("unsetCacheUpdateAware");
+        logger.trace("unsetCacheUpdateAware: {}",s);
         if (props.get("containerName") != null) {
             // If we got a reference with the containerName property
             // that is not what we are looking for, so filter it out.
@@ -41,4 +42,13 @@ public class ClusterGlobalManager
         }
         super.unsetCacheUpdateAware(props, s);
     }
+
+    @Override
+    public void removeContainerCaches(String containerName) {
+        logger.debug("Removing caches for container {}", containerName);
+        for (String cacheName : clusterService.getCacheList(containerName)) {
+            clusterService.destroyCache(containerName, cacheName);
+        }
+    }
+
 }