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.flowprogrammer.Flow;
20 * Represents the flow that is installed on the network node
21 * along with the table location, hit counters and timers
24 @XmlRootElement (name="FlowStat")
25 @XmlAccessorType(XmlAccessType.NONE)
26 public class FlowOnNode {
28 private Flow flow; // Flow descriptor
32 private int durationSeconds;
34 private int durationNanoseconds;
36 private long packetCount;
38 private long byteCount;
40 /* Dummy constructor for JAXB */
41 private FlowOnNode () {
44 public FlowOnNode(Flow flow) {
49 * Returns the description of the flow which statistics are about
52 public Flow getFlow() {
57 * Set the packet count's value
60 public void setPacketCount(long count) {
65 * Set the byte count's value
68 public void setByteCount(long count) {
73 * Returns the packet count for the flow
76 public long getPacketCount() {
81 * Return the byte count for the flow
84 public long getByteCount() {
88 public byte getTableId() {
92 public void setTableId(byte tableId) {
93 this.tableId = tableId;
96 public int getDurationSeconds() {
97 return durationSeconds;
100 public void setDurationSeconds(int durationSeconds) {
101 this.durationSeconds = durationSeconds;
104 public int getDurationNanoseconds() {
105 return durationNanoseconds;
108 public void setDurationNanoseconds(int durationNanoseconds) {
109 this.durationNanoseconds = durationNanoseconds;
113 public String toString() {
114 return "FlowOnNode[flow =" + flow + ", tableId = " + tableId
115 + ", sec = " + durationSeconds + ", nsec = "
116 + durationNanoseconds + ", pkt = " + packetCount + ", byte = "