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 |
40 |
String mail_recipient; |
41 |
|
42 |
|
43 |
public Backend getBackend() { |
44 |
return backend; |
45 |
} |
46 |
|
47 |
|
48 |
public int getCacheTimeout() { |
49 |
return cache_timeout; |
50 |
} |
51 |
|
52 |
public int getStatsInterval() { |
53 |
return stats_interval; |
54 |
} |
55 |
|
56 |
public int getReplyTimeout() { |
57 |
return reply_timeout; |
58 |
} |
59 |
|
60 |
@Override |
61 |
public int getTreshold() { |
62 |
return banedk_threshold; |
63 |
} |
64 |
|
65 |
@Override |
66 |
public int getTimeout() { |
67 |
return banedk_timeout; |
68 |
} |
69 |
|
70 |
public String getMailRecipient() { |
71 |
return mail_recipient; |
72 |
} |
73 |
} |