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