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