Initial opendaylight infrastructure commit!!
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / reader / NodeConnectorStatistics.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
5  * This program and the accompanying materials are made available under the
6  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7  * and is available at http://www.eclipse.org/legal/epl-v10.html
8  */
9
10 package org.opendaylight.controller.sal.reader;
11
12 import javax.xml.bind.annotation.XmlAccessType;
13 import javax.xml.bind.annotation.XmlAccessorType;
14 import javax.xml.bind.annotation.XmlElement;
15 import javax.xml.bind.annotation.XmlRootElement;
16
17 import org.opendaylight.controller.sal.core.NodeConnector;
18
19 /**
20  * Represents the statistics for the node conenctor
21  *
22  *
23  *
24  */
25 @XmlRootElement
26 @XmlAccessorType(XmlAccessType.NONE)
27 public class NodeConnectorStatistics {
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      * Set the node connector
61      * @param port
62      */
63     public void setNodeConnector(NodeConnector port) {
64         this.nodeConnector = port;
65     }
66
67     /**
68      * Returns the node connector
69      * @return
70      */
71     public NodeConnector getNodeConnector() {
72         return nodeConnector;
73     }
74
75     /**
76      * Set the rx packet count's value
77      * @param count
78      */
79     public void setReceivePacketCount(long count) {
80         receivePackets = count;
81     }
82
83     /**
84      * Returns the rx packet count for the port
85      * @return
86      */
87     public long getReceivePacketCount() {
88         return receivePackets;
89     }
90
91     /**
92      * Set the tx packet count's value
93      * @param count
94      */
95     public void setTransmitPacketCount(long count) {
96         transmitPackets = count;
97     }
98
99     /**
100      * Returns the tx packet count for the port
101      * @return
102      */
103     public long getTransmitPacketCount() {
104         return transmitPackets;
105     }
106
107     /**
108      * Set the rx byte count's value
109      * @param count
110      */
111     public void setReceiveByteCount(long count) {
112         receiveBytes = count;
113     }
114
115     /**
116      * Return the rx byte count for the port
117      * @return
118      */
119     public long getReceiveByteCount() {
120         return receiveBytes;
121     }
122
123     /**
124      * Set the tx byte count's value
125      * @param count
126      */
127     public void setTransmitByteCount(long count) {
128         transmitBytes = count;
129     }
130
131     /**
132      * Return the tx byte count for the port
133      * @return
134      */
135     public long getTransmitByteCount() {
136         return transmitBytes;
137     }
138
139     /**
140      * Set the rx drop count's value
141      * @param count
142      */
143     public void setReceiveDropCount(long count) {
144         receiveDrops = count;
145     }
146
147     /**
148      * Returns the rx drop count for the port
149      * @return
150      */
151     public long getReceiveDropCount() {
152         return receiveDrops;
153     }
154
155     /**
156      * Set the tx drop count's value
157      * @param count
158      */
159     public void setTransmitDropCount(long count) {
160         transmitDrops = count;
161     }
162
163     /**
164      * Returns the tx drop count for the port
165      * @return
166      */
167     public long getTransmitDropCount() {
168         return transmitDrops;
169     }
170
171     /**
172      * Set the rx error count's value
173      * @param count
174      */
175     public void setReceiveErrorCount(long count) {
176         receiveErrors = count;
177     }
178
179     /**
180      * Return the rx error count for the port
181      * @return
182      */
183     public long getReceiveErrorCount() {
184         return receiveErrors;
185     }
186
187     /**
188      * Set the tx error count's value
189      * @param count
190      */
191     public void setTransmitErrorCount(long count) {
192         transmitErrors = count;
193     }
194
195     /**
196      * Return the tx error count for the port
197      * @return
198      */
199     public long getTransmitErrorCount() {
200         return transmitErrors;
201     }
202
203     /**
204      * Set the rx frame error value
205      * @param count
206      */
207     public void setReceiveFrameErrorCount(long count) {
208         receiveFrameError = count;
209     }
210
211     /**
212      * Returns the rx frame error for the port
213      * @return
214      */
215     public long getReceiveFrameErrorCount() {
216         return receiveFrameError;
217     }
218
219     /**
220      * Set the rx overrun error value
221      * @param count
222      */
223     public void setReceiveOverRunErrorCount(long count) {
224         receiveOverRunError = count;
225     }
226
227     /**
228      * Return the rx overrun error for the port
229      * @return
230      */
231     public long getReceiveOverRunErrorCount() {
232         return receiveOverRunError;
233     }
234
235     /**
236      * Set the rx CRC Error value
237      * @param count
238      */
239     public void setReceiveCRCErrorCount(long count) {
240         receiveCrcError = count;
241     }
242
243     /**
244      * Return the rx CRC error for the port
245      * @return
246      */
247     public long getReceiveCRCErrorCount() {
248         return receiveCrcError;
249     }
250
251     /**
252      * Set the collisionCount count's value
253      * @param count
254      */
255     public void setCollisionCount(long count) {
256         collisionCount = count;
257     }
258
259     /**
260      * Return the collisionCount count for the port
261      * @return
262      */
263     public long getCollisionCount() {
264         return collisionCount;
265     }
266
267     @Override
268     public String toString() {
269         return "NodeConnectorStats[portNumber = " + nodeConnector
270                 + ", receivePackets = " + receivePackets
271                 + ", transmitPackets = " + transmitPackets
272                 + ", receiveBytes = " + receiveBytes + ", transmitBytes = "
273                 + transmitBytes + ", receiveDrops = " + receiveDrops
274                 + ", transmitDrops = " + transmitDrops + ", receiveErrors = "
275                 + receiveErrors + ", transmitErrors = " + transmitErrors
276                 + ", receiveFrameError = " + receiveFrameError
277                 + ", receiveOverRunError = " + receiveOverRunError
278                 + ", receiveCrcError = " + receiveCrcError
279                 + ", collisionCount = " + collisionCount + "]";
280     }
281
282 }