1
|
package eu.dnetlib.conf;
|
2
|
|
3
|
import org.springframework.beans.factory.annotation.Value;
|
4
|
import org.springframework.stereotype.Component;
|
5
|
|
6
|
@Component
|
7
|
public class DnetGenericApplicationProperties {
|
8
|
|
9
|
@Value("${server.host}")
|
10
|
private String host;
|
11
|
@Value("${server.port}")
|
12
|
private int port;
|
13
|
|
14
|
@Value("${is.host}")
|
15
|
private String informationServiceHost;
|
16
|
@Value("${is.port}")
|
17
|
private int informationServicePort;
|
18
|
|
19
|
@Value("${dnet.baseDir}")
|
20
|
private String baseDir;
|
21
|
|
22
|
public String getHost() {
|
23
|
return host;
|
24
|
}
|
25
|
|
26
|
public void setHost(final String host) {
|
27
|
this.host = host;
|
28
|
}
|
29
|
|
30
|
public int getPort() {
|
31
|
return port;
|
32
|
}
|
33
|
|
34
|
public void setPort(final int port) {
|
35
|
this.port = port;
|
36
|
}
|
37
|
|
38
|
public String getInformationServiceHost() {
|
39
|
return informationServiceHost;
|
40
|
}
|
41
|
|
42
|
public void setInformationServiceHost(final String informationServiceHost) {
|
43
|
this.informationServiceHost = informationServiceHost;
|
44
|
}
|
45
|
|
46
|
public int getInformationServicePort() {
|
47
|
return informationServicePort;
|
48
|
}
|
49
|
|
50
|
public void setInformationServicePort(final int informationServicePort) {
|
51
|
this.informationServicePort = informationServicePort;
|
52
|
}
|
53
|
|
54
|
public String getUrl() {
|
55
|
return String.format("http://%s:%s", host.trim(), port);
|
56
|
}
|
57
|
|
58
|
public String getInformationServiceUrl() {
|
59
|
return String.format("http://%s:%s", informationServiceHost.trim(), informationServicePort);
|
60
|
}
|
61
|
|
62
|
public String getBaseDir() {
|
63
|
return baseDir;
|
64
|
}
|
65
|
|
66
|
public void setBaseDir(final String baseDir) {
|
67
|
this.baseDir = baseDir;
|
68
|
}
|
69
|
|
70
|
}
|