1 |
package dk.thoerup.traininfoservice; |
2 |
|
3 |
import dk.thoerup.circuitbreaker.config.BreakerConfig; |
4 |
import dk.thoerup.webconfig.ConfigVariable; |
5 |
import dk.thoerup.webconfig.ReloadConfig; |
6 |
|
7 |
|
8 |
public class TraininfoSettings implements BreakerConfig{ |
9 |
|
10 |
@ConfigVariable |
11 |
boolean useazuresite; |
12 |
|
13 |
@ConfigVariable(description = "Circuitbreaker", readonly = true) |
14 |
int banedk_threshold; |
15 |
|
16 |
@ConfigVariable(readonly = true) |
17 |
int banedk_timeout; |
18 |
|
19 |
@ConfigVariable(readonly = true) |
20 |
int cache_timeout; |
21 |
|
22 |
@ConfigVariable(readonly = true) |
23 |
int stats_interval; |
24 |
|
25 |
@ConfigVariable |
26 |
int reply_timeout; |
27 |
|
28 |
@ReloadConfig |
29 |
public void reloadConfig() { |
30 |
System.out.println("Reloading config"); |
31 |
|
32 |
} |
33 |
|
34 |
public boolean getUseAzureSite() { |
35 |
return useazuresite; |
36 |
} |
37 |
|
38 |
|
39 |
public int getCacheTimeout() { |
40 |
return cache_timeout; |
41 |
} |
42 |
|
43 |
public int getStatsInterval() { |
44 |
return stats_interval; |
45 |
} |
46 |
|
47 |
public int getReplyTimeout() { |
48 |
return reply_timeout; |
49 |
} |
50 |
|
51 |
|
52 |
@Override |
53 |
public int getTreshold() { |
54 |
return banedk_threshold; |
55 |
} |
56 |
|
57 |
@Override |
58 |
public int getTimeout() { |
59 |
return banedk_timeout; |
60 |
} |
61 |
} |