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 ClassPathResource findObjectStore;
|
22
|
private ClassPathResource findFunderContexts;
|
23
|
private ClassPathResource updateRepoField;
|
24
|
|
25
|
private String isLookupUrl;
|
26
|
private String objectStoreServiceUrl;
|
27
|
|
28
|
private int requestWorkers = 100;
|
29
|
private int requestTimeout = 10;
|
30
|
|
31
|
private Datasource datasource;
|
32
|
private Project project;
|
33
|
private Jdbc jdbc;
|
34
|
private Swagger swaggerDsm;
|
35
|
private Swagger swaggerProjects;
|
36
|
private Swagger swaggerFunders;
|
37
|
|
38
|
private Vocabularies vocabularies;
|
39
|
|
40
|
public static class Datasource {
|
41
|
// MONGODB
|
42
|
private String mongoHost;
|
43
|
private int mongoPort;
|
44
|
private String mongoCollectionName;
|
45
|
private String mongoDbName;
|
46
|
private int mongoConnectionsPerHost;
|
47
|
private int mongoQueryLimit;
|
48
|
|
49
|
public String getMongoHost() {
|
50
|
return mongoHost;
|
51
|
}
|
52
|
|
53
|
public void setMongoHost(final String mongoHost) {
|
54
|
this.mongoHost = mongoHost;
|
55
|
}
|
56
|
|
57
|
public int getMongoPort() {
|
58
|
return mongoPort;
|
59
|
}
|
60
|
|
61
|
public void setMongoPort(final int mongoPort) {
|
62
|
this.mongoPort = mongoPort;
|
63
|
}
|
64
|
|
65
|
public String getMongoCollectionName() {
|
66
|
return mongoCollectionName;
|
67
|
}
|
68
|
|
69
|
public void setMongoCollectionName(final String mongoCollectionName) {
|
70
|
this.mongoCollectionName = mongoCollectionName;
|
71
|
}
|
72
|
|
73
|
public String getMongoDbName() {
|
74
|
return mongoDbName;
|
75
|
}
|
76
|
|
77
|
public void setMongoDbName(final String mongoDbName) {
|
78
|
this.mongoDbName = mongoDbName;
|
79
|
}
|
80
|
|
81
|
public int getMongoConnectionsPerHost() {
|
82
|
return mongoConnectionsPerHost;
|
83
|
}
|
84
|
|
85
|
public void setMongoConnectionsPerHost(final int mongoConnectionsPerHost) {
|
86
|
this.mongoConnectionsPerHost = mongoConnectionsPerHost;
|
87
|
}
|
88
|
|
89
|
public int getMongoQueryLimit() {
|
90
|
return mongoQueryLimit;
|
91
|
}
|
92
|
|
93
|
public void setMongoQueryLimit(final int mongoQueryLimit) {
|
94
|
this.mongoQueryLimit = mongoQueryLimit;
|
95
|
}
|
96
|
}
|
97
|
|
98
|
public static class Project {
|
99
|
|
100
|
private int flushSize;
|
101
|
private String tsvFields;
|
102
|
private Resource projectsFundingQueryTemplate;
|
103
|
private Resource dspaceTemplate;
|
104
|
private Resource dspaceHeadTemplate;
|
105
|
private Resource dspaceTailTemplate;
|
106
|
private Resource eprintsTemplate;
|
107
|
|
108
|
public int getFlushSize() {
|
109
|
return flushSize;
|
110
|
}
|
111
|
|
112
|
public void setFlushSize(final int flushSize) {
|
113
|
this.flushSize = flushSize;
|
114
|
}
|
115
|
|
116
|
public String getTsvFields() {
|
117
|
return tsvFields;
|
118
|
}
|
119
|
|
120
|
public void setTsvFields(final String tsvFields) {
|
121
|
this.tsvFields = tsvFields;
|
122
|
}
|
123
|
|
124
|
public Resource getProjectsFundingQueryTemplate() {
|
125
|
return projectsFundingQueryTemplate;
|
126
|
}
|
127
|
|
128
|
public void setProjectsFundingQueryTemplate(final Resource projectsFundingQueryTemplate) {
|
129
|
this.projectsFundingQueryTemplate = projectsFundingQueryTemplate;
|
130
|
}
|
131
|
|
132
|
public Resource getDspaceTemplate() {
|
133
|
return dspaceTemplate;
|
134
|
}
|
135
|
|
136
|
public void setDspaceTemplate(final Resource dspaceTemplate) {
|
137
|
this.dspaceTemplate = dspaceTemplate;
|
138
|
}
|
139
|
|
140
|
public Resource getDspaceHeadTemplate() {
|
141
|
return dspaceHeadTemplate;
|
142
|
}
|
143
|
|
144
|
public void setDspaceHeadTemplate(final Resource dspaceHeadTemplate) {
|
145
|
this.dspaceHeadTemplate = dspaceHeadTemplate;
|
146
|
}
|
147
|
|
148
|
public Resource getDspaceTailTemplate() {
|
149
|
return dspaceTailTemplate;
|
150
|
}
|
151
|
|
152
|
public void setDspaceTailTemplate(final Resource dspaceTailTemplate) {
|
153
|
this.dspaceTailTemplate = dspaceTailTemplate;
|
154
|
}
|
155
|
|
156
|
public Resource getEprintsTemplate() {
|
157
|
return eprintsTemplate;
|
158
|
}
|
159
|
|
160
|
public void setEprintsTemplate(final Resource eprintsTemplate) {
|
161
|
this.eprintsTemplate = eprintsTemplate;
|
162
|
}
|
163
|
}
|
164
|
|
165
|
public static class Jdbc {
|
166
|
|
167
|
// JDBC
|
168
|
@Value("${spring.datasource.driverClassName}")
|
169
|
private String driverClassName;
|
170
|
|
171
|
private String url;
|
172
|
private String user;
|
173
|
private String pwd;
|
174
|
private int minIdle;
|
175
|
private int maxidle;
|
176
|
private int maxRows;
|
177
|
|
178
|
public String getDriverClassName() {
|
179
|
return driverClassName;
|
180
|
}
|
181
|
|
182
|
public String getUrl() {
|
183
|
return url;
|
184
|
}
|
185
|
|
186
|
public void setUrl(final String url) {
|
187
|
this.url = url;
|
188
|
}
|
189
|
|
190
|
public String getUser() {
|
191
|
return user;
|
192
|
}
|
193
|
|
194
|
public void setUser(final String user) {
|
195
|
this.user = user;
|
196
|
}
|
197
|
|
198
|
public String getPwd() {
|
199
|
return pwd;
|
200
|
}
|
201
|
|
202
|
public void setPwd(final String pwd) {
|
203
|
this.pwd = pwd;
|
204
|
}
|
205
|
|
206
|
public int getMinIdle() {
|
207
|
return minIdle;
|
208
|
}
|
209
|
|
210
|
public void setMinIdle(final int minIdle) {
|
211
|
this.minIdle = minIdle;
|
212
|
}
|
213
|
|
214
|
public int getMaxidle() {
|
215
|
return maxidle;
|
216
|
}
|
217
|
|
218
|
public void setMaxidle(final int maxidle) {
|
219
|
this.maxidle = maxidle;
|
220
|
}
|
221
|
|
222
|
public int getMaxRows() {
|
223
|
return maxRows;
|
224
|
}
|
225
|
|
226
|
public void setMaxRows(final int maxRows) {
|
227
|
this.maxRows = maxRows;
|
228
|
}
|
229
|
}
|
230
|
|
231
|
public static class Swagger {
|
232
|
private String apiTitle;
|
233
|
private String apiDescription;
|
234
|
private String apiLicense;
|
235
|
private String apiLicenseUrl;
|
236
|
private String apiContactName;
|
237
|
private String apiContactUrl;
|
238
|
private String apiContactEmail;
|
239
|
|
240
|
public String getApiTitle() {
|
241
|
return apiTitle;
|
242
|
}
|
243
|
|
244
|
public void setApiTitle(final String apiTitle) {
|
245
|
this.apiTitle = apiTitle;
|
246
|
}
|
247
|
|
248
|
public String getApiDescription() {
|
249
|
return apiDescription;
|
250
|
}
|
251
|
|
252
|
public void setApiDescription(final String apiDescription) {
|
253
|
this.apiDescription = apiDescription;
|
254
|
}
|
255
|
|
256
|
public String getApiLicense() {
|
257
|
return apiLicense;
|
258
|
}
|
259
|
|
260
|
public void setApiLicense(final String apiLicense) {
|
261
|
this.apiLicense = apiLicense;
|
262
|
}
|
263
|
|
264
|
public String getApiLicenseUrl() {
|
265
|
return apiLicenseUrl;
|
266
|
}
|
267
|
|
268
|
public void setApiLicenseUrl(final String apiLicenseUrl) {
|
269
|
this.apiLicenseUrl = apiLicenseUrl;
|
270
|
}
|
271
|
|
272
|
public String getApiContactName() {
|
273
|
return apiContactName;
|
274
|
}
|
275
|
|
276
|
public void setApiContactName(final String apiContactName) {
|
277
|
this.apiContactName = apiContactName;
|
278
|
}
|
279
|
|
280
|
public String getApiContactUrl() {
|
281
|
return apiContactUrl;
|
282
|
}
|
283
|
|
284
|
public void setApiContactUrl(final String apiContactUrl) {
|
285
|
this.apiContactUrl = apiContactUrl;
|
286
|
}
|
287
|
|
288
|
public String getApiContactEmail() {
|
289
|
return apiContactEmail;
|
290
|
}
|
291
|
|
292
|
public void setApiContactEmail(final String apiContactEmail) {
|
293
|
this.apiContactEmail = apiContactEmail;
|
294
|
}
|
295
|
}
|
296
|
|
297
|
public static class Vocabularies {
|
298
|
|
299
|
private String baseUrl;
|
300
|
|
301
|
private String countriesEndpoint;
|
302
|
|
303
|
private String datasourceTypologiesEndpoint;
|
304
|
|
305
|
public String getCountriesEndpoint() {
|
306
|
return countriesEndpoint;
|
307
|
}
|
308
|
|
309
|
public void setCountriesEndpoint(final String countriesEndpoint) {
|
310
|
this.countriesEndpoint = countriesEndpoint;
|
311
|
}
|
312
|
|
313
|
public String getBaseUrl() {
|
314
|
return baseUrl;
|
315
|
}
|
316
|
|
317
|
public void setBaseUrl(final String baseUrl) {
|
318
|
this.baseUrl = baseUrl;
|
319
|
}
|
320
|
|
321
|
public String getDatasourceTypologiesEndpoint() {
|
322
|
return datasourceTypologiesEndpoint;
|
323
|
}
|
324
|
|
325
|
public void setDatasourceTypologiesEndpoint(final String datasourceTypologiesEndpoint) {
|
326
|
this.datasourceTypologiesEndpoint = datasourceTypologiesEndpoint;
|
327
|
}
|
328
|
}
|
329
|
|
330
|
public ClassPathResource getFindSolrIndexUrl() {
|
331
|
return findSolrIndexUrl;
|
332
|
}
|
333
|
|
334
|
public void setFindSolrIndexUrl(final ClassPathResource findSolrIndexUrl) {
|
335
|
this.findSolrIndexUrl = findSolrIndexUrl;
|
336
|
}
|
337
|
|
338
|
public ClassPathResource getFindIndexDsInfo() {
|
339
|
return findIndexDsInfo;
|
340
|
}
|
341
|
|
342
|
public ClassPathResource getFindObjectStore() {
|
343
|
return findObjectStore;
|
344
|
}
|
345
|
|
346
|
public void setFindObjectStore(final ClassPathResource findObjectStore) {
|
347
|
this.findObjectStore = findObjectStore;
|
348
|
}
|
349
|
|
350
|
public void setFindIndexDsInfo(final ClassPathResource findIndexDsInfo) {
|
351
|
this.findIndexDsInfo = findIndexDsInfo;
|
352
|
}
|
353
|
|
354
|
public ClassPathResource getFindFunderContexts() {
|
355
|
return findFunderContexts;
|
356
|
}
|
357
|
|
358
|
public void setFindFunderContexts(final ClassPathResource findFunderContexts) {
|
359
|
this.findFunderContexts = findFunderContexts;
|
360
|
}
|
361
|
|
362
|
public ClassPathResource getUpdateRepoField() {
|
363
|
return updateRepoField;
|
364
|
}
|
365
|
|
366
|
public void setUpdateRepoField(final ClassPathResource updateRepoField) {
|
367
|
this.updateRepoField = updateRepoField;
|
368
|
}
|
369
|
|
370
|
public String getIsLookupUrl() {
|
371
|
return isLookupUrl;
|
372
|
}
|
373
|
|
374
|
public void setIsLookupUrl(final String isLookupUrl) {
|
375
|
this.isLookupUrl = isLookupUrl;
|
376
|
}
|
377
|
|
378
|
public String getObjectStoreServiceUrl() {
|
379
|
return objectStoreServiceUrl;
|
380
|
}
|
381
|
|
382
|
public void setObjectStoreServiceUrl(final String objectStoreServiceUrl) {
|
383
|
this.objectStoreServiceUrl = objectStoreServiceUrl;
|
384
|
}
|
385
|
|
386
|
public int getRequestWorkers() {
|
387
|
return requestWorkers;
|
388
|
}
|
389
|
|
390
|
public void setRequestWorkers(final int requestWorkers) {
|
391
|
this.requestWorkers = requestWorkers;
|
392
|
}
|
393
|
|
394
|
public int getRequestTimeout() {
|
395
|
return requestTimeout;
|
396
|
}
|
397
|
|
398
|
public void setRequestTimeout(final int requestTimeout) {
|
399
|
this.requestTimeout = requestTimeout;
|
400
|
}
|
401
|
|
402
|
public Datasource getDatasource() {
|
403
|
return datasource;
|
404
|
}
|
405
|
|
406
|
public void setDatasource(final Datasource datasource) {
|
407
|
this.datasource = datasource;
|
408
|
}
|
409
|
|
410
|
public Project getProject() {
|
411
|
return project;
|
412
|
}
|
413
|
|
414
|
public void setProject(final Project project) {
|
415
|
this.project = project;
|
416
|
}
|
417
|
|
418
|
public Jdbc getJdbc() {
|
419
|
return jdbc;
|
420
|
}
|
421
|
|
422
|
public void setJdbc(final Jdbc jdbc) {
|
423
|
this.jdbc = jdbc;
|
424
|
}
|
425
|
|
426
|
public Swagger getSwaggerDsm() {
|
427
|
return swaggerDsm;
|
428
|
}
|
429
|
|
430
|
public void setSwaggerDsm(final Swagger swaggerDsm) {
|
431
|
this.swaggerDsm = swaggerDsm;
|
432
|
}
|
433
|
|
434
|
public Swagger getSwaggerProjects() {
|
435
|
return swaggerProjects;
|
436
|
}
|
437
|
|
438
|
public void setSwaggerProjects(final Swagger swaggerProjects) {
|
439
|
this.swaggerProjects = swaggerProjects;
|
440
|
}
|
441
|
|
442
|
public Swagger getSwaggerFunders() {
|
443
|
return swaggerFunders;
|
444
|
}
|
445
|
|
446
|
public void setSwaggerFunders(final Swagger swaggerFunders) {
|
447
|
this.swaggerFunders = swaggerFunders;
|
448
|
}
|
449
|
|
450
|
public Vocabularies getVocabularies() {
|
451
|
return vocabularies;
|
452
|
}
|
453
|
|
454
|
public void setVocabularies(final Vocabularies vocabularies) {
|
455
|
this.vocabularies = vocabularies;
|
456
|
}
|
457
|
}
|