1 package org.csc.phynixx.watchdog.log;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import org.csc.phynixx.watchdog.IWatchedCondition;
25
26
27
28
29
30 public class CheckConditionFailedLog implements IWatchdogLog {
31
32 private long timestamp = 0l;
33 private String condition = null;
34 private String description = null;
35
36 public CheckConditionFailedLog(IWatchedCondition condition) {
37 super();
38 this.timestamp = System.currentTimeMillis();
39 this.condition = condition.toString();
40
41 this.description = condition != null ? condition.toString() : "?";
42 }
43
44 public CheckConditionFailedLog(IWatchedCondition condition, String description) {
45 super();
46 if( condition==null) {
47 throw new IllegalArgumentException("Condition must be defined");
48 }
49 this.timestamp = System.currentTimeMillis();
50 this.condition = condition.toString();
51 this.description = this.condition + " " + description;
52
53 }
54
55 public long getTimestamp() {
56 return timestamp;
57 }
58
59 public String getCondition() {
60 return condition;
61 }
62
63 public String getDescription() {
64 return this.description;
65 }
66
67 public String toString() {
68 return "CheckConditionFailed : " + this.getDescription();
69 }
70
71
72 }