Merge "Bug 1598: Cleanup stale ShardReadTransactions"
[controller.git] / opendaylight / md-sal / forwardingrules-manager / src / main / java / org / opendaylight / controller / frm / FlowNodeReconciliation.java
1 /**
2  * Copyright (c) 2014 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.controller.frm;
10
11 import org.opendaylight.controller.md.sal.binding.api.DataChangeListener;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
13 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
14
15 /**
16  * forwardingrules-manager
17  * org.opendaylight.controller.frm
18  *
19  * FlowNodeReconciliation
20  * It represent Reconciliation functionality for every new device.
21  * So we have to read all possible pre-configured Flows, Meters and Groups from
22  * Config/DS and add all to new device.
23  * New device is represented by new {@link org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode}
24  * in Operational/DS. So we have to add listener for Wildcarded path in base data change scope.
25  *
26  * WildCarded InstanceIdentifier:
27  * {@code
28  *
29  * InstanceIdentifier.create(Nodes.class).child(Node.class).augmentation(FlowCapableNode.class)
30  *
31  * }
32  *
33  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
34  *
35  * Created: Aug 26, 2014
36  */
37 public interface FlowNodeReconciliation extends DataChangeListener, AutoCloseable {
38
39     /**
40      * Method contains Node registration to {@link ForwardingRulesManager} functionality
41      * as a prevention to use a validation check to the Operational/DS for identify
42      * pre-configure transaction and serious device commit in every transaction.
43      *
44      * Second part of functionality is own reconciliation pre-configure
45      * Flows, Meters and Groups.
46      *
47      * @param connectedNode - {@link org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier} to new Node
48      */
49     void flowNodeConnected(InstanceIdentifier<FlowCapableNode> connectedNode);
50
51     /**
52      * Method contains functionality for registered Node {@FlowCapableNode} removing
53      * from {@Link ForwardingRulesManager}
54      *
55      * @param disconnectedNode - {@link org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier} to removed Node
56      */
57     void flowNodeDisconnected(InstanceIdentifier<FlowCapableNode> disconnectedNode);
58 }
59