Make sure invokeOperation is set once
[controller.git] / opendaylight / adsal / sal / api / src / main / java / org / opendaylight / controller / sal / reader / NodeTableStatistics.java
1 /*
2  * Copyright (c) 2013 Big Switch Networks, Inc.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.sal.reader;
9
10 import java.io.Serializable;
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.core.NodeTable;
18
19 /**
20  * @author Aditya Prakash Vaja <aditya.vaja@bigswitch.com>
21  * Represents the Table statistics for the node
22  *
23  */
24
25 @XmlRootElement
26 @XmlAccessorType(XmlAccessType.NONE)
27 @Deprecated
28 public class NodeTableStatistics implements Serializable {
29     private static final long serialVersionUID = 1L;
30
31     @XmlElement
32     private NodeTable nodeTable;
33     @XmlElement
34     private String name;
35     @XmlElement
36     private int activeCount;
37     @XmlElement
38     private long lookupCount;
39     @XmlElement
40     private long matchedCount;
41     @XmlElement
42     private int maximumEntries;
43
44
45     @Override
46     public int hashCode() {
47         final int prime = 31;
48         int result = 1;
49         result = prime * result + activeCount;
50         result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32));
51         result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32));
52         result = prime * result + maximumEntries;
53         result = prime * result + ((name == null) ? 0 : name.hashCode());
54         result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode());
55         return result;
56     }
57
58     @Override
59     public boolean equals(Object obj) {
60         if (this == obj) {
61             return true;
62         }
63         if (obj == null) {
64             return false;
65         }
66         if (!(obj instanceof NodeTableStatistics)) {
67             return false;
68         }
69         NodeTableStatistics other = (NodeTableStatistics) obj;
70         if (activeCount != other.activeCount) {
71             return false;
72         }
73         if (lookupCount != other.lookupCount) {
74             return false;
75         }
76         if (matchedCount != other.matchedCount) {
77             return false;
78         }
79         if (maximumEntries != other.maximumEntries) {
80             return false;
81         }
82         if (name == null) {
83             if (other.name != null) {
84                 return false;
85             }
86         } else if (!name.equals(other.name)) {
87             return false;
88         }
89         if (nodeTable == null) {
90             if (other.nodeTable != null) {
91                 return false;
92             }
93         } else if (!nodeTable.equals(other.nodeTable)) {
94             return false;
95         }
96         return true;
97     }
98
99     //To Satisfy JAXB
100     public NodeTableStatistics() {
101
102     }
103
104     /**
105      * @return the node table
106      */
107     public NodeTable getNodeTable() {
108         return nodeTable;
109     }
110
111     /**
112      * @param table of the node
113      */
114     public void setNodeTable(NodeTable table) {
115         this.nodeTable = table;
116     }
117
118     /**
119      * @return name of the table
120      */
121     public String getName() {
122         return name;
123     }
124
125     /**
126      * @param name - set the table name to name
127      */
128     public void setName(String name) {
129         this.name = name;
130     }
131
132     /**
133      * @return the activeCount
134      */
135     public int getActiveCount() {
136         return activeCount;
137     }
138
139     /**
140      * @param activeCount the activeCount to set
141      */
142     public void setActiveCount(int activeCount) {
143         this.activeCount = activeCount;
144     }
145
146     /**
147      * @return the lookupCount
148      */
149     public long getLookupCount() {
150         return lookupCount;
151     }
152
153     /**
154      * @param lookupCount the lookupCount to set
155      */
156     public void setLookupCount(long lookupCount) {
157         this.lookupCount = lookupCount;
158     }
159
160     /**
161      * @return the matchedCount
162      */
163     public long getMatchedCount() {
164         return matchedCount;
165     }
166
167     /**
168      * @param matchedCount the matchedCount to set
169      */
170     public void setMatchedCount(long matchedCount) {
171         this.matchedCount = matchedCount;
172     }
173
174     /**
175      * @return the maximumEntries
176      */
177     public int getMaximumEntries() {
178         return maximumEntries;
179     }
180
181     /**
182      * @param maximumEntries the maximumEntries to set
183      */
184     public void setMaximumEntries(int maximumEntries) {
185         this.maximumEntries = maximumEntries;
186     }
187
188     @Override
189     public String toString() {
190         return "NodeTableStats[tableId = " + nodeTable
191                 + ", activeCount = " + activeCount
192                 + ", lookupCount = " + lookupCount
193                 + ", matchedCount = " + matchedCount
194                 + ", maximumEntries = " + maximumEntries + "]";
195     }
196 }