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