Bug 5596 Cleaning part 4 46/42546/17
authorJozef Bacigal <jbacigal@cisco.com>
Mon, 25 Jul 2016 14:46:25 +0000 (16:46 +0200)
committerJozef Bacigal <jozef.bacigal@pantheon.tech>
Mon, 15 Aug 2016 08:39:37 +0000 (08:39 +0000)
Change-Id: I967cab5cb220bfbd91ff32552c0d9e8e157ab0fd
Signed-off-by: Jozef Bacigal <jbacigal@cisco.com>
model/pom.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/lifecycle/LifecycleServiceImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/role/RoleManagerImpl.java

index c4ca25983a612b4fa98216f7fd64837116b41d34..c114d1d178c77beb426541330b3bdaef0e1bad05 100644 (file)
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>ietf-yang-types-20130715</artifactId>
     </dependency>
-    <dependency>
-      <groupId>org.opendaylight.mdsal.model</groupId>
-      <artifactId>ietf-yang-types-20130715</artifactId>
-    </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>yang-ext</artifactId>
index 21d29af70edee4c317305d9e0f53a9bd54dc1601..eb2f09fdf396018aa0c1e6fb4890c4eefb5bc5bf 100644 (file)
@@ -19,9 +19,7 @@ import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvid
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceRegistration;
 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
-import org.opendaylight.openflowplugin.api.openflow.device.DeviceInfo;
 import org.opendaylight.openflowplugin.api.openflow.lifecycle.LifecycleService;
-import org.opendaylight.openflowplugin.api.openflow.registry.flow.DeviceFlowRegistry;
 import org.opendaylight.openflowplugin.api.openflow.role.RoleContext;
 import org.opendaylight.openflowplugin.api.openflow.rpc.RpcContext;
 import org.opendaylight.openflowplugin.api.openflow.statistics.StatisticsContext;
index bc720339d483f9bd1383c648b4fbc2408048bc2d..7b5d923e69ac21ea16f1c3f81dfcb9fc05906a17 100644 (file)
@@ -109,6 +109,7 @@ class RoleContextImpl implements RoleContext {
 
     @Override
     public ListenableFuture<Void> stopClusterServices() {
+        ListenableFuture<Void> future;
         try {
             //TODO: Add callback
             sendRoleChangeToDevice(OfpRole.BECOMESLAVE).get();
@@ -116,8 +117,9 @@ class RoleContextImpl implements RoleContext {
             LOG.warn("Send role to device failed ", e);
         } finally {
             myManager.removeDeviceFromOperationalDS(deviceInfo, MAX_CLEAN_DS_RETRIES);
-            return Futures.immediateFuture(null);
+            future = Futures.immediateFuture(null);
         }
+        return future;
     }
 
     private ListenableFuture<RpcResult<SetRoleOutput>> sendRoleChangeToDevice(final OfpRole newRole) {
index cd918f2edd9430cddec63a1157787b3c8f1c4aa6..5613358ed7bf1fd68c6bcd14a1b8e20960f125a5 100644 (file)
@@ -148,43 +148,6 @@ public class RoleManagerImpl implements RoleManager {
         return contexts.get(deviceInfo);
     }
 
-    /**
-     * This method is only for testing
-     */
-    @VisibleForTesting
-    void setRoleContext(DeviceInfo deviceInfo, RoleContext roleContext){
-        if(!contexts.containsKey(deviceInfo)) {
-            contexts.put(deviceInfo, roleContext);
-        }
-    }
-
-    /**
-     * Invoked when initialization phase is done
-     * @param deviceInfo node identification
-     * @param success true if initialization done ok, false otherwise
-     */
-    @VisibleForTesting
-    void notifyListenersRoleInitializationDone(final DeviceInfo deviceInfo, final boolean success){
-        LOG.debug("Notifying registered listeners for role initialization done, no. of listeners {}", listeners.size());
-        for (final RoleChangeListener listener : listeners) {
-            listener.roleInitializationDone(deviceInfo, success);
-        }
-    }
-
-    /**
-     * Notifies registered listener on role change. Role is the new role on device
-     * If initialization phase is true, we may skip service starting
-     * @param deviceInfo
-     * @param role new role meant to be set on device
-     */
-    @VisibleForTesting
-    void notifyListenersRoleChangeOnDevice(final DeviceInfo deviceInfo, final OfpRole role){
-        LOG.debug("Notifying registered listeners for role change, no. of listeners {}", listeners.size());
-        for (final RoleChangeListener listener : listeners) {
-            listener.roleChangeOnDevice(deviceInfo, role);
-        }
-    }
-
     @Override
     public <T extends OFPContext> T gainContext(final DeviceInfo deviceInfo) {
         return (T) contexts.get(deviceInfo);