1 |
package dk.thoerup.traininfoservice; |
2 |
|
3 |
import java.util.logging.Logger; |
4 |
|
5 |
import javax.servlet.ServletContext; |
6 |
|
7 |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
8 |
import dk.thoerup.webconfig.ConfigVariable; |
9 |
import dk.thoerup.webconfig.ContextConfigLoader; |
10 |
import dk.thoerup.webconfig.ReloadConfigMethod; |
11 |
|
12 |
|
13 |
public class TraininfoSettings implements BreakerConfig{ |
14 |
public enum Backend { |
15 |
Azure, |
16 |
Mobile |
17 |
} |
18 |
|
19 |
Logger logger = Logger.getLogger(TraininfoSettings.class.getName() ); |
20 |
|
21 |
@ConfigVariable |
22 |
Backend backend; |
23 |
|
24 |
@ConfigVariable(description = "Circuitbreaker", readonly = true) |
25 |
int banedk_threshold; |
26 |
|
27 |
@ConfigVariable(readonly = true) |
28 |
int banedk_timeout; |
29 |
|
30 |
@ConfigVariable(readonly = true) |
31 |
int cache_timeout; |
32 |
|
33 |
@ConfigVariable(readonly = true) |
34 |
int stats_interval; |
35 |
|
36 |
@ConfigVariable |
37 |
int reply_timeout; |
38 |
|
39 |
@ConfigVariable(readonly = true) |
40 |
String mail_recipient; |
41 |
|
42 |
@ConfigVariable |
43 |
boolean tritinfo_enabled; |
44 |
|
45 |
|
46 |
public Backend getBackend() { |
47 |
return backend; |
48 |
} |
49 |
|
50 |
|
51 |
public int getCacheTimeout() { |
52 |
return cache_timeout; |
53 |
} |
54 |
|
55 |
public int getStatsInterval() { |
56 |
return stats_interval; |
57 |
} |
58 |
|
59 |
public int getReplyTimeout() { |
60 |
return reply_timeout; |
61 |
} |
62 |
|
63 |
@Override |
64 |
public int getTreshold() { |
65 |
return banedk_threshold; |
66 |
} |
67 |
|
68 |
@Override |
69 |
public int getTimeout() { |
70 |
return banedk_timeout; |
71 |
} |
72 |
|
73 |
public String getMailRecipient() { |
74 |
return mail_recipient; |
75 |
} |
76 |
|
77 |
|
78 |
public boolean isTritinfoEnabled() { |
79 |
return tritinfo_enabled; |
80 |
} |
81 |
|
82 |
|
83 |
} |