Merge "Drop the odlparent.netty property"
[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.FlowNodeConnectorInventoryTranslatorImpl;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter;
16 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.Flow;
17 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.SalBundleService;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.features.TableFeatures;
24 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
25
26 /**
27  * It represent a central point for whole module. Implementation Flow Provider
28  * registers the link FlowChangeListener} and it holds all needed services for
29  * link FlowChangeListener}.
30  *
31  * @author <a href="mailto:vdemcak@cisco.com">Vaclav Demcak</a>
32  */
33 public interface ForwardingRulesManager extends ConfigurationListener, AutoCloseable {
34
35     void start();
36
37     /**
38      * Method returns information : "is Node with send InstanceIdentifier
39      * connected"?.
40      *
41      * @param ident
42      *            - the key of the node
43      * @return boolean - true if device is connected
44      */
45     boolean isNodeActive(InstanceIdentifier<FlowCapableNode> ident);
46
47     /**
48      * Method returns information : "is Node with send InstanceIdentifier present in
49      * operational data store"?.
50      *
51      * @param ident
52      *            - the key of the node
53      * @return boolean - true if device is present in operational data store
54      */
55     boolean checkNodeInOperationalDataStore(InstanceIdentifier<FlowCapableNode> ident);
56
57     /**
58      * Method returns generated transaction ID, which is unique for every
59      * transaction. ID is composite from prefix ("DOM") and unique number.
60      *
61      * @return String transactionID for RPC transaction identification
62      */
63     String getNewTransactionId();
64
65     /**
66      * Method returns Read Transaction. It is need for Node reconciliation only.
67      *
68      * @return ReadOnlyTransaction
69      */
70     ReadOnlyTransaction getReadTranaction();
71
72     /**
73      * Flow RPC service.
74      *
75      */
76     SalFlowService getSalFlowService();
77
78     /**
79      * Group RPC service.
80      *
81      */
82     SalGroupService getSalGroupService();
83
84     /**
85      * Meter RPC service.
86      *
87      */
88     SalMeterService getSalMeterService();
89
90     /**
91      * Table RPC service.
92      *
93      */
94     SalTableService getSalTableService();
95
96     /**
97      * Bundle RPC service.
98      *
99      * @return salBundleService
100      */
101     SalBundleService getSalBundleService();
102
103     /**
104      * Content definition method and prevent code duplicity in Reconcil.
105      *
106      * @return ForwardingRulesCommiter&lt;Flow&gt;.
107      */
108     ForwardingRulesCommiter<Flow> getFlowCommiter();
109
110     /**
111      * Content definition method and prevent code duplicity in Reconcil.
112      *
113      * @return ForwardingRulesCommiter&lt;Group&gt;
114      */
115     ForwardingRulesCommiter<Group> getGroupCommiter();
116
117     /**
118      * Content definition method and prevent code duplicity.
119      *
120      * @return ForwardingRulesCommiter&lt;Meter&gt;
121      */
122     ForwardingRulesCommiter<Meter> getMeterCommiter();
123
124     /**
125      * Content definition method and prevent code duplicity.
126      *
127      * @return ForwardingRulesCommiter&lt;Table&gt;
128      */
129     ForwardingRulesCommiter<TableFeatures> getTableFeaturesCommiter();
130
131     /**
132      * Check if reconciliation is disabled by user.
133      *
134      * @return true if reconciliation is disabled, else false
135      */
136     boolean isReconciliationDisabled();
137
138     /**
139      * Check if stale marking is enabled for switch reconciliation.
140      *
141      * @return true if stale marking is enabled, else false
142      */
143     boolean isStaleMarkingEnabled();
144
145     /**
146      * Return number of reconciliation retry are allowed.
147      *
148      * @return number of retries.
149      */
150     int getReconciliationRetryCount();
151
152     /**
153      * Method checks if *this* instance of openflowplugin is owner of the given
154      * openflow node.
155      *
156      * @return True if owner, else false
157      */
158     boolean isNodeOwner(InstanceIdentifier<FlowCapableNode> ident);
159
160     /**
161      * Content definition method and prevent code duplicity.
162      *
163      * @return FlowNodeConnectorInventoryTranslatorImpl
164      */
165     FlowNodeConnectorInventoryTranslatorImpl getFlowNodeConnectorInventoryTranslatorImpl();
166
167     /**
168      * holds the value read from the configuration file openflowplugin.cfg file.
169      *
170      * @return True if user enables bundle-based-reconciliation-enabled field in
171      *         config file or False
172      */
173     boolean isBundleBasedReconciliationEnabled();
174 }