BUG:5888 - Changing FRM from clustered DCN to clustered DTCN
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / 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.openflowplugin.applications.frm;
10
11 import org.opendaylight.openflowplugin.applications.frm.impl.ForwardingRulesManagerConfig;
12 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
13
14 import org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeConnectorInventoryTranslatorImpl;
15 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
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.meters.Meter;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
24 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
25
26 /**
27  * forwardingrules-manager
28  * org.opendaylight.openflowplugin.applications.frm
29  *
30  * ForwardingRulesManager
31  * It represent a central point for whole modul. Implementation
32  * Flow Provider registers the link FlowChangeListener} and it holds all needed
33  * services for link FlowChangeListener}.
34  *
35  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
36  *
37  * Created: Aug 25, 2014
38  */
39 public interface ForwardingRulesManager extends AutoCloseable {
40
41     public void start();
42
43     /**
44      * Method returns information :
45      * "is Node with send InstanceIdentifier connected"?
46      *
47      * @param ident - the key of the node
48      * @return boolean - true if device is connected
49      */
50     public boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident);
51
52     /**
53      * Method returns information :
54      * "is Node with send InstanceIdentifier present in operational data store"?
55      *
56      * @param ident - the key of the node
57      * @return boolean - true if device is present in operational data store
58      */
59     public boolean checkNodeInOperationalDataStore(InstanceIdentifier<FlowCapableNode> ident);
60
61     /**
62      * Method add new {@link FlowCapableNode} to active Node Holder.
63      * ActiveNodeHolder prevent unnecessary Operational/DS read for identify
64      * pre-configure and serious Configure/DS transactions.
65      *
66      * @param ident - the key of the node
67      */
68     public void registrateNewNode(InstanceIdentifier<FlowCapableNode> ident);
69
70     /**
71      * Method remove disconnected {@link FlowCapableNode} from active Node
72      * Holder. And all next flows or groups or meters will stay in Config/DS
73      * only.
74      *
75      * @param ident - the key of the node
76      */
77     public void unregistrateNode(InstanceIdentifier<FlowCapableNode> ident);
78
79     /**
80      * Method returns generated transaction ID, which is unique for
81      * every transaction. ID is composite from prefix ("DOM") and unique number.
82      *
83      * @return String transactionID for RPC transaction identification
84      */
85     public String getNewTransactionId();
86
87     /**
88      * Method returns Read Transacion. It is need for Node reconciliation only.
89      *
90      * @return ReadOnlyTransaction
91      */
92     public ReadOnlyTransaction getReadTranaction();
93
94     /**
95      * Flow RPC service
96      *
97      * @return
98      */
99     public SalFlowService getSalFlowService();
100
101     /**
102      * Group RPC service
103      *
104      * @return
105      */
106     public SalGroupService getSalGroupService();
107
108     /**
109      * Meter RPC service
110      *
111      * @return
112      */
113     public SalMeterService getSalMeterService();
114
115     /**
116      * Table RPC service
117      *
118      * @return
119      */
120     public SalTableService getSalTableService();
121
122     /**
123      * Content definition method and prevent code duplicity in Reconcil
124      * @return ForwardingRulesCommiter&lt;Flow&gt;
125      */
126     public ForwardingRulesCommiter<Flow> getFlowCommiter();
127
128     /**
129      * Content definition method and prevent code duplicity in Reconcil
130      * @return ForwardingRulesCommiter&lt;Group&gt;
131      */
132     public ForwardingRulesCommiter<Group> getGroupCommiter();
133
134     /**
135      * Content definition method and prevent code duplicity
136      * @return ForwardingRulesCommiter&lt;Meter&gt;
137      */
138     public ForwardingRulesCommiter<Meter> getMeterCommiter();
139
140     /**
141      * Content definition method and prevent code duplicity
142      * @return ForwardingRulesCommiter&lt;Table&gt;
143      */
144     public ForwardingRulesCommiter<TableFeatures> getTableFeaturesCommiter();
145
146     /**
147      * Content definition method
148      * @return FlowNodeReconciliation
149      */
150     public FlowNodeReconciliation getFlowNodeReconciliation();
151
152     /**
153      * Returns the config-subsystem/fallback configuration of FRM
154      * @return ForwardingRulesManagerConfig
155      */
156     public ForwardingRulesManagerConfig getConfiguration();
157
158     /**
159      * Method checks if *this* instance of openflowplugin is owner of
160      * the given openflow node.
161      * @return True if owner, else false
162      */
163     public boolean isNodeOwner(InstanceIdentifier<FlowCapableNode> ident);
164      
165     /**
166      * Content definition method and prevent code duplicity
167      * @return FlowNodeConnectorInventoryTranslatorImpl
168      */
169     public FlowNodeConnectorInventoryTranslatorImpl getFlowNodeConnectorInventoryTranslatorImpl();
170
171 }
172