Mark AD-SAL interfaces as deprecated
[controller.git] / opendaylight / adsal / 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 a node connector
22  */
23 @XmlRootElement
24 @XmlAccessorType(XmlAccessType.NONE)
25 @Deprecated
26 public class NodeConnectorStatistics implements Serializable {
27     private static final long serialVersionUID = 1L;
28
29     @XmlElement
30     private NodeConnector nodeConnector;
31     @XmlElement
32     private long receivePackets;
33     @XmlElement
34     private long transmitPackets;
35     @XmlElement
36     private long receiveBytes;
37     @XmlElement
38     private long transmitBytes;
39     @XmlElement
40     private long receiveDrops;
41     @XmlElement
42     private long transmitDrops;
43     @XmlElement
44     private long receiveErrors;
45     @XmlElement
46     private long transmitErrors;
47     @XmlElement
48     private long receiveFrameError;
49     @XmlElement
50     private long receiveOverRunError;
51     @XmlElement
52     private long receiveCrcError;
53     @XmlElement
54     private long collisionCount;
55
56     @Override
57     public int hashCode() {
58         final int prime = 31;
59         int result = 1;
60         result = prime * result + (int) (collisionCount ^ (collisionCount >>> 32));
61         result = prime * result + ((nodeConnector == null) ? 0 : nodeConnector.hashCode());
62         result = prime * result + (int) (receiveBytes ^ (receiveBytes >>> 32));
63         result = prime * result + (int) (receiveCrcError ^ (receiveCrcError >>> 32));
64         result = prime * result + (int) (receiveDrops ^ (receiveDrops >>> 32));
65         result = prime * result + (int) (receiveErrors ^ (receiveErrors >>> 32));
66         result = prime * result + (int) (receiveFrameError ^ (receiveFrameError >>> 32));
67         result = prime * result + (int) (receiveOverRunError ^ (receiveOverRunError >>> 32));
68         result = prime * result + (int) (receivePackets ^ (receivePackets >>> 32));
69         result = prime * result + (int) (transmitBytes ^ (transmitBytes >>> 32));
70         result = prime * result + (int) (transmitDrops ^ (transmitDrops >>> 32));
71         result = prime * result + (int) (transmitErrors ^ (transmitErrors >>> 32));
72         result = prime * result + (int) (transmitPackets ^ (transmitPackets >>> 32));
73         return result;
74     }
75
76     @Override
77     public boolean equals(Object obj) {
78         if (this == obj) {
79             return true;
80         }
81         if (obj == null) {
82             return false;
83         }
84         if (!(obj instanceof NodeConnectorStatistics)) {
85             return false;
86         }
87         NodeConnectorStatistics other = (NodeConnectorStatistics) obj;
88         if (collisionCount != other.collisionCount) {
89             return false;
90         }
91         if (nodeConnector == null) {
92             if (other.nodeConnector != null) {
93                 return false;
94             }
95         } else if (!nodeConnector.equals(other.nodeConnector)) {
96             return false;
97         }
98         if (receiveBytes != other.receiveBytes) {
99             return false;
100         }
101         if (receiveCrcError != other.receiveCrcError) {
102             return false;
103         }
104         if (receiveDrops != other.receiveDrops) {
105             return false;
106         }
107         if (receiveErrors != other.receiveErrors) {
108             return false;
109         }
110         if (receiveFrameError != other.receiveFrameError) {
111             return false;
112         }
113         if (receiveOverRunError != other.receiveOverRunError) {
114             return false;
115         }
116         if (receivePackets != other.receivePackets) {
117             return false;
118         }
119         if (transmitBytes != other.transmitBytes) {
120             return false;
121         }
122         if (transmitDrops != other.transmitDrops) {
123             return false;
124         }
125         if (transmitErrors != other.transmitErrors) {
126             return false;
127         }
128         if (transmitPackets != other.transmitPackets) {
129             return false;
130         }
131         return true;
132     }
133
134     // To Satisfy JAXB
135     public NodeConnectorStatistics() {
136
137     }
138
139     /**
140      * Set the node connector
141      *
142      * @param port
143      */
144     public void setNodeConnector(NodeConnector port) {
145         this.nodeConnector = port;
146     }
147
148     /**
149      * Returns the node connector
150      *
151      * @return
152      */
153     public NodeConnector getNodeConnector() {
154         return nodeConnector;
155     }
156
157     /**
158      * Set the rx packet count's value
159      *
160      * @param count
161      */
162     public void setReceivePacketCount(long count) {
163         receivePackets = count;
164     }
165
166     /**
167      * Returns the rx packet count for the port
168      *
169      * @return
170      */
171     public long getReceivePacketCount() {
172         return receivePackets;
173     }
174
175     /**
176      * Set the tx packet count's value
177      *
178      * @param count
179      */
180     public void setTransmitPacketCount(long count) {
181         transmitPackets = count;
182     }
183
184     /**
185      * Returns the tx packet count for the port
186      *
187      * @return
188      */
189     public long getTransmitPacketCount() {
190         return transmitPackets;
191     }
192
193     /**
194      * Set the rx byte count's value
195      *
196      * @param count
197      */
198     public void setReceiveByteCount(long count) {
199         receiveBytes = count;
200     }
201
202     /**
203      * Return the rx byte count for the port
204      *
205      * @return
206      */
207     public long getReceiveByteCount() {
208         return receiveBytes;
209     }
210
211     /**
212      * Set the tx byte count's value
213      *
214      * @param count
215      */
216     public void setTransmitByteCount(long count) {
217         transmitBytes = count;
218     }
219
220     /**
221      * Return the tx byte count for the port
222      *
223      * @return
224      */
225     public long getTransmitByteCount() {
226         return transmitBytes;
227     }
228
229     /**
230      * Set the rx drop count's value
231      *
232      * @param count
233      */
234     public void setReceiveDropCount(long count) {
235         receiveDrops = count;
236     }
237
238     /**
239      * Returns the rx drop count for the port
240      *
241      * @return
242      */
243     public long getReceiveDropCount() {
244         return receiveDrops;
245     }
246
247     /**
248      * Set the tx drop count's value
249      *
250      * @param count
251      */
252     public void setTransmitDropCount(long count) {
253         transmitDrops = count;
254     }
255
256     /**
257      * Returns the tx drop count for the port
258      *
259      * @return
260      */
261     public long getTransmitDropCount() {
262         return transmitDrops;
263     }
264
265     /**
266      * Set the rx error count's value
267      *
268      * @param count
269      */
270     public void setReceiveErrorCount(long count) {
271         receiveErrors = count;
272     }
273
274     /**
275      * Return the rx error count for the port
276      *
277      * @return
278      */
279     public long getReceiveErrorCount() {
280         return receiveErrors;
281     }
282
283     /**
284      * Set the tx error count's value
285      *
286      * @param count
287      */
288     public void setTransmitErrorCount(long count) {
289         transmitErrors = count;
290     }
291
292     /**
293      * Return the tx error count for the port
294      *
295      * @return
296      */
297     public long getTransmitErrorCount() {
298         return transmitErrors;
299     }
300
301     /**
302      * Set the rx frame error value
303      *
304      * @param count
305      */
306     public void setReceiveFrameErrorCount(long count) {
307         receiveFrameError = count;
308     }
309
310     /**
311      * Returns the rx frame error for the port
312      *
313      * @return
314      */
315     public long getReceiveFrameErrorCount() {
316         return receiveFrameError;
317     }
318
319     /**
320      * Set the rx overrun error value
321      *
322      * @param count
323      */
324     public void setReceiveOverRunErrorCount(long count) {
325         receiveOverRunError = count;
326     }
327
328     /**
329      * Return the rx overrun error for the port
330      *
331      * @return
332      */
333     public long getReceiveOverRunErrorCount() {
334         return receiveOverRunError;
335     }
336
337     /**
338      * Set the rx CRC Error value
339      *
340      * @param count
341      */
342     public void setReceiveCRCErrorCount(long count) {
343         receiveCrcError = count;
344     }
345
346     /**
347      * Return the rx CRC error for the port
348      *
349      * @return
350      */
351     public long getReceiveCRCErrorCount() {
352         return receiveCrcError;
353     }
354
355     /**
356      * Set the collisionCount count's value
357      *
358      * @param count
359      */
360     public void setCollisionCount(long count) {
361         collisionCount = count;
362     }
363
364     /**
365      * Return the collisionCount count for the port
366      *
367      * @return
368      */
369     public long getCollisionCount() {
370         return collisionCount;
371     }
372
373     @Override
374     public String toString() {
375         return "NodeConnectorStats[portNumber = " + nodeConnector
376             + ", receivePackets = " + receivePackets
377             + ", transmitPackets = " + transmitPackets
378             + ", receiveBytes = " + receiveBytes + ", transmitBytes = "
379             + transmitBytes + ", receiveDrops = " + receiveDrops
380             + ", transmitDrops = " + transmitDrops + ", receiveErrors = "
381             + receiveErrors + ", transmitErrors = " + transmitErrors
382             + ", receiveFrameError = " + receiveFrameError
383             + ", receiveOverRunError = " + receiveOverRunError
384             + ", receiveCrcError = " + receiveCrcError
385             + ", collisionCount = " + collisionCount + "]";
386     }
387
388 }