[WIFI-3165] Keep last stats received timestamp in gateway client session map

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
This commit is contained in:
Mike Hansen
2021-07-19 11:01:13 -04:00
parent 1070708b44
commit 6264a8c490
6 changed files with 80 additions and 59 deletions

View File

@@ -1,5 +1,7 @@
package com.telecominfraproject.wlan.opensync.external.integration;
import java.util.Objects;
import com.vmware.ovsdb.service.OvsdbClient;
public class OvsdbSession {
@@ -7,7 +9,7 @@ public class OvsdbSession {
private String apId;
private long routingId;
private long equipmentId;
private int customerId;
private long mostRecentStatsTimestamp;
public OvsdbClient getOvsdbClient() {
return ovsdbClient;
@@ -33,5 +35,34 @@ public class OvsdbSession {
public void setEquipmentId(long equipmentId) {
this.equipmentId = equipmentId;
}
public long getMostRecentStatsTimestamp() {
return mostRecentStatsTimestamp;
}
public void setMostRecentStatsTimestamp(long mostRecentStatsTimestamp) {
this.mostRecentStatsTimestamp = mostRecentStatsTimestamp;
}
@Override
public int hashCode() {
return Objects.hash(apId, equipmentId, mostRecentStatsTimestamp, ovsdbClient, routingId);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
OvsdbSession other = (OvsdbSession) obj;
return Objects.equals(apId, other.apId) && equipmentId == other.equipmentId && mostRecentStatsTimestamp == other.mostRecentStatsTimestamp
&& Objects.equals(ovsdbClient, other.ovsdbClient) && routingId == other.routingId;
}
@Override
public String toString() {
return "OvsdbSession [ovsdbClient=" + ovsdbClient + ", apId=" + apId + ", routingId=" + routingId + ", equipmentId=" + equipmentId
+ ", mostRecentStatsTimestamp=" + mostRecentStatsTimestamp + "]";
}
}