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 java.io.Serializable;
14 import javax.xml.bind.annotation.XmlAccessType;
15 import javax.xml.bind.annotation.XmlAccessorType;
16 import javax.xml.bind.annotation.XmlElement;
17 import javax.xml.bind.annotation.XmlRootElement;
19 import org.opendaylight.controller.sal.flowprogrammer.Flow;
22 * Represents the flow that is installed on the network node
23 * along with the table location, hit counters and timers
26 @XmlRootElement (name="FlowStat")
27 @XmlAccessorType(XmlAccessType.NONE)
28 public class FlowOnNode implements Serializable{
29 private static final long serialVersionUID = 1L;
32 private Flow flow; // Flow descriptor
36 private int durationSeconds;
38 private int durationNanoseconds;
40 private long packetCount;
42 private long byteCount;
44 /* Dummy constructor for JAXB */
45 @SuppressWarnings("unused")
46 private FlowOnNode () {
49 public FlowOnNode(Flow flow) {
54 * Returns the description of the flow which statistics are about
57 public Flow getFlow() {
62 * Set the packet count's value
65 public void setPacketCount(long count) {
70 * Set the byte count's value
73 public void setByteCount(long count) {
78 * Returns the packet count for the flow
81 public long getPacketCount() {
86 * Return the byte count for the flow
89 public long getByteCount() {
93 public byte getTableId() {
97 public void setTableId(byte tableId) {
98 this.tableId = tableId;
101 public int getDurationSeconds() {
102 return durationSeconds;
105 public void setDurationSeconds(int durationSeconds) {
106 this.durationSeconds = durationSeconds;
109 public int getDurationNanoseconds() {
110 return durationNanoseconds;
113 public void setDurationNanoseconds(int durationNanoseconds) {
114 this.durationNanoseconds = durationNanoseconds;
118 public String toString() {
119 return "FlowOnNode[flow =" + flow + ", tableId = " + tableId
120 + ", sec = " + durationSeconds + ", nsec = "
121 + durationNanoseconds + ", pkt = " + packetCount + ", byte = "