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