1
|
package eu.dnetlib;
|
2
|
|
3
|
import org.springframework.beans.factory.annotation.Value;
|
4
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
5
|
import org.springframework.core.io.ClassPathResource;
|
6
|
import org.springframework.core.io.Resource;
|
7
|
import org.springframework.stereotype.Component;
|
8
|
|
9
|
/**
|
10
|
* Created by Alessia Bardi on 31/03/17.
|
11
|
*
|
12
|
* @author Alessia Bardi
|
13
|
*/
|
14
|
@Component
|
15
|
@ConfigurationProperties(prefix = "openaire.exporter")
|
16
|
public class OpenaireExporterConfig {
|
17
|
|
18
|
// ISLOOKUP
|
19
|
private ClassPathResource findSolrIndexUrl;
|
20
|
private ClassPathResource findIndexDsInfo;
|
21
|
private String isLookupUrl;
|
22
|
private int requestWorkers = 100;
|
23
|
private int requestTimeout = 10;
|
24
|
|
25
|
private Datasource datasource;
|
26
|
private Project project;
|
27
|
private Jdbc jdbc;
|
28
|
private Swagger swagger;
|
29
|
|
30
|
public static class Datasource {
|
31
|
// MONGODB
|
32
|
private String mongoHost;
|
33
|
private int mongoPort;
|
34
|
private String mongoCollectionName;
|
35
|
private String mongoDbName;
|
36
|
private int mongoConnectionsPerHost;
|
37
|
private int mongoQueryLimit;
|
38
|
|
39
|
public String getMongoHost() {
|
40
|
return mongoHost;
|
41
|
}
|
42
|
|
43
|
public void setMongoHost(final String mongoHost) {
|
44
|
this.mongoHost = mongoHost;
|
45
|
}
|
46
|
|
47
|
public int getMongoPort() {
|
48
|
return mongoPort;
|
49
|
}
|
50
|
|
51
|
public void setMongoPort(final int mongoPort) {
|
52
|
this.mongoPort = mongoPort;
|
53
|
}
|
54
|
|
55
|
public String getMongoCollectionName() {
|
56
|
return mongoCollectionName;
|
57
|
}
|
58
|
|
59
|
public void setMongoCollectionName(final String mongoCollectionName) {
|
60
|
this.mongoCollectionName = mongoCollectionName;
|
61
|
}
|
62
|
|
63
|
public String getMongoDbName() {
|
64
|
return mongoDbName;
|
65
|
}
|
66
|
|
67
|
public void setMongoDbName(final String mongoDbName) {
|
68
|
this.mongoDbName = mongoDbName;
|
69
|
}
|
70
|
|
71
|
public int getMongoConnectionsPerHost() {
|
72
|
return mongoConnectionsPerHost;
|
73
|
}
|
74
|
|
75
|
public void setMongoConnectionsPerHost(final int mongoConnectionsPerHost) {
|
76
|
this.mongoConnectionsPerHost = mongoConnectionsPerHost;
|
77
|
}
|
78
|
|
79
|
public int getMongoQueryLimit() {
|
80
|
return mongoQueryLimit;
|
81
|
}
|
82
|
|
83
|
public void setMongoQueryLimit(final int mongoQueryLimit) {
|
84
|
this.mongoQueryLimit = mongoQueryLimit;
|
85
|
}
|
86
|
}
|
87
|
|
88
|
public static class Project {
|
89
|
|
90
|
private int gzipFlushSize;
|
91
|
private String tsvFields;
|
92
|
private Resource projectsFundingQueryTemplate;
|
93
|
private Resource dspaceTemplate;
|
94
|
private Resource dspaceHeadTemplate;
|
95
|
private Resource dspaceTailTemplate;
|
96
|
private Resource eprintsTemplate;
|
97
|
|
98
|
public int getGzipFlushSize() {
|
99
|
return gzipFlushSize;
|
100
|
}
|
101
|
|
102
|
public void setGzipFlushSize(final int gzipFlushSize) {
|
103
|
this.gzipFlushSize = gzipFlushSize;
|
104
|
}
|
105
|
|
106
|
public String getTsvFields() {
|
107
|
return tsvFields;
|
108
|
}
|
109
|
|
110
|
public void setTsvFields(final String tsvFields) {
|
111
|
this.tsvFields = tsvFields;
|
112
|
}
|
113
|
|
114
|
public Resource getProjectsFundingQueryTemplate() {
|
115
|
return projectsFundingQueryTemplate;
|
116
|
}
|
117
|
|
118
|
public void setProjectsFundingQueryTemplate(final Resource projectsFundingQueryTemplate) {
|
119
|
this.projectsFundingQueryTemplate = projectsFundingQueryTemplate;
|
120
|
}
|
121
|
|
122
|
public Resource getDspaceTemplate() {
|
123
|
return dspaceTemplate;
|
124
|
}
|
125
|
|
126
|
public void setDspaceTemplate(final Resource dspaceTemplate) {
|
127
|
this.dspaceTemplate = dspaceTemplate;
|
128
|
}
|
129
|
|
130
|
public Resource getDspaceHeadTemplate() {
|
131
|
return dspaceHeadTemplate;
|
132
|
}
|
133
|
|
134
|
public void setDspaceHeadTemplate(final Resource dspaceHeadTemplate) {
|
135
|
this.dspaceHeadTemplate = dspaceHeadTemplate;
|
136
|
}
|
137
|
|
138
|
public Resource getDspaceTailTemplate() {
|
139
|
return dspaceTailTemplate;
|
140
|
}
|
141
|
|
142
|
public void setDspaceTailTemplate(final Resource dspaceTailTemplate) {
|
143
|
this.dspaceTailTemplate = dspaceTailTemplate;
|
144
|
}
|
145
|
|
146
|
public Resource getEprintsTemplate() {
|
147
|
return eprintsTemplate;
|
148
|
}
|
149
|
|
150
|
public void setEprintsTemplate(final Resource eprintsTemplate) {
|
151
|
this.eprintsTemplate = eprintsTemplate;
|
152
|
}
|
153
|
}
|
154
|
|
155
|
public static class Jdbc {
|
156
|
|
157
|
// JDBC
|
158
|
@Value("${spring.datasource.driverClassName}")
|
159
|
private String driverClassName;
|
160
|
|
161
|
private String url;
|
162
|
private String user;
|
163
|
private String pwd;
|
164
|
private int minIdle;
|
165
|
private int maxidle;
|
166
|
private int maxRows;
|
167
|
|
168
|
public String getDriverClassName() {
|
169
|
return driverClassName;
|
170
|
}
|
171
|
|
172
|
public String getUrl() {
|
173
|
return url;
|
174
|
}
|
175
|
|
176
|
public void setUrl(final String url) {
|
177
|
this.url = url;
|
178
|
}
|
179
|
|
180
|
public String getUser() {
|
181
|
return user;
|
182
|
}
|
183
|
|
184
|
public void setUser(final String user) {
|
185
|
this.user = user;
|
186
|
}
|
187
|
|
188
|
public String getPwd() {
|
189
|
return pwd;
|
190
|
}
|
191
|
|
192
|
public void setPwd(final String pwd) {
|
193
|
this.pwd = pwd;
|
194
|
}
|
195
|
|
196
|
public int getMinIdle() {
|
197
|
return minIdle;
|
198
|
}
|
199
|
|
200
|
public void setMinIdle(final int minIdle) {
|
201
|
this.minIdle = minIdle;
|
202
|
}
|
203
|
|
204
|
public int getMaxidle() {
|
205
|
return maxidle;
|
206
|
}
|
207
|
|
208
|
public void setMaxidle(final int maxidle) {
|
209
|
this.maxidle = maxidle;
|
210
|
}
|
211
|
|
212
|
public int getMaxRows() {
|
213
|
return maxRows;
|
214
|
}
|
215
|
|
216
|
public void setMaxRows(final int maxRows) {
|
217
|
this.maxRows = maxRows;
|
218
|
}
|
219
|
}
|
220
|
|
221
|
public static class Swagger {
|
222
|
private String apiTitle;
|
223
|
private String apiDescription;
|
224
|
private String apiLicense;
|
225
|
private String apiLicenseUrl;
|
226
|
private String apiContactName;
|
227
|
private String apiContactUrl;
|
228
|
private String apiContactEmail;
|
229
|
|
230
|
public String getApiTitle() {
|
231
|
return apiTitle;
|
232
|
}
|
233
|
|
234
|
public void setApiTitle(final String apiTitle) {
|
235
|
this.apiTitle = apiTitle;
|
236
|
}
|
237
|
|
238
|
public String getApiDescription() {
|
239
|
return apiDescription;
|
240
|
}
|
241
|
|
242
|
public void setApiDescription(final String apiDescription) {
|
243
|
this.apiDescription = apiDescription;
|
244
|
}
|
245
|
|
246
|
public String getApiLicense() {
|
247
|
return apiLicense;
|
248
|
}
|
249
|
|
250
|
public void setApiLicense(final String apiLicense) {
|
251
|
this.apiLicense = apiLicense;
|
252
|
}
|
253
|
|
254
|
public String getApiLicenseUrl() {
|
255
|
return apiLicenseUrl;
|
256
|
}
|
257
|
|
258
|
public void setApiLicenseUrl(final String apiLicenseUrl) {
|
259
|
this.apiLicenseUrl = apiLicenseUrl;
|
260
|
}
|
261
|
|
262
|
public String getApiContactName() {
|
263
|
return apiContactName;
|
264
|
}
|
265
|
|
266
|
public void setApiContactName(final String apiContactName) {
|
267
|
this.apiContactName = apiContactName;
|
268
|
}
|
269
|
|
270
|
public String getApiContactUrl() {
|
271
|
return apiContactUrl;
|
272
|
}
|
273
|
|
274
|
public void setApiContactUrl(final String apiContactUrl) {
|
275
|
this.apiContactUrl = apiContactUrl;
|
276
|
}
|
277
|
|
278
|
public String getApiContactEmail() {
|
279
|
return apiContactEmail;
|
280
|
}
|
281
|
|
282
|
public void setApiContactEmail(final String apiContactEmail) {
|
283
|
this.apiContactEmail = apiContactEmail;
|
284
|
}
|
285
|
}
|
286
|
|
287
|
public ClassPathResource getFindSolrIndexUrl() {
|
288
|
return findSolrIndexUrl;
|
289
|
}
|
290
|
|
291
|
public void setFindSolrIndexUrl(final ClassPathResource findSolrIndexUrl) {
|
292
|
this.findSolrIndexUrl = findSolrIndexUrl;
|
293
|
}
|
294
|
|
295
|
public ClassPathResource getFindIndexDsInfo() {
|
296
|
return findIndexDsInfo;
|
297
|
}
|
298
|
|
299
|
public void setFindIndexDsInfo(final ClassPathResource findIndexDsInfo) {
|
300
|
this.findIndexDsInfo = findIndexDsInfo;
|
301
|
}
|
302
|
|
303
|
public String getIsLookupUrl() {
|
304
|
return isLookupUrl;
|
305
|
}
|
306
|
|
307
|
public void setIsLookupUrl(final String isLookupUrl) {
|
308
|
this.isLookupUrl = isLookupUrl;
|
309
|
}
|
310
|
|
311
|
public int getRequestWorkers() {
|
312
|
return requestWorkers;
|
313
|
}
|
314
|
|
315
|
public void setRequestWorkers(final int requestWorkers) {
|
316
|
this.requestWorkers = requestWorkers;
|
317
|
}
|
318
|
|
319
|
public int getRequestTimeout() {
|
320
|
return requestTimeout;
|
321
|
}
|
322
|
|
323
|
public void setRequestTimeout(final int requestTimeout) {
|
324
|
this.requestTimeout = requestTimeout;
|
325
|
}
|
326
|
|
327
|
public Datasource getDatasource() {
|
328
|
return datasource;
|
329
|
}
|
330
|
|
331
|
public void setDatasource(final Datasource datasource) {
|
332
|
this.datasource = datasource;
|
333
|
}
|
334
|
|
335
|
public Project getProject() {
|
336
|
return project;
|
337
|
}
|
338
|
|
339
|
public void setProject(final Project project) {
|
340
|
this.project = project;
|
341
|
}
|
342
|
|
343
|
public Jdbc getJdbc() {
|
344
|
return jdbc;
|
345
|
}
|
346
|
|
347
|
public void setJdbc(final Jdbc jdbc) {
|
348
|
this.jdbc = jdbc;
|
349
|
}
|
350
|
|
351
|
public Swagger getSwagger() {
|
352
|
return swagger;
|
353
|
}
|
354
|
|
355
|
public void setSwagger(final Swagger swagger) {
|
356
|
this.swagger = swagger;
|
357
|
}
|
358
|
}
|