Move stats caching to FM StatisticsManager
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / reader / NodeConnectorStatistics.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.sal.reader;
10
11 import java.io.Serializable;
12
13 import javax.xml.bind.annotation.XmlAccessType;
14 import javax.xml.bind.annotation.XmlAccessorType;
15 import javax.xml.bind.annotation.XmlElement;
16 import javax.xml.bind.annotation.XmlRootElement;
17
18 import org.opendaylight.controller.sal.core.NodeConnector;
19
20 /**
21  * Represents the statistics for the node conenctor
22  */
23 @XmlRootElement
24 @XmlAccessorType(XmlAccessType.NONE)
25 public class NodeConnectorStatistics implements Serializable {
26     private static final long serialVersionUID = 1L;
27
28     @XmlElement
29     private NodeConnector nodeConnector;
30     @XmlElement
31     private long receivePackets;
32     @XmlElement
33     private long transmitPackets;
34     @XmlElement
35     private long receiveBytes;
36     @XmlElement
37     private long transmitBytes;
38     @XmlElement
39     private long receiveDrops;
40     @XmlElement
41     private long transmitDrops;
42     @XmlElement
43     private long receiveErrors;
44     @XmlElement
45     private long transmitErrors;
46     @XmlElement
47     private long receiveFrameError;
48     @XmlElement
49     private long receiveOverRunError;
50     @XmlElement
51     private long receiveCrcError;
52     @XmlElement
53     private long collisionCount;
54
55     // To Satisfy JAXB
56     public NodeConnectorStatistics() {
57
58     }
59
60     /**
61      * Set the node connector
62      *
63      * @param port
64      */
65     public void setNodeConnector(NodeConnector port) {
66         this.nodeConnector = port;
67     }
68
69     /**
70      * Returns the node connector
71      *
72      * @return
73      */
74     public NodeConnector getNodeConnector() {
75         return nodeConnector;
76     }
77
78     /**
79      * Set the rx packet count's value
80      *
81      * @param count
82      */
83     public void setReceivePacketCount(long count) {
84         receivePackets = count;
85     }
86
87     /**
88      * Returns the rx packet count for the port
89      *
90      * @return
91      */
92     public long getReceivePacketCount() {
93         return receivePackets;
94     }
95
96     /**
97      * Set the tx packet count's value
98      *
99      * @param count
100      */
101     public void setTransmitPacketCount(long count) {
102         transmitPackets = count;
103     }
104
105     /**
106      * Returns the tx packet count for the port
107      *
108      * @return
109      */
110     public long getTransmitPacketCount() {
111         return transmitPackets;
112     }
113
114     /**
115      * Set the rx byte count's value
116      *
117      * @param count
118      */
119     public void setReceiveByteCount(long count) {
120         receiveBytes = count;
121     }
122
123     /**
124      * Return the rx byte count for the port
125      *
126      * @return
127      */
128     public long getReceiveByteCount() {
129         return receiveBytes;
130     }
131
132     /**
133      * Set the tx byte count's value
134      *
135      * @param count
136      */
137     public void setTransmitByteCount(long count) {
138         transmitBytes = count;
139     }
140
141     /**
142      * Return the tx byte count for the port
143      *
144      * @return
145      */
146     public long getTransmitByteCount() {
147         return transmitBytes;
148     }
149
150     /**
151      * Set the rx drop count's value
152      *
153      * @param count
154      */
155     public void setReceiveDropCount(long count) {
156         receiveDrops = count;
157     }
158
159     /**
160      * Returns the rx drop count for the port
161      *
162      * @return
163      */
164     public long getReceiveDropCount() {
165         return receiveDrops;
166     }
167
168     /**
169      * Set the tx drop count's value
170      *
171      * @param count
172      */
173     public void setTransmitDropCount(long count) {
174         transmitDrops = count;
175     }
176
177     /**
178      * Returns the tx drop count for the port
179      *
180      * @return
181      */
182     public long getTransmitDropCount() {
183         return transmitDrops;
184     }
185
186     /**
187      * Set the rx error count's value
188      *
189      * @param count
190      */
191     public void setReceiveErrorCount(long count) {
192         receiveErrors = count;
193     }
194
195     /**
196      * Return the rx error count for the port
197      *
198      * @return
199      */
200     public long getReceiveErrorCount() {
201         return receiveErrors;
202     }
203
204     /**
205      * Set the tx error count's value
206      *
207      * @param count
208      */
209     public void setTransmitErrorCount(long count) {
210         transmitErrors = count;
211     }
212
213     /**
214      * Return the tx error count for the port
215      *
216      * @return
217      */
218     public long getTransmitErrorCount() {
219         return transmitErrors;
220     }
221
222     /**
223      * Set the rx frame error value
224      *
225      * @param count
226      */
227     public void setReceiveFrameErrorCount(long count) {
228         receiveFrameError = count;
229     }
230
231     /**
232      * Returns the rx frame error for the port
233      *
234      * @return
235      */
236     public long getReceiveFrameErrorCount() {
237         return receiveFrameError;
238     }
239
240     /**
241      * Set the rx overrun error value
242      *
243      * @param count
244      */
245     public void setReceiveOverRunErrorCount(long count) {
246         receiveOverRunError = count;
247     }
248
249     /**
250      * Return the rx overrun error for the port
251      *
252      * @return
253      */
254     public long getReceiveOverRunErrorCount() {
255         return receiveOverRunError;
256     }
257
258     /**
259      * Set the rx CRC Error value
260      *
261      * @param count
262      */
263     public void setReceiveCRCErrorCount(long count) {
264         receiveCrcError = count;
265     }
266
267     /**
268      * Return the rx CRC error for the port
269      *
270      * @return
271      */
272     public long getReceiveCRCErrorCount() {
273         return receiveCrcError;
274     }
275
276     /**
277      * Set the collisionCount count's value
278      *
279      * @param count
280      */
281     public void setCollisionCount(long count) {
282         collisionCount = count;
283     }
284
285     /**
286      * Return the collisionCount count for the port
287      *
288      * @return
289      */
290     public long getCollisionCount() {
291         return collisionCount;
292     }
293
294     @Override
295     public String toString() {
296         return "NodeConnectorStats[portNumber = " + nodeConnector
297             + ", receivePackets = " + receivePackets
298             + ", transmitPackets = " + transmitPackets
299             + ", receiveBytes = " + receiveBytes + ", transmitBytes = "
300             + transmitBytes + ", receiveDrops = " + receiveDrops
301             + ", transmitDrops = " + transmitDrops + ", receiveErrors = "
302             + receiveErrors + ", transmitErrors = " + transmitErrors
303             + ", receiveFrameError = " + receiveFrameError
304             + ", receiveOverRunError = " + receiveOverRunError
305             + ", receiveCrcError = " + receiveCrcError
306             + ", collisionCount = " + collisionCount + "]";
307     }
308
309 }