2 * Copyright (c) 2013 Big Switch Networks, Inc. All rights reserved.
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
8 package org.opendaylight.controller.sal.reader;
10 import java.io.Serializable;
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.core.NodeTable;
20 * @author Aditya Prakash Vaja <aditya.vaja@bigswitch.com>
21 * Represents the Table statistics for the node
26 @XmlAccessorType(XmlAccessType.NONE)
27 public class NodeTableStatistics implements Serializable {
28 private static final long serialVersionUID = 1L;
31 private NodeTable nodeTable;
35 private int activeCount;
37 private long lookupCount;
39 private long matchedCount;
41 private int maximumEntries;
45 public int hashCode() {
48 result = prime * result + activeCount;
49 result = prime * result + (int) (lookupCount ^ (lookupCount >>> 32));
50 result = prime * result + (int) (matchedCount ^ (matchedCount >>> 32));
51 result = prime * result + maximumEntries;
52 result = prime * result + ((name == null) ? 0 : name.hashCode());
53 result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode());
58 public boolean equals(Object obj) {
65 if (!(obj instanceof NodeTableStatistics)) {
68 NodeTableStatistics other = (NodeTableStatistics) obj;
69 if (activeCount != other.activeCount) {
72 if (lookupCount != other.lookupCount) {
75 if (matchedCount != other.matchedCount) {
78 if (maximumEntries != other.maximumEntries) {
82 if (other.name != null) {
85 } else if (!name.equals(other.name)) {
88 if (nodeTable == null) {
89 if (other.nodeTable != null) {
92 } else if (!nodeTable.equals(other.nodeTable)) {
99 public NodeTableStatistics() {
104 * @return the node table
106 public NodeTable getNodeTable() {
111 * @param table of the node
113 public void setNodeTable(NodeTable table) {
114 this.nodeTable = table;
118 * @return name of the table
120 public String getName() {
125 * @param name - set the table name to name
127 public void setName(String name) {
132 * @return the activeCount
134 public int getActiveCount() {
139 * @param activeCount the activeCount to set
141 public void setActiveCount(int activeCount) {
142 this.activeCount = activeCount;
146 * @return the lookupCount
148 public long getLookupCount() {
153 * @param lookupCount the lookupCount to set
155 public void setLookupCount(long lookupCount) {
156 this.lookupCount = lookupCount;
160 * @return the matchedCount
162 public long getMatchedCount() {
167 * @param matchedCount the matchedCount to set
169 public void setMatchedCount(long matchedCount) {
170 this.matchedCount = matchedCount;
174 * @return the maximumEntries
176 public int getMaximumEntries() {
177 return maximumEntries;
181 * @param maximumEntries the maximumEntries to set
183 public void setMaximumEntries(int maximumEntries) {
184 this.maximumEntries = maximumEntries;
188 public String toString() {
189 return "NodeTableStats[tableId = " + nodeTable
190 + ", activeCount = " + activeCount
191 + ", lookupCount = " + lookupCount
192 + ", matchedCount = " + matchedCount
193 + ", maximumEntries = " + maximumEntries + "]";