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 @SuppressWarnings("unused")
42 private FlowOnNode () {
45 public FlowOnNode(Flow flow) {
50 * Returns the description of the flow which statistics are about
53 public Flow getFlow() {
58 * Set the packet count's value
61 public void setPacketCount(long count) {
66 * Set the byte count's value
69 public void setByteCount(long count) {
74 * Returns the packet count for the flow
77 public long getPacketCount() {
82 * Return the byte count for the flow
85 public long getByteCount() {
89 public byte getTableId() {
93 public void setTableId(byte tableId) {
94 this.tableId = tableId;
97 public int getDurationSeconds() {
98 return durationSeconds;
101 public void setDurationSeconds(int durationSeconds) {
102 this.durationSeconds = durationSeconds;
105 public int getDurationNanoseconds() {
106 return durationNanoseconds;
109 public void setDurationNanoseconds(int durationNanoseconds) {
110 this.durationNanoseconds = durationNanoseconds;
114 public String toString() {
115 return "FlowOnNode[flow =" + flow + ", tableId = " + tableId
116 + ", sec = " + durationSeconds + ", nsec = "
117 + durationNanoseconds + ", pkt = " + packetCount + ", byte = "