3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
10 package org.opendaylight.controller.sal.reader;
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;
17 import org.opendaylight.controller.sal.core.NodeConnector;
20 * Represents the statistics for the node conenctor
26 @XmlAccessorType(XmlAccessType.NONE)
27 public class NodeConnectorStatistics {
29 private NodeConnector nodeConnector;
31 private long receivePackets;
33 private long transmitPackets;
35 private long receiveBytes;
37 private long transmitBytes;
39 private long receiveDrops;
41 private long transmitDrops;
43 private long receiveErrors;
45 private long transmitErrors;
47 private long receiveFrameError;
49 private long receiveOverRunError;
51 private long receiveCrcError;
53 private long collisionCount;
56 public NodeConnectorStatistics() {
60 * Set the node connector
63 public void setNodeConnector(NodeConnector port) {
64 this.nodeConnector = port;
68 * Returns the node connector
71 public NodeConnector getNodeConnector() {
76 * Set the rx packet count's value
79 public void setReceivePacketCount(long count) {
80 receivePackets = count;
84 * Returns the rx packet count for the port
87 public long getReceivePacketCount() {
88 return receivePackets;
92 * Set the tx packet count's value
95 public void setTransmitPacketCount(long count) {
96 transmitPackets = count;
100 * Returns the tx packet count for the port
103 public long getTransmitPacketCount() {
104 return transmitPackets;
108 * Set the rx byte count's value
111 public void setReceiveByteCount(long count) {
112 receiveBytes = count;
116 * Return the rx byte count for the port
119 public long getReceiveByteCount() {
124 * Set the tx byte count's value
127 public void setTransmitByteCount(long count) {
128 transmitBytes = count;
132 * Return the tx byte count for the port
135 public long getTransmitByteCount() {
136 return transmitBytes;
140 * Set the rx drop count's value
143 public void setReceiveDropCount(long count) {
144 receiveDrops = count;
148 * Returns the rx drop count for the port
151 public long getReceiveDropCount() {
156 * Set the tx drop count's value
159 public void setTransmitDropCount(long count) {
160 transmitDrops = count;
164 * Returns the tx drop count for the port
167 public long getTransmitDropCount() {
168 return transmitDrops;
172 * Set the rx error count's value
175 public void setReceiveErrorCount(long count) {
176 receiveErrors = count;
180 * Return the rx error count for the port
183 public long getReceiveErrorCount() {
184 return receiveErrors;
188 * Set the tx error count's value
191 public void setTransmitErrorCount(long count) {
192 transmitErrors = count;
196 * Return the tx error count for the port
199 public long getTransmitErrorCount() {
200 return transmitErrors;
204 * Set the rx frame error value
207 public void setReceiveFrameErrorCount(long count) {
208 receiveFrameError = count;
212 * Returns the rx frame error for the port
215 public long getReceiveFrameErrorCount() {
216 return receiveFrameError;
220 * Set the rx overrun error value
223 public void setReceiveOverRunErrorCount(long count) {
224 receiveOverRunError = count;
228 * Return the rx overrun error for the port
231 public long getReceiveOverRunErrorCount() {
232 return receiveOverRunError;
236 * Set the rx CRC Error value
239 public void setReceiveCRCErrorCount(long count) {
240 receiveCrcError = count;
244 * Return the rx CRC error for the port
247 public long getReceiveCRCErrorCount() {
248 return receiveCrcError;
252 * Set the collisionCount count's value
255 public void setCollisionCount(long count) {
256 collisionCount = count;
260 * Return the collisionCount count for the port
263 public long getCollisionCount() {
264 return collisionCount;
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 + "]";