db7131f304b02022b0f260dffa6f7299fb437b85
[openflowplugin.git] / applications / forwardingrules-manager / src / main / java / org / opendaylight / openflowplugin / applications / frm / ForwardingRulesManager.java
1 /**
2  * Copyright (c) 2014, 2017 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.ReadOnlyTransaction;
12 import org.opendaylight.openflowplugin.api.openflow.configuration.ConfigurationListener;
13 import org.opendaylight.openflowplugin.applications.frm.impl.DevicesGroupRegistry;
14 import org.opendaylight.openflowplugin.applications.frm.impl.FlowNodeConnectorInventoryTranslatorImpl;
15 import org.opendaylight.serviceutils.srm.RecoverableListener;
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.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.app.arbitrator.reconcile.service.rev180227.ArbitratorReconcileService;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
27 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
28
29 /**
30  * It represent a central point for whole module. Implementation Flow Provider
31  * registers the link FlowChangeListener} and it holds all needed services for
32  * link FlowChangeListener}.
33  *
34  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
35  */
36 public interface ForwardingRulesManager extends ConfigurationListener, AutoCloseable {
37
38     void start();
39
40     /**
41      * Method returns information : "is Node with send InstanceIdentifier
42      * connected"?.
43      *
44      * @param ident
45      *            - the key of the node
46      * @return boolean - true if device is connected
47      */
48     boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident);
49
50     /**
51      * Method returns information : "is Node with send InstanceIdentifier present in
52      * operational data store"?.
53      *
54      * @param ident
55      *            - the key of the node
56      * @return boolean - true if device is present in operational data store
57      */
58     boolean checkNodeInOperationalDataStore(InstanceIdentifier<FlowCapableNode> ident);
59
60     /**
61      * Method returns generated transaction ID, which is unique for every
62      * transaction. ID is composite from prefix ("DOM") and unique number.
63      *
64      * @return String transactionID for RPC transaction identification
65      */
66     String getNewTransactionId();
67
68     /**
69      * Method returns Read Transaction. It is need for Node reconciliation only.
70      *
71      * @return ReadOnlyTransaction
72      */
73     ReadOnlyTransaction getReadTransaction();
74
75     /**
76      * Flow RPC service.
77      *
78      */
79     SalFlowService getSalFlowService();
80
81     /**
82      * Group RPC service.
83      *
84      */
85     SalGroupService getSalGroupService();
86
87     /**
88      * Meter RPC service.
89      *
90      */
91     SalMeterService getSalMeterService();
92
93     /**
94      * Table RPC service.
95      *
96      */
97     SalTableService getSalTableService();
98
99     /**
100      * Return Devices Group Registry which can be used to track the groups present in a device.
101      *
102      * @return devicesGroupRegistry
103      */
104     DevicesGroupRegistry getDevicesGroupRegistry();
105
106     /**
107      * Bundle RPC service.
108      *
109      * @return salBundleService
110      */
111     SalBundleService getSalBundleService();
112
113     /**
114      * Content definition method and prevent code duplicity in Reconcil.
115      *
116      * @return ForwardingRulesCommiter&lt;Flow&gt;.
117      */
118     ForwardingRulesCommiter<Flow> getFlowCommiter();
119
120     /**
121      * Content definition method and prevent code duplicity in Reconcil.
122      *
123      * @return ForwardingRulesCommiter&lt;Group&gt;
124      */
125     ForwardingRulesCommiter<Group> getGroupCommiter();
126
127     /**
128      * Content definition method and prevent code duplicity.
129      *
130      * @return ForwardingRulesCommiter&lt;Meter&gt;
131      */
132     ForwardingRulesCommiter<Meter> getMeterCommiter();
133
134     /**
135      * Content definition method and prevent code duplicity.
136      *
137      * @return ForwardingRulesCommiter&lt;Table&gt;
138      */
139     ForwardingRulesCommiter<TableFeatures> getTableFeaturesCommiter();
140
141     /**
142      * Check if reconciliation is disabled by user.
143      *
144      * @return true if reconciliation is disabled, else false
145      */
146     boolean isReconciliationDisabled();
147
148     /**
149      * Check if stale marking is enabled for switch reconciliation.
150      *
151      * @return true if stale marking is enabled, else false
152      */
153     boolean isStaleMarkingEnabled();
154
155     /**
156      * Return number of reconciliation retry are allowed.
157      *
158      * @return number of retries.
159      */
160     int getReconciliationRetryCount();
161
162     /**
163      * Method checks if *this* instance of openflowplugin is owner of the given
164      * openflow node.
165      *
166      * @return True if owner, else false
167      */
168     boolean isNodeOwner(InstanceIdentifier<FlowCapableNode> ident);
169
170     /**
171      * Content definition method and prevent code duplicity.
172      *
173      * @return FlowNodeConnectorInventoryTranslatorImpl
174      */
175     FlowNodeConnectorInventoryTranslatorImpl getFlowNodeConnectorInventoryTranslatorImpl();
176
177     /**
178      * holds the value read from the configuration file openflowplugin.cfg file.
179      *
180      * @return True if user enables bundle-based-reconciliation-enabled field in
181      *         config file or False
182      */
183     boolean isBundleBasedReconciliationEnabled();
184
185     /**
186      * Return the NodeConfigurator which could be used to serialize jobs.
187      *
188      * @return modeConfigurator.
189      */
190     NodeConfigurator getNodeConfigurator();
191
192     /**
193      * Method for register RecoverableListener.
194      *
195      */
196     void addRecoverableListener(RecoverableListener recoverableListener);
197
198     /**
199      * Method exposes the ArbitratorReconciliationManager service used for performing Arbitrator Based Reconciliation.
200      * @return ArbitratorReconciliationManager
201      */
202     ArbitratorReconcileService getArbitratorReconciliationManager();
203 }