OpenFLow plugin & SAL API documentation
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / IReadServiceFilter.java
1 /*
2  * Copyright (c) 2013 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.controller.protocol_plugin.openflow;
10
11 import java.util.List;
12
13 import org.opendaylight.controller.sal.core.Node;
14 import org.opendaylight.controller.sal.core.NodeConnector;
15 import org.opendaylight.controller.sal.core.NodeTable;
16 import org.opendaylight.controller.sal.flowprogrammer.Flow;
17 import org.opendaylight.controller.sal.reader.FlowOnNode;
18 import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
19 import org.opendaylight.controller.sal.reader.NodeDescription;
20 import org.opendaylight.controller.sal.reader.NodeTableStatistics;
21
22 /**
23  * Interface to serve the hardware information requests coming from SAL It is
24  * implemented by the respective OF1.0 plugin component
25  *
26  */
27 public interface IReadServiceFilter {
28     /**
29      * Returns the hardware image for the specified flow on the specified
30      * network node for the passed container
31      *
32      * @param container
33      *            the container for which the request is originated
34      * @param node
35      *            the network node
36      * @param flow
37      *            the target flow
38      * @param cached
39      *            specify if entry has to be queried from the cached hardware
40      *            information maintained in the protocol plugin or directly from
41      *            the network node.
42      * @return The FlowOnNode object containing the information present in
43      *         hardware for the passed flow on the specified network node
44      */
45     public FlowOnNode readFlow(String container, Node node, Flow flow, boolean cached);
46
47     /**
48      * Returns the hardware view of all the flow installed on the specified
49      * network node for the passed container
50      *
51      * @param container
52      *            the container for which the request is originated
53      * @param node
54      *            the network node
55      * @param cached
56      *            specify if entries have to be queried from the cached hardware
57      *            information maintained in the protocol plugin or directly from
58      *            the network node.
59      * @return The list of FlowOnNode objects containing the information present
60      *         in hardware on the specified network node for all its flows
61      */
62     public List<FlowOnNode> readAllFlow(String container, Node node, boolean cached);
63
64     /**
65      * Returns the description of the network node as provided by the node
66      * itself
67      *
68      * @param node
69      *            the network node
70      * @param cached
71      *            specify if entry has to be queried from the cached hardware
72      *            information maintained in the protocol plugin or directly from
73      *            the network node.
74      * @return The NodeDescription object containing the description information
75      *         for the specified network node
76      */
77     public NodeDescription readDescription(Node node, boolean cached);
78
79     /**
80      * Returns the hardware view of the specified network node connector for the
81      * given container
82      *
83      * @param container
84      *            the container for which the request is originated
85      * @param nodeConnector
86      *            the target nodeConnector
87      * @param cached
88      *            specify if entry has to be queried from the cached hardware
89      *            information maintained in the protocol plugin or directly from
90      *            the corresponding network node.
91      * @return The NodeConnectorStatistics object containing the statistics
92      *         present in hardware for the corresponding network node port
93      */
94     public NodeConnectorStatistics readNodeConnector(String container, NodeConnector nodeConnector, boolean cached);
95
96     /**
97      * Returns the hardware info for all the node connectors on the specified
98      * network node for the given container
99      *
100      * @param container
101      *            the container for which the request is originated
102      * @param node
103      *            the target node
104      * @param cached
105      *            specify if entries have to be queried from the cached hardware
106      *            information maintained in the protocol plugin or directly from
107      *            the corresponding network node.
108      * @return The list of NodeConnectorStatistics objects containing the
109      *         statistics present in hardware for all the network node ports
110      */
111     public List<NodeConnectorStatistics> readAllNodeConnector(String container, Node node, boolean cached);
112
113     /**
114      * Returns the table statistics of the node as specified by the given
115      * container
116      *
117      * @param container
118      *            the container for which the request is originated
119      * @param nodeTable
120      *            the target network node table
121      * @param cached
122      *            specify if entry has to be queried from the cached hardware
123      *            information maintained in the protocol plugin or directly from
124      *            the corresponding network node.
125      * @return The NodeTableStatistics object containing the statistics present
126      *         in hardware for the corresponding network node table
127      */
128     public NodeTableStatistics readNodeTable(String container, NodeTable nodeTable, boolean cached);
129
130     /**
131      * Returns the table statistics of all the tables for the specified node
132      *
133      * @param container
134      *            the container for which the request is originated
135      * @param node
136      *            the target node
137      * @param cached
138      *            specify if entries have to be queried from the cached hardware
139      *            information maintained in the protocol plugin or directly from
140      *            the corresponding network node.
141      * @return The list of NodeTableStatistics objects containing the statistics
142      *         present in hardware for all the network node tables
143      */
144     public List<NodeTableStatistics> readAllNodeTable(String containerName, Node node, boolean cached);
145
146     /**
147      * Returns the average transmit rate for the specified node connector on the
148      * given container. If the node connector does not belong to the passed
149      * container a zero value is returned
150      *
151      * @param container
152      *            the container for which the request is originated
153      * @param nodeConnector
154      *            the target node connector
155      * @return The average tx rate in bps
156      */
157     public long getTransmitRate(String container, NodeConnector nodeConnector);
158 }