import org.eclipse.osgi.framework.console.CommandInterpreter;
import org.eclipse.osgi.framework.console.CommandProvider;
+import org.opendaylight.controller.appauth.authorization.Authorization;
import org.opendaylight.controller.clustering.services.CacheConfigException;
import org.opendaylight.controller.clustering.services.CacheExistException;
import org.opendaylight.controller.clustering.services.ICacheUpdateAware;
import org.opendaylight.controller.clustering.services.IClusterServices;
import org.opendaylight.controller.configuration.IConfigurationAware;
import org.opendaylight.controller.configuration.IConfigurationService;
+import org.opendaylight.controller.containermanager.ContainerChangeEvent;
+import org.opendaylight.controller.containermanager.ContainerConfig;
+import org.opendaylight.controller.containermanager.ContainerData;
+import org.opendaylight.controller.containermanager.ContainerFlowChangeEvent;
+import org.opendaylight.controller.containermanager.ContainerFlowConfig;
import org.opendaylight.controller.containermanager.IContainerAuthorization;
import org.opendaylight.controller.containermanager.IContainerManager;
+import org.opendaylight.controller.containermanager.NodeConnectorsChangeEvent;
import org.opendaylight.controller.sal.authorization.AppRoleLevel;
import org.opendaylight.controller.sal.authorization.Privilege;
import org.opendaylight.controller.sal.authorization.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.opendaylight.controller.appauth.authorization.Authorization;
-import org.opendaylight.controller.containermanager.ContainerFlowChangeEvent;
-import org.opendaylight.controller.containermanager.ContainerFlowConfig;
-import org.opendaylight.controller.containermanager.NodeConnectorsChangeEvent;
-import org.opendaylight.controller.containermanager.ContainerChangeEvent;
-import org.opendaylight.controller.containermanager.ContainerConfig;
-import org.opendaylight.controller.containermanager.ContainerData;
-
public class ContainerManager extends Authorization<String> implements IContainerManager, IObjectReader,
CommandProvider, ICacheUpdateAware<String, Object>, IContainerInternal, IContainerAuthorization,
IConfigurationAware {
* Read containers, container flows and finally containers' entries from file
* and program the database accordingly
*/
- if (containerConfigs.isEmpty()) {
+ if ((clusterServices != null) && (clusterServices.amICoordinator())) {
loadContainerConfig();
}
}
notifyContainerModeChange(delete, notifyLocal);
// Notify listeners
notifyContainerAwareListeners(container, delete);
+
+ /*
+ * This is a quick fix until configuration service becomes the
+ * centralized configuration management place. Here container manager
+ * will remove the startup files for all the bundles that are present in
+ * the container being deleted. Do the cleanup here in Container manger
+ * as do not want to put this temporary code in Configuration manager
+ * yet which is ODL.
+ */
+ if (delete) {
+ // TODO: remove when Config Mgr takes over
+ removeComponentsStartUpfiles(containerName);
+ }
}
private void notifyContainerEntryChangeInternal(String containerName, List<NodeConnector> ncList, UpdateType update, boolean notifyLocal) {
return status;
}
- /*
- * This is a quick fix until configuration service becomes the
- * centralized configuration management place. Here container manager will
- * remove the startup files for all the bundles that are present in the
- * container being deleted. Do the cleanup here in Container manger as do not
- * want to put this temporary code in Configuration manager yet which is
- * ODL.
- */
- if (delete) {
- // TODO: remove when Config Mgr takes over
- removeComponentsStartUpfiles(containerName);
- }
-
/*
* Update Configuration: This will trigger the notifications on cache
* update callback locally and on the other cluster nodes