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