Fix context chain closing
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / lifecycle / ContextChainHolder.java
index 13e8fc29eb8d7f7a50b576f9c1435a3190dccb05..9b1f96d361bcf2a95bb7931ed62e08eef3c7e5de 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.openflowplugin.api.openflow.lifecycle;
 
+import javax.annotation.Nonnull;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipListener;
 import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService;
 import org.opendaylight.mdsal.singleton.common.api.ClusterSingletonServiceProvider;
@@ -27,7 +28,7 @@ public interface ContextChainHolder extends
         MastershipChangeListener,
         DeviceDisconnectedHandler,
         EntityOwnershipListener,
-        AutoCloseable{
+        AutoCloseable {
 
     /**
      * Managers need to be added before.
@@ -37,61 +38,34 @@ public interface ContextChainHolder extends
      * @param manager a child class of {@link OFPManager}
      * @param <T> {@link OFPManager}
      */
-    <T extends OFPManager> void addManager(final T manager);
+    <T extends OFPManager> void addManager(T manager);
 
     /**
      * Create a new context chain.
      * @param connectionContext new connection
      * @return {@link ContextChain}
      */
-    ContextChain createContextChain(final ConnectionContext connectionContext);
+    ContextChain createContextChain(ConnectionContext connectionContext);
 
     /**
      * Called if connection needs to be destroyed.
      * @param deviceInfo {@link DeviceInfo}
      */
-    void destroyContextChain(final DeviceInfo deviceInfo);
-
-    /**
-     * This method will pair up connection with existing context chain.
-     * If context chain doesn't exist will create context chain a
-     * set this connection as primary to the new created context chain.
-     * If context chain cannot be created close connection and destroy context chain.
-     * @param connectionContext new connection
-     */
-    void pairConnection(final ConnectionContext connectionContext);
+    void destroyContextChain(DeviceInfo deviceInfo);
 
     /**
      * Provider is needed to register cluster singleton service.
      * @param singletonServicesProvider provider
      */
-    void addSingletonServicesProvider(final ClusterSingletonServiceProvider singletonServicesProvider);
-
-    /**
-     * Setter
-     * @param ttlBeforeDrop - time to hold context before drop
-     */
-    void setTtlBeforeDrop(final Long ttlBeforeDrop);
-
-    /**
-     * Setter
-     * @param ttlStep - step for timer
-     */
-    void setTtlStep(final Long ttlStep);
-
-    /**
-     * Setter
-     * @param neverDropChain - the chain will never be dropped
-     */
-    void setNeverDropContextChain(final Boolean neverDropChain);
+    void addSingletonServicesProvider(ClusterSingletonServiceProvider singletonServicesProvider);
 
     /**
      * Register EOS listener.
      * @param entityOwnershipService EOS services
      */
-    void changeEntityOwnershipService(final EntityOwnershipService entityOwnershipService);
+    void changeEntityOwnershipService(@Nonnull EntityOwnershipService entityOwnershipService);
 
     @Override
     void close() throws Exception;
 
-}
+}
\ No newline at end of file