Switch to MD-SAL APIs
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / registry / flow / DeviceFlowRegistry.java
index 99fe2fd016eb120baf1c5b8257e999876d4cd3db..706c359d6b8836702aba9c2602f51879fafa105a 100644 (file)
@@ -5,28 +5,27 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.openflowplugin.api.openflow.registry.flow;
 
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-
-import java.util.Map;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.List;
+import java.util.Optional;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+import org.opendaylight.openflowplugin.api.openflow.registry.CommonDeviceRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
 
 /**
- * Created by Martin Bobak <mbobak@cisco.com> on 8.4.2015.
+ * Registry for mapping composite-key of flow ({@link FlowRegistryKey}) from device view
+ * to flow descriptor ({@link FlowDescriptor}) as the identifier of the same flow in data store.
  */
-public interface DeviceFlowRegistry extends AutoCloseable {
-
-    FlowDescriptor retrieveIdForFlow(FlowHash flowHash);
-
-    void store(FlowHash flowHash, FlowDescriptor flowDescriptor);
+public interface DeviceFlowRegistry extends CommonDeviceRegistry<FlowRegistryKey> {
 
-    FlowId storeIfNecessary(FlowHash flowHash, short tableId);
+    ListenableFuture<List<Optional<FlowCapableNode>>> fill();
 
-    void markToBeremoved(FlowHash flowHash);
+    void storeDescriptor(@Nonnull FlowRegistryKey flowRegistryKey, @Nonnull FlowDescriptor flowDescriptor);
 
-    void removeMarked();
+    @Nullable
+    FlowDescriptor retrieveDescriptor(@Nonnull FlowRegistryKey flowRegistryKey);
 
-    Map<FlowHash, FlowDescriptor> getAllFlowDescriptors();
 }