package org.opendaylight.openflowplugin.api.openflow.registry.flow;
-import java.util.Map;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.ListenableFuture;
+import java.util.List;
+import java.util.function.BiConsumer;
+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 {
+public interface DeviceFlowRegistry extends CommonDeviceRegistry<FlowRegistryKey> {
- void fill(KeyedInstanceIdentifier<Node, NodeKey> instanceIdentifier);
+ ListenableFuture<List<Optional<FlowCapableNode>>> fill();
- FlowDescriptor retrieveIdForFlow(FlowRegistryKey flowRegistryKey);
+ void storeDescriptor(FlowRegistryKey flowRegistryKey, FlowDescriptor flowDescriptor);
- void store(FlowRegistryKey flowRegistryKey, FlowDescriptor flowDescriptor);
+ FlowDescriptor retrieveDescriptor(FlowRegistryKey flowRegistryKey);
- FlowId storeIfNecessary(FlowRegistryKey flowRegistryKey);
+ void forEachEntry(BiConsumer<FlowRegistryKey, FlowDescriptor> consumer);
- void markToBeremoved(FlowRegistryKey flowRegistryKey);
-
- void removeMarked();
-
- Map<FlowRegistryKey, FlowDescriptor> getAllFlowDescriptors();
-
- @Override
- void close();
}