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

Add API call to controller to get timestamp.

Signed-off-by: Mike Hansen <mike.hansen@connectus.ai>
This commit is contained in:
Mike Hansen
2021-07-19 12:25:51 -04:00
parent 6264a8c490
commit e5e7ac7e8b

View File

@@ -25,6 +25,7 @@ import org.springframework.security.web.bind.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.telecominfraproject.wlan.core.client.PingClient;
@@ -242,6 +243,18 @@ public class OpensyncCloudGatewayController {
public GatewayDefaults retrieveGatewayDefaults() {
return new GatewayDefaults();
}
@RequestMapping(value = "/lastReceivedStatsTimestamp", method = RequestMethod.GET)
public Long lastReceivedStatsTimestamp(@RequestParam String apId) {
Long ret = null;
if (ovsdbSessionMapInterface.getSession(apId) != null) {
ret = ovsdbSessionMapInterface.getSession(apId).getMostRecentStatsTimestamp();
LOG.debug("lastReceivedStatsTimestamp for apId {} {}",apId,ret);
} else {
LOG.warn("lastReceivedStatsTimestamp found no session for {}, cannot get timestamp",apId);
}
return ret;
}
/**
* Verify a route to customer equipment