Revert "Checkstyle enforcer"
[controller.git] / opendaylight / sal / api / src / main / java / org / opendaylight / controller / sal / reader / FlowOnNode.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
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
8  */
9
10 package org.opendaylight.controller.sal.reader;
11
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;
16
17 import org.opendaylight.controller.sal.flowprogrammer.Flow;
18
19 /**
20  * Represents the flow that is installed on the network node
21  * along with the table location, hit counters and timers
22  */
23
24 @XmlRootElement (name="FlowStat")
25 @XmlAccessorType(XmlAccessType.NONE)
26 public class FlowOnNode {
27     @XmlElement
28     private Flow flow; // Flow descriptor
29     @XmlElement
30     private byte tableId;
31     @XmlElement
32     private int durationSeconds;
33     @XmlElement
34     private int durationNanoseconds;
35     @XmlElement
36     private long packetCount;
37     @XmlElement
38     private long byteCount;
39
40     /* Dummy constructor for JAXB */
41     private FlowOnNode () {
42     }
43     
44     public FlowOnNode(Flow flow) {
45         this.flow = flow;
46     }
47
48     /**
49      * Returns the description of the flow which statistics are about
50      * @return
51      */
52     public Flow getFlow() {
53         return flow;
54     }
55
56     /**
57      * Set the packet count's value
58      * @param count
59      */
60     public void setPacketCount(long count) {
61         packetCount = count;
62     }
63
64     /**
65      * Set the byte count's value
66      * @param count
67      */
68     public void setByteCount(long count) {
69         byteCount = count;
70     }
71
72     /**
73      * Returns the packet count for the flow
74      * @return
75      */
76     public long getPacketCount() {
77         return packetCount;
78     }
79
80     /**
81      * Return the byte count for the flow
82      * @return
83      */
84     public long getByteCount() {
85         return byteCount;
86     }
87
88     public byte getTableId() {
89         return tableId;
90     }
91
92     public void setTableId(byte tableId) {
93         this.tableId = tableId;
94     }
95
96     public int getDurationSeconds() {
97         return durationSeconds;
98     }
99
100     public void setDurationSeconds(int durationSeconds) {
101         this.durationSeconds = durationSeconds;
102     }
103
104     public int getDurationNanoseconds() {
105         return durationNanoseconds;
106     }
107
108     public void setDurationNanoseconds(int durationNanoseconds) {
109         this.durationNanoseconds = durationNanoseconds;
110     }
111
112     @Override
113     public String toString() {
114         return "FlowOnNode[flow =" + flow + ", tableId = " + tableId
115                 + ", sec = " + durationSeconds + ", nsec = "
116                 + durationNanoseconds + ", pkt = " + packetCount + ", byte = "
117                 + byteCount + "]";
118     }
119 }