blob: 12ee54517aabbcd6fbc41f3751812c3bf2345ada [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001package net.floodlightcontroller.core.web;
2
3import org.restlet.resource.Get;
4import org.restlet.resource.ServerResource;
5
6public class HealthCheckResource extends ServerResource {
7
8 public static class HealthCheckInfo {
9
10 protected boolean healthy;
11
12 public HealthCheckInfo() {
13 this.healthy = true;
14 }
15
16 public boolean isHealthy() {
17 return healthy;
18 }
19
20 public void setHealthy(boolean healthy) {
21 this.healthy = healthy;
22 }
23 }
24
25 @Get("json")
26 public HealthCheckInfo healthCheck() {
27 // Currently this is the simplest possible health check -- basically
28 // just that the controller is still running and able to respond to
29 // REST calls.
30 // Eventually this should be more sophisticated and do things
31 // like monitoring internal data structures of the controller
32 // (e.g. async storage queue length).
33 return new HealthCheckInfo();
34 }
35
36}