1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.appstatus.demo.check;
17
18 import net.sf.appstatus.core.check.ICheckResult;
19
20 public class GoogleHttpStatusChecker extends AbstractHttpCheck {
21
22 public ICheckResult checkStatus() {
23 ICheckResult result = null;
24
25 try {
26 this.doHttpGet("http://www.google.com");
27 result = createResult(OK);
28 result.setDescription("Google Access ok");
29 } catch (Exception e) {
30 result = createResult(FATAL);
31 result.setDescription("Google access failed");
32 result.setResolutionSteps("Your server does not have internet access : "
33 + e.getMessage());
34 }
35
36 return result;
37 }
38
39 public String getGroup() {
40 return "google";
41 }
42
43 public String getName() {
44 return "Google Http check";
45 }
46
47 }