2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.sal.reader;
11 import java.io.Serializable;
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;
18 import org.opendaylight.controller.sal.core.NodeConnector;
21 * Represents the statistics for the node conenctor
24 @XmlAccessorType(XmlAccessType.NONE)
25 public class NodeConnectorStatistics implements Serializable {
26 private static final long serialVersionUID = 1L;
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() {
61 * Set the node connector
65 public void setNodeConnector(NodeConnector port) {
66 this.nodeConnector = port;
70 * Returns the node connector
74 public NodeConnector getNodeConnector() {
79 * Set the rx packet count's value
83 public void setReceivePacketCount(long count) {
84 receivePackets = count;
88 * Returns the rx packet count for the port
92 public long getReceivePacketCount() {
93 return receivePackets;
97 * Set the tx packet count's value
101 public void setTransmitPacketCount(long count) {
102 transmitPackets = count;
106 * Returns the tx packet count for the port
110 public long getTransmitPacketCount() {
111 return transmitPackets;
115 * Set the rx byte count's value
119 public void setReceiveByteCount(long count) {
120 receiveBytes = count;
124 * Return the rx byte count for the port
128 public long getReceiveByteCount() {
133 * Set the tx byte count's value
137 public void setTransmitByteCount(long count) {
138 transmitBytes = count;
142 * Return the tx byte count for the port
146 public long getTransmitByteCount() {
147 return transmitBytes;
151 * Set the rx drop count's value
155 public void setReceiveDropCount(long count) {
156 receiveDrops = count;
160 * Returns the rx drop count for the port
164 public long getReceiveDropCount() {
169 * Set the tx drop count's value
173 public void setTransmitDropCount(long count) {
174 transmitDrops = count;
178 * Returns the tx drop count for the port
182 public long getTransmitDropCount() {
183 return transmitDrops;
187 * Set the rx error count's value
191 public void setReceiveErrorCount(long count) {
192 receiveErrors = count;
196 * Return the rx error count for the port
200 public long getReceiveErrorCount() {
201 return receiveErrors;
205 * Set the tx error count's value
209 public void setTransmitErrorCount(long count) {
210 transmitErrors = count;
214 * Return the tx error count for the port
218 public long getTransmitErrorCount() {
219 return transmitErrors;
223 * Set the rx frame error value
227 public void setReceiveFrameErrorCount(long count) {
228 receiveFrameError = count;
232 * Returns the rx frame error for the port
236 public long getReceiveFrameErrorCount() {
237 return receiveFrameError;
241 * Set the rx overrun error value
245 public void setReceiveOverRunErrorCount(long count) {
246 receiveOverRunError = count;
250 * Return the rx overrun error for the port
254 public long getReceiveOverRunErrorCount() {
255 return receiveOverRunError;
259 * Set the rx CRC Error value
263 public void setReceiveCRCErrorCount(long count) {
264 receiveCrcError = count;
268 * Return the rx CRC error for the port
272 public long getReceiveCRCErrorCount() {
273 return receiveCrcError;
277 * Set the collisionCount count's value
281 public void setCollisionCount(long count) {
282 collisionCount = count;
286 * Return the collisionCount count for the port
290 public long getCollisionCount() {
291 return collisionCount;
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 + "]";