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 + ((name == null) ? 0 : name.hashCode());
52 result = prime * result + ((nodeTable == null) ? 0 : nodeTable.hashCode());
57 public boolean equals(Object obj) {
64 if (!(obj instanceof NodeTableStatistics)) {
67 NodeTableStatistics other = (NodeTableStatistics) obj;
68 if (activeCount != other.activeCount) {
71 if (lookupCount != other.lookupCount) {
74 if (matchedCount != other.matchedCount) {
78 if (other.name != null) {
81 } else if (!name.equals(other.name)) {
84 if (nodeTable == null) {
85 if (other.nodeTable != null) {
88 } else if (!nodeTable.equals(other.nodeTable)) {
95 public NodeTableStatistics() {
100 * @return the node table
102 public NodeTable getNodeTable() {
107 * @param table of the node
109 public void setNodeTable(NodeTable table) {
110 this.nodeTable = table;
114 * @return name of the table
116 public String getName() {
121 * @param name - set the table name to name
123 public void setName(String name) {
128 * @return the activeCount
130 public int getActiveCount() {
135 * @param activeCount the activeCount to set
137 public void setActiveCount(int activeCount) {
138 this.activeCount = activeCount;
142 * @return the lookupCount
144 public long getLookupCount() {
149 * @param lookupCount the lookupCount to set
151 public void setLookupCount(long lookupCount) {
152 this.lookupCount = lookupCount;
156 * @return the matchedCount
158 public long getMatchedCount() {
163 * @param matchedCount the matchedCount to set
165 public void setMatchedCount(long matchedCount) {
166 this.matchedCount = matchedCount;
170 * @return the maximumEntries
172 public long getMaximumEntries() {
173 return maximumEntries;
177 * @param maximumEntries the maximumEntries to set
179 public void setMaximumEntries(int maximumEntries) {
180 this.maximumEntries = maximumEntries;
184 public String toString() {
185 return "NodeTableStats[tableId = " + nodeTable
186 + ", activeCount = " + activeCount
187 + ", lookupCount = " + lookupCount
188 + ", matchedCount = " + matchedCount + "]";