Merge "Technical Debt part 2"
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / registry / flow / DeviceFlowRegistry.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.api.openflow.registry.flow;
10
11
12 import com.google.common.base.Optional;
13 import com.google.common.util.concurrent.ListenableFuture;
14 import java.util.List;
15 import java.util.Map;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowId;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
20 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
21
22 /**
23  * Created by Martin Bobak <mbobak@cisco.com> on 8.4.2015.
24  */
25 public interface DeviceFlowRegistry extends AutoCloseable {
26
27     ListenableFuture<List<Optional<FlowCapableNode>>> fill();
28
29     FlowDescriptor retrieveIdForFlow(FlowRegistryKey flowRegistryKey);
30
31     void store(FlowRegistryKey flowRegistryKey, FlowDescriptor flowDescriptor);
32
33     FlowId storeIfNecessary(FlowRegistryKey flowRegistryKey);
34
35     void markToBeremoved(FlowRegistryKey flowRegistryKey);
36
37     void removeMarked();
38
39     Map<FlowRegistryKey, FlowDescriptor> getAllFlowDescriptors();
40
41     @Override
42     void close();
43 }