BUG-2637: migration consequence - fix unit test
[controller.git] / opendaylight / md-sal / forwardingrules-manager / src / main / java / org / opendaylight / controller / frm / ForwardingRulesManager.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.ReadOnlyTransaction;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
19 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
20
21 /**
22  * forwardingrules-manager
23  * org.opendaylight.controller.frm
24  *
25  * ForwardingRulesManager
26  * It represent a central point for whole modul. Implementation
27  * Flow Provider registers the link FlowChangeListener} and it holds all needed
28  * services for link FlowChangeListener}.
29  *
30  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
31  *
32  * Created: Aug 25, 2014
33  */
34 public interface ForwardingRulesManager extends AutoCloseable {
35
36     public void start();
37
38     /**
39      * Method returns information :
40      * "is Node with send InstanceIdentifier connected"?
41      *
42      * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
43      * @return boolean - is device connected
44      */
45     public boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident);
46
47     /**
48      * Method add new {@link FlowCapableNode} to active Node Holder.
49      * ActiveNodeHolder prevent unnecessary Operational/DS read for identify
50      * pre-configure and serious Configure/DS transactions.
51      *
52      * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
53      */
54     public void registrateNewNode(InstanceIdentifier<FlowCapableNode> ident);
55
56     /**
57      * Method remove disconnected {@link FlowCapableNode} from active Node
58      * Holder. And all next flows or groups or meters will stay in Config/DS
59      * only.
60      *
61      * @param InstanceIdentifier<FlowCapableNode> ident - the key of the node
62      */
63     public void unregistrateNode(InstanceIdentifier<FlowCapableNode> ident);
64
65     /**
66      * Method returns generated transaction ID, which is unique for
67      * every transaction. ID is composite from prefix ("DOM") and unique number.
68      *
69      * @return String transactionID for RPC transaction identification
70      */
71     public String getNewTransactionId();
72
73     /**
74      * Method returns Read Transacion. It is need for Node reconciliation only.
75      *
76      * @return ReadOnlyTransaction
77      */
78     public ReadOnlyTransaction getReadTranaction();
79
80     /**
81      * Flow RPC service
82      *
83      * @return
84      */
85     public SalFlowService getSalFlowService();
86
87     /**
88      * Group RPC service
89      *
90      * @return
91      */
92     public SalGroupService getSalGroupService();
93
94     /**
95      * Meter RPC service
96      *
97      * @return
98      */
99     public SalMeterService getSalMeterService();
100
101     /**
102      * Content definition method and prevent code duplicity in Reconcil
103      * @return ForwardingRulesCommiter<Flow>
104      */
105     public ForwardingRulesCommiter<Flow> getFlowCommiter();
106
107     /**
108      * Content definition method and prevent code duplicity in Reconcil
109      * @return ForwardingRulesCommiter<Group>
110      */
111     public ForwardingRulesCommiter<Group> getGroupCommiter();
112
113     /**
114      * Content definition method and prevent code duplicity
115      * @return ForwardingRulesCommiter<Meter>
116      */
117     public ForwardingRulesCommiter<Meter> getMeterCommiter();
118
119     /**
120      * Content definition method
121      * @return FlowNodeReconciliation
122      */
123     public FlowNodeReconciliation getFlowNodeReconciliation();
124 }
125