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