Project

General

Profile

« Previous | Next » 

Revision 62405

[maven-release-plugin] copy for tag dnet-datasource-manager-common-2.0.2

View differences:

modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
3
	<parent>
4
		<groupId>eu.dnetlib</groupId>
5
		<artifactId>dnet45-parent</artifactId>
6
		<version>1.0.0</version>
7
		<relativePath />
8
	</parent>
9
	<modelVersion>4.0.0</modelVersion>
10
	<groupId>eu.dnetlib</groupId>
11
	<artifactId>dnet-datasource-manager-common</artifactId>
12
	<packaging>jar</packaging>
13
	<version>2.0.2</version>
14
	<scm>
15
		<developerConnection>scm:svn:https://svn.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2</developerConnection>
16
	</scm>
17
	<dependencies>
18
		<dependency>
19
			<groupId>com.google.guava</groupId>
20
			<artifactId>guava</artifactId>
21
			<version>23.3-jre</version>
22
		</dependency>
23
		<dependency>
24
			<groupId>com.google.code.gson</groupId>
25
			<artifactId>gson</artifactId>
26
			<version>2.8.0</version>
27
		</dependency>
28
		<dependency>
29
			<groupId>javax.persistence</groupId>
30
			<artifactId>persistence-api</artifactId>
31
			<version>1.0</version>
32
		</dependency>
33

  
34
	</dependencies>
35
</project>
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/AggregationInfo.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public abstract class AggregationInfo {
4

  
5
	private int numberOfRecords;
6

  
7
	private String date;
8

  
9
	private AggregationStage aggregationStage;
10

  
11
	private boolean indexedVersion = false;
12

  
13
	private boolean completedSuccessfully = true;
14

  
15
	public AggregationInfo() {}
16

  
17
	public int getNumberOfRecords() {
18
		return numberOfRecords;
19
	}
20

  
21
	public void setNumberOfRecords(final int numberOfRecords) {
22
		this.numberOfRecords = numberOfRecords;
23
	}
24

  
25
	public String getDate() {
26
		return date;
27
	}
28

  
29
	public void setDate(final String date) {
30
		this.date = date;
31
	}
32

  
33
	public AggregationStage getAggregationStage() {
34
		return aggregationStage;
35
	}
36

  
37
	public void setAggregationStage(final AggregationStage aggregationStage) {
38
		this.aggregationStage = aggregationStage;
39
	}
40

  
41
	public boolean isIndexedVersion() {
42
		return indexedVersion;
43
	}
44

  
45
	public void setIndexedVersion(final boolean indexedVersion) {
46
		this.indexedVersion = indexedVersion;
47
	}
48

  
49
	public boolean isCompletedSuccessfully() {
50
		return completedSuccessfully;
51
	}
52

  
53
	public void setCompletedSuccessfully(final boolean completedSuccessfully) {
54
		this.completedSuccessfully = completedSuccessfully;
55
	}
56
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/Datasource.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.sql.Date;
4
import java.util.Set;
5

  
6
import javax.persistence.CascadeType;
7
import javax.persistence.Column;
8
import javax.persistence.FetchType;
9
import javax.persistence.Id;
10
import javax.persistence.JoinColumn;
11
import javax.persistence.JoinTable;
12
import javax.persistence.ManyToMany;
13
import javax.persistence.MappedSuperclass;
14
import javax.persistence.OneToMany;
15

  
16
import com.google.common.collect.Sets;
17

  
18
/**
19
 * Datasource
20
 */
21
@MappedSuperclass
22
public class Datasource<ORG extends Organization<?>, ID extends Identity, PIDSYSTEM extends PidSystem> {
23

  
24
	@Id
25
	protected String id;
26

  
27
	@Column(nullable = false)
28
	protected String officialname;
29
	protected String englishname;
30
	protected String websiteurl;
31
	protected String logourl;
32
	protected String contactemail;
33
	protected Double latitude;
34
	protected Double longitude;
35
	protected String timezone;
36
	protected String status;
37

  
38
	@Column(name = "namespaceprefix", columnDefinition = "bpchar(12)", nullable = false, updatable = false)
39
	protected String namespaceprefix;
40

  
41
	protected String languages;
42

  
43
	protected String collectedfrom;
44
	protected Date dateofvalidation;
45

  
46
	@Column(name = "eosc_datasource_type")
47
	protected String eoscDatasourceType;
48

  
49
	protected String provenanceaction;
50
	protected Date dateofcollection;
51
	protected String platform;
52

  
53
	@Column(name = "activationid")
54
	protected String activationId;
55
	protected String description;
56

  
57
	protected Date releasestartdate;
58
	protected Date releaseenddate;
59
	protected String missionstatementurl;
60

  
61
	protected String databaseaccesstype;
62
	protected String datauploadtype;
63
	protected String databaseaccessrestriction;
64
	protected String datauploadrestriction;
65

  
66
	protected String citationguidelineurl;
67

  
68
	@OneToMany(mappedBy = "id.service", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
69
	protected Set<PIDSYSTEM> pidsystems = Sets.newHashSet();
70

  
71
	protected String certificates;
72
	protected String aggregator;
73

  
74
	protected String issn;
75
	protected String eissn;
76
	protected String lissn;
77

  
78
	protected String registeredby;
79

  
80
	private Date registrationdate;
81

  
82
	protected String subjects;
83

  
84
	protected Boolean managed;
85

  
86
	@Column(name = "consenttermsofuse")
87
	protected Boolean consentTermsOfUse;
88

  
89
	@Column(name = "consenttermsofusedate")
90
	protected Date consentTermsOfUseDate;
91

  
92
	@Column(name = "lastconsenttermsofusedate")
93
	protected Date lastConsentTermsOfUseDate;
94

  
95
	@Column(name = "fulltextdownload")
96
	protected Boolean fullTextDownload;
97

  
98
	@ManyToMany(cascade = {
99
		CascadeType.PERSIST, CascadeType.MERGE
100
	}, fetch = FetchType.LAZY)
101
	@JoinTable(name = "dsm_service_organization", joinColumns = @JoinColumn(name = "service"), inverseJoinColumns = @JoinColumn(name = "organization"))
102
	protected Set<ORG> organizations;
103

  
104
	@ManyToMany(cascade = {
105
		CascadeType.PERSIST, CascadeType.MERGE
106
	}, fetch = FetchType.LAZY)
107
	@JoinTable(name = "dsm_servicepids", joinColumns = @JoinColumn(name = "service"), inverseJoinColumns = @JoinColumn(name = "pid"))
108
	protected Set<ID> identities;
109

  
110
	public Datasource() {}
111

  
112
	public String getId() {
113
		return id;
114
	}
115

  
116
	public String getOfficialname() {
117
		return officialname;
118
	}
119

  
120
	public String getEnglishname() {
121
		return englishname;
122
	}
123

  
124
	public String getWebsiteurl() {
125
		return websiteurl;
126
	}
127

  
128
	public String getLogourl() {
129
		return logourl;
130
	}
131

  
132
	public String getContactemail() {
133
		return contactemail;
134
	}
135

  
136
	public Double getLatitude() {
137
		return latitude;
138
	}
139

  
140
	public Double getLongitude() {
141
		return longitude;
142
	}
143

  
144
	public String getTimezone() {
145
		return timezone;
146
	}
147

  
148
	public String getNamespaceprefix() {
149
		return namespaceprefix;
150
	}
151

  
152
	public String getLanguages() {
153
		return languages;
154
	}
155

  
156
	public String getCollectedfrom() {
157
		return collectedfrom;
158
	}
159

  
160
	public Date getDateofvalidation() {
161
		return dateofvalidation;
162
	}
163

  
164
	public String getProvenanceaction() {
165
		return provenanceaction;
166
	}
167

  
168
	public Date getDateofcollection() {
169
		return dateofcollection;
170
	}
171

  
172
	public String getPlatform() {
173
		return platform;
174
	}
175

  
176
	public String getActivationId() {
177
		return activationId;
178
	}
179

  
180
	public String getDescription() {
181
		return description;
182
	}
183

  
184
	public Date getReleasestartdate() {
185
		return releasestartdate;
186
	}
187

  
188
	public Date getReleaseenddate() {
189
		return releaseenddate;
190
	}
191

  
192
	public String getMissionstatementurl() {
193
		return missionstatementurl;
194
	}
195

  
196
	public String getDatabaseaccesstype() {
197
		return databaseaccesstype;
198
	}
199

  
200
	public String getDatauploadtype() {
201
		return datauploadtype;
202
	}
203

  
204
	public String getDatabaseaccessrestriction() {
205
		return databaseaccessrestriction;
206
	}
207

  
208
	public String getDatauploadrestriction() {
209
		return datauploadrestriction;
210
	}
211

  
212
	public String getCitationguidelineurl() {
213
		return citationguidelineurl;
214
	}
215

  
216
	public Set<PIDSYSTEM> getPidsystems() {
217
		return pidsystems;
218
	}
219

  
220
	public String getCertificates() {
221
		return certificates;
222
	}
223

  
224
	public String getAggregator() {
225
		return aggregator;
226
	}
227

  
228
	public String getIssn() {
229
		return issn;
230
	}
231

  
232
	public String getEissn() {
233
		return eissn;
234
	}
235

  
236
	public String getLissn() {
237
		return lissn;
238
	}
239

  
240
	public String getRegisteredby() {
241
		return registeredby;
242
	}
243

  
244
	public Date getRegistrationdate() {
245
		return registrationdate;
246
	}
247

  
248
	public String getSubjects() {
249
		return subjects;
250
	}
251

  
252
	public Boolean getManaged() {
253
		return managed;
254
	}
255

  
256
	public Boolean getConsentTermsOfUse() {
257
		return consentTermsOfUse;
258
	}
259

  
260
	public Date getConsentTermsOfUseDate() {
261
		return consentTermsOfUseDate;
262
	}
263

  
264
	public Boolean getFullTextDownload() {
265
		return fullTextDownload;
266
	}
267

  
268
	public Set<ORG> getOrganizations() {
269
		return organizations;
270
	}
271

  
272
	public Set<ID> getIdentities() {
273
		return identities;
274
	}
275

  
276
	public Datasource<ORG, ID, PIDSYSTEM> setId(final String id) {
277
		this.id = id;
278
		return this;
279
	}
280

  
281
	public Datasource<ORG, ID, PIDSYSTEM> setOfficialname(final String officialname) {
282
		this.officialname = officialname;
283
		return this;
284
	}
285

  
286
	public Datasource<ORG, ID, PIDSYSTEM> setEnglishname(final String englishname) {
287
		this.englishname = englishname;
288
		return this;
289
	}
290

  
291
	public Datasource<ORG, ID, PIDSYSTEM> setWebsiteurl(final String websiteurl) {
292
		this.websiteurl = websiteurl;
293
		return this;
294
	}
295

  
296
	public Datasource<ORG, ID, PIDSYSTEM> setLogourl(final String logourl) {
297
		this.logourl = logourl;
298
		return this;
299
	}
300

  
301
	public Datasource<ORG, ID, PIDSYSTEM> setContactemail(final String contactemail) {
302
		this.contactemail = contactemail;
303
		return this;
304
	}
305

  
306
	public Datasource<ORG, ID, PIDSYSTEM> setLatitude(final Double latitude) {
307
		this.latitude = latitude;
308
		return this;
309
	}
310

  
311
	public Datasource<ORG, ID, PIDSYSTEM> setLongitude(final Double longitude) {
312
		this.longitude = longitude;
313
		return this;
314
	}
315

  
316
	public Datasource<ORG, ID, PIDSYSTEM> setTimezone(final String timezone) {
317
		this.timezone = timezone;
318
		return this;
319
	}
320

  
321
	public Datasource<ORG, ID, PIDSYSTEM> setNamespaceprefix(final String namespaceprefix) {
322
		this.namespaceprefix = namespaceprefix;
323
		return this;
324
	}
325

  
326
	public Datasource<ORG, ID, PIDSYSTEM> setLanguages(final String languages) {
327
		this.languages = languages;
328
		return this;
329
	}
330

  
331
	public Datasource<ORG, ID, PIDSYSTEM> setCollectedfrom(final String collectedfrom) {
332
		this.collectedfrom = collectedfrom;
333
		return this;
334
	}
335

  
336
	public Datasource<ORG, ID, PIDSYSTEM> setDateofvalidation(final Date dateofvalidation) {
337
		this.dateofvalidation = dateofvalidation;
338
		return this;
339
	}
340

  
341
	public Datasource<ORG, ID, PIDSYSTEM> setProvenanceaction(final String provenanceaction) {
342
		this.provenanceaction = provenanceaction;
343
		return this;
344
	}
345

  
346
	public Datasource<ORG, ID, PIDSYSTEM> setDateofcollection(final Date dateofcollection) {
347
		this.dateofcollection = dateofcollection;
348
		return this;
349
	}
350

  
351
	public Datasource<ORG, ID, PIDSYSTEM> setPlatform(final String platform) {
352
		this.platform = platform;
353
		return this;
354
	}
355

  
356
	public Datasource<ORG, ID, PIDSYSTEM> setActivationId(final String activationId) {
357
		this.activationId = activationId;
358
		return this;
359
	}
360

  
361
	public Datasource<ORG, ID, PIDSYSTEM> setDescription(final String description) {
362
		this.description = description;
363
		return this;
364
	}
365

  
366
	public Datasource<ORG, ID, PIDSYSTEM> setReleasestartdate(final Date releasestartdate) {
367
		this.releasestartdate = releasestartdate;
368
		return this;
369
	}
370

  
371
	public Datasource<ORG, ID, PIDSYSTEM> setReleaseenddate(final Date releaseenddate) {
372
		this.releaseenddate = releaseenddate;
373
		return this;
374
	}
375

  
376
	public Datasource<ORG, ID, PIDSYSTEM> setMissionstatementurl(final String missionstatementurl) {
377
		this.missionstatementurl = missionstatementurl;
378
		return this;
379
	}
380

  
381
	public Datasource<ORG, ID, PIDSYSTEM> setDatabaseaccesstype(final String databaseaccesstype) {
382
		this.databaseaccesstype = databaseaccesstype;
383
		return this;
384
	}
385

  
386
	public Datasource<ORG, ID, PIDSYSTEM> setDatauploadtype(final String datauploadtype) {
387
		this.datauploadtype = datauploadtype;
388
		return this;
389
	}
390

  
391
	public Datasource<ORG, ID, PIDSYSTEM> setDatabaseaccessrestriction(final String databaseaccessrestriction) {
392
		this.databaseaccessrestriction = databaseaccessrestriction;
393
		return this;
394
	}
395

  
396
	public Datasource<ORG, ID, PIDSYSTEM> setDatauploadrestriction(final String datauploadrestriction) {
397
		this.datauploadrestriction = datauploadrestriction;
398
		return this;
399
	}
400

  
401
	public Datasource<ORG, ID, PIDSYSTEM> setCitationguidelineurl(final String citationguidelineurl) {
402
		this.citationguidelineurl = citationguidelineurl;
403
		return this;
404
	}
405

  
406
	public Datasource<ORG, ID, PIDSYSTEM> setPidsystems(final Set<PIDSYSTEM> pidsystems) {
407
		this.pidsystems = pidsystems;
408
		return this;
409
	}
410

  
411
	public Datasource<ORG, ID, PIDSYSTEM> setCertificates(final String certificates) {
412
		this.certificates = certificates;
413
		return this;
414
	}
415

  
416
	public Datasource<ORG, ID, PIDSYSTEM> setAggregator(final String aggregator) {
417
		this.aggregator = aggregator;
418
		return this;
419
	}
420

  
421
	public Datasource<ORG, ID, PIDSYSTEM> setIssn(final String issn) {
422
		this.issn = issn;
423
		return this;
424
	}
425

  
426
	public Datasource<ORG, ID, PIDSYSTEM> setEissn(final String eissn) {
427
		this.eissn = eissn;
428
		return this;
429
	}
430

  
431
	public Datasource<ORG, ID, PIDSYSTEM> setLissn(final String lissn) {
432
		this.lissn = lissn;
433
		return this;
434
	}
435

  
436
	public Datasource<ORG, ID, PIDSYSTEM> setRegisteredby(final String registeredby) {
437
		this.registeredby = registeredby;
438
		return this;
439
	}
440

  
441
	public Datasource<ORG, ID, PIDSYSTEM> setRegistrationdate(final Date registrationdate) {
442
		this.registrationdate = registrationdate;
443
		return this;
444
	}
445

  
446
	public Datasource<ORG, ID, PIDSYSTEM> setSubjects(final String subjects) {
447
		this.subjects = subjects;
448
		return this;
449
	}
450

  
451
	public Datasource<ORG, ID, PIDSYSTEM> setManaged(final Boolean managed) {
452
		this.managed = managed;
453
		return this;
454
	}
455

  
456
	public void setConsentTermsOfUse(final Boolean consentTermsOfUse) {
457
		this.consentTermsOfUse = consentTermsOfUse;
458
	}
459

  
460
	public Datasource<ORG, ID, PIDSYSTEM> setConsentTermsOfUseDate(final Date consentTermsOfUseDate) {
461
		this.consentTermsOfUseDate = consentTermsOfUseDate;
462
		return this;
463
	}
464

  
465
	public void setFullTextDownload(final Boolean fullTextDownload) {
466
		this.fullTextDownload = fullTextDownload;
467
	}
468

  
469
	public Datasource<ORG, ID, PIDSYSTEM> setOrganizations(final Set<ORG> organizations) {
470
		this.organizations = organizations;
471
		return this;
472
	}
473

  
474
	public Datasource<ORG, ID, PIDSYSTEM> setIdentities(final Set<ID> identities) {
475
		this.identities = identities;
476
		return this;
477
	}
478

  
479
	public String getEoscDatasourceType() {
480
		return eoscDatasourceType;
481
	}
482

  
483
	public Datasource<ORG, ID, PIDSYSTEM> setEoscDatasourceType(final String eoscDatasourceType) {
484
		this.eoscDatasourceType = eoscDatasourceType;
485
		return this;
486
	}
487

  
488
	public String getStatus() {
489
		return status;
490
	}
491

  
492
	public Datasource<ORG, ID, PIDSYSTEM> setStatus(final String status) {
493
		this.status = status;
494
		return this;
495
	}
496

  
497
	public Date getLastConsentTermsOfUseDate() {
498
		return lastConsentTermsOfUseDate;
499
	}
500

  
501
	public Datasource<ORG, ID, PIDSYSTEM> setLastConsentTermsOfUseDate(final Date lastConsentTermsOfUseDate) {
502
		this.lastConsentTermsOfUseDate = lastConsentTermsOfUseDate;
503
		return this;
504
	}
505

  
506
}
0 507

  
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/Api.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.sql.Timestamp;
4
import java.util.Objects;
5
import java.util.Set;
6

  
7
import javax.persistence.CascadeType;
8
import javax.persistence.Column;
9
import javax.persistence.FetchType;
10
import javax.persistence.Id;
11
import javax.persistence.MappedSuperclass;
12
import javax.persistence.OneToMany;
13
import javax.persistence.Transient;
14

  
15
import com.google.common.collect.ComparisonChain;
16
import com.google.common.collect.Sets;
17
import com.google.gson.Gson;
18

  
19
/**
20
 * Api
21
 */
22
@MappedSuperclass
23
public class Api<AP extends ApiParam> implements Comparable<Api<AP>> {
24

  
25
	@Id
26
	protected String id = null;
27
	protected String protocol = null;
28

  
29
	@Column(name = "service")
30
	protected String datasource = null;
31

  
32
	protected String contentdescription = null;
33
	protected Boolean active = false;
34
	protected Boolean removable = true;
35
	protected String compatibility;
36

  
37
	@Transient
38
	protected boolean compatibilityOverrided = false;
39

  
40
	@Column(name = "metadata_identifier_path")
41
	protected String metadataIdentifierPath;
42

  
43
	@Column(name = "last_collection_total")
44
	protected Integer lastCollectionTotal;
45

  
46
	@Column(name = "last_collection_date")
47
	protected Timestamp lastCollectionDate;
48

  
49
	@Column(name = "last_collection_mdid")
50
	protected String lastCollectionMdid;
51

  
52
	@Column(name = "last_aggregation_total")
53
	protected Integer lastAggregationTotal;
54

  
55
	@Column(name = "last_aggregation_date")
56
	protected Timestamp lastAggregationDate;
57

  
58
	@Column(name = "last_aggregation_mdid")
59
	protected String lastAggregationMdid;
60

  
61
	@Column(name = "last_download_total")
62
	protected Integer lastDownloadTotal;
63

  
64
	@Column(name = "last_download_date")
65
	protected Timestamp lastDownloadDate;
66

  
67
	@Column(name = "last_download_objid")
68
	protected String lastDownloadObjid;
69

  
70
	@Column(name = "last_validation_job")
71
	protected String lastValidationJob;
72
	protected String baseurl = null;
73

  
74
	@OneToMany(mappedBy = "id.api", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
75
	protected Set<AP> apiParams = Sets.newHashSet();
76

  
77
	public Api() {}
78

  
79
	public String getId() {
80
		return id;
81
	}
82

  
83
	public String getProtocol() {
84
		return protocol;
85
	}
86

  
87
	public String getDatasource() {
88
		return datasource;
89
	}
90

  
91
	public String getContentdescription() {
92
		return contentdescription;
93
	}
94

  
95
	public Boolean getActive() {
96
		return active;
97
	}
98

  
99
	public Boolean getRemovable() {
100
		return removable;
101
	}
102

  
103
	public String getCompatibility() {
104
		return compatibility;
105
	}
106

  
107
	public boolean isCompatibilityOverrided() {
108
		return compatibilityOverrided;
109
	}
110

  
111
	public String getMetadataIdentifierPath() {
112
		return metadataIdentifierPath;
113
	}
114

  
115
	public Integer getLastCollectionTotal() {
116
		return lastCollectionTotal;
117
	}
118

  
119
	public Timestamp getLastCollectionDate() {
120
		return lastCollectionDate;
121
	}
122

  
123
	public String getLastCollectionMdid() {
124
		return lastCollectionMdid;
125
	}
126

  
127
	public Integer getLastAggregationTotal() {
128
		return lastAggregationTotal;
129
	}
130

  
131
	public Timestamp getLastAggregationDate() {
132
		return lastAggregationDate;
133
	}
134

  
135
	public String getLastAggregationMdid() {
136
		return lastAggregationMdid;
137
	}
138

  
139
	public Integer getLastDownloadTotal() {
140
		return lastDownloadTotal;
141
	}
142

  
143
	public Timestamp getLastDownloadDate() {
144
		return lastDownloadDate;
145
	}
146

  
147
	public String getLastDownloadObjid() {
148
		return lastDownloadObjid;
149
	}
150

  
151
	public String getLastValidationJob() {
152
		return lastValidationJob;
153
	}
154

  
155
	public String getBaseurl() {
156
		return baseurl;
157
	}
158

  
159
	public Set<AP> getApiParams() {
160
		return apiParams;
161
	}
162

  
163
	public Api<AP> setId(final String id) {
164
		this.id = id;
165
		return this;
166
	}
167

  
168
	public Api<AP> setProtocol(final String protocol) {
169
		this.protocol = protocol;
170
		return this;
171
	}
172

  
173
	public Api<AP> setDatasource(final String datasource) {
174
		this.datasource = datasource;
175
		return this;
176
	}
177

  
178
	public Api<AP> setContentdescription(final String contentdescription) {
179
		this.contentdescription = contentdescription;
180
		return this;
181
	}
182

  
183
	public Api<AP> setActive(final Boolean active) {
184
		this.active = active;
185
		return this;
186
	}
187

  
188
	public Api<AP> setRemovable(final Boolean removable) {
189
		this.removable = removable;
190
		return this;
191
	}
192

  
193
	public Api<AP> setCompatibility(final String compatibility) {
194
		this.compatibility = compatibility;
195
		return this;
196
	}
197

  
198
	public Api<AP> setCompatibilityOverrided(final boolean compatibilityOverrided) {
199
		this.compatibilityOverrided = compatibilityOverrided;
200
		return this;
201
	}
202

  
203
	public Api<AP> setMetadataIdentifierPath(final String metadataIdentifierPath) {
204
		this.metadataIdentifierPath = metadataIdentifierPath;
205
		return this;
206
	}
207

  
208
	public Api<AP> setLastCollectionTotal(final Integer lastCollectionTotal) {
209
		this.lastCollectionTotal = lastCollectionTotal;
210
		return this;
211
	}
212

  
213
	public Api<AP> setLastCollectionDate(final Timestamp lastCollectionDate) {
214
		this.lastCollectionDate = lastCollectionDate;
215
		return this;
216
	}
217

  
218
	public Api<AP> setLastCollectionMdid(final String lastCollectionMdid) {
219
		this.lastCollectionMdid = lastCollectionMdid;
220
		return this;
221
	}
222

  
223
	public Api<AP> setLastAggregationTotal(final Integer lastAggregationTotal) {
224
		this.lastAggregationTotal = lastAggregationTotal;
225
		return this;
226
	}
227

  
228
	public Api<AP> setLastAggregationDate(final Timestamp lastAggregationDate) {
229
		this.lastAggregationDate = lastAggregationDate;
230
		return this;
231
	}
232

  
233
	public Api<AP> setLastAggregationMdid(final String lastAggregationMdid) {
234
		this.lastAggregationMdid = lastAggregationMdid;
235
		return this;
236
	}
237

  
238
	public Api<AP> setLastDownloadTotal(final Integer lastDownloadTotal) {
239
		this.lastDownloadTotal = lastDownloadTotal;
240
		return this;
241
	}
242

  
243
	public Api<AP> setLastDownloadDate(final Timestamp lastDownloadDate) {
244
		this.lastDownloadDate = lastDownloadDate;
245
		return this;
246
	}
247

  
248
	public Api<AP> setLastDownloadObjid(final String lastDownloadObjid) {
249
		this.lastDownloadObjid = lastDownloadObjid;
250
		return this;
251
	}
252

  
253
	public Api<AP> setLastValidationJob(final String lastValidationJob) {
254
		this.lastValidationJob = lastValidationJob;
255
		return this;
256
	}
257

  
258
	public Api<AP> setBaseurl(final String baseurl) {
259
		this.baseurl = baseurl;
260
		return this;
261
	}
262

  
263
	public Api<AP> setApiParams(final Set<AP> apiParams) {
264
		this.apiParams = apiParams;
265
		return this;
266
	}
267

  
268
	@Override
269
	public boolean equals(final Object o) {
270
		if (this == o) { return true; }
271
		if (o == null || getClass() != o.getClass()) { return false; }
272
		final Api<?> api = (Api<?>) o;
273
		return Objects.equals(this.id, api.id);
274
	}
275

  
276
	/*
277
	 * (non-Javadoc)
278
	 *
279
	 * @see eu.dnetlib.openaire.exporter.model.datasource.db.ApiInterface#hashCode()
280
	 */
281

  
282
	@Override
283
	public int hashCode() {
284
		return Objects.hash(id);
285
	}
286

  
287
	@Override
288
	public String toString() {
289
		return new Gson().toJson(this);
290
	}
291

  
292
	@Override
293
	public int compareTo(final Api<AP> a) {
294
		return ComparisonChain.start()
295
			.compare(getId(), a.getId())
296
			.result();
297
	}
298

  
299
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/DatasourceManagerCommon.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.util.List;
4

  
5
public interface DatasourceManagerCommon<DS extends Datasource<?, ?, ?>, API extends Api<?>> {
6

  
7
	DS getDs(String id) throws DsmException;
8

  
9
	DS getDsByNsPrefix(String prefix) throws DsmException;
10

  
11
	List<? extends API> getApis(String dsId) throws DsmException;
12

  
13
	void deleteDs(String dsId) throws DsmException;
14

  
15
	void deleteApi(String dsId, String apiId) throws DsmForbiddenException, DsmNotFoundException;
16

  
17
	void addApi(API api) throws DsmException;
18

  
19
	void setManaged(String id, boolean managed) throws DsmException;
20

  
21
	boolean isManaged(String id) throws DsmException;
22

  
23
	void saveDs(DS datasource) throws DsmException;
24

  
25
	void updateCompliance(String dsId, String apiId, String compliance, boolean override) throws DsmException;
26

  
27
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/LocalDatasourceManager.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.util.Date;
4
import java.util.List;
5
import java.util.Map;
6
import java.util.Set;
7

  
8
public interface LocalDatasourceManager<DS extends Datasource<?, ?, ?>, API extends Api<?>> extends DatasourceManagerCommon<DS, API> {
9

  
10
	Set<String> listManagedDatasourceIds() throws DsmRuntimeException;
11

  
12
	List<SimpleDatasource> searchDatasourcesByType(String type) throws DsmException;
13

  
14
	List<? extends SearchApisEntry> searchApis(String field, Object value) throws DsmException;
15

  
16
	List<? extends BrowsableField> listBrowsableFields() throws DsmException;
17

  
18
	List<? extends BrowseTerm> browseField(String field) throws DsmException;
19

  
20
	void setActive(String dsId, String apiId, boolean active) throws DsmException;
21

  
22
	boolean isActive(String dsId, String apiId) throws DsmException;
23

  
24
	void setLastCollectionInfo(String dsId, String apiId, String mdId, Integer size, Date date) throws DsmException;
25

  
26
	void setLastAggregationInfo(String dsId, String apiId, String mdId, Integer size, Date date) throws DsmException;
27

  
28
	void setLastDownloadInfo(String dsId, String apiId, String objId, Integer size, Date date) throws DsmException;
29

  
30
	void setLastValidationJob(String dsId, String apiId, String jobId) throws DsmException;
31

  
32
	void updateApiDetails(String dsId, String apiId, String metadataIdentifierPath, String baseUrl, Map<String, String> params) throws DsmException;
33

  
34
	boolean isRemovable(String dsId, String apiId) throws DsmException;
35

  
36
	void regenerateProfiles() throws DsmException;
37

  
38
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/Organization.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.sql.Date;
4
import java.util.Set;
5

  
6
import javax.persistence.CascadeType;
7
import javax.persistence.FetchType;
8
import javax.persistence.Id;
9
import javax.persistence.ManyToMany;
10
import javax.persistence.MappedSuperclass;
11

  
12
@MappedSuperclass
13
public class Organization<DS extends Datasource<?, ?, ?>> {
14

  
15
	@Id
16
	protected String id;
17
	protected String legalshortname;
18
	protected String legalname;
19
	protected String websiteurl;
20
	protected String logourl;
21

  
22
	protected String country;
23
	protected String collectedfrom;
24

  
25
	protected Date dateofcollection;
26
	protected String provenanceaction;
27

  
28
	@ManyToMany(cascade = {
29
		CascadeType.PERSIST, CascadeType.MERGE
30
	}, fetch = FetchType.EAGER, mappedBy = "organizations")
31
	protected Set<DS> datasources;
32

  
33
	public Organization() {}
34

  
35
	public String getId() {
36
		return id;
37
	}
38

  
39
	public String getLegalshortname() {
40
		return legalshortname;
41
	}
42

  
43
	public String getLegalname() {
44
		return legalname;
45
	}
46

  
47
	public String getWebsiteurl() {
48
		return websiteurl;
49
	}
50

  
51
	public String getLogourl() {
52
		return logourl;
53
	}
54

  
55
	public String getCountry() {
56
		return country;
57
	}
58

  
59
	public String getCollectedfrom() {
60
		return collectedfrom;
61
	}
62

  
63
	public Date getDateofcollection() {
64
		return dateofcollection;
65
	}
66

  
67
	public String getProvenanceaction() {
68
		return provenanceaction;
69
	}
70

  
71
	public Organization<DS> setId(final String id) {
72
		this.id = id;
73
		return this;
74
	}
75

  
76
	public Organization<DS> setLegalshortname(final String legalshortname) {
77
		this.legalshortname = legalshortname;
78
		return this;
79
	}
80

  
81
	public Organization<DS> setLegalname(final String legalname) {
82
		this.legalname = legalname;
83
		return this;
84
	}
85

  
86
	public Organization<DS> setWebsiteurl(final String websiteurl) {
87
		this.websiteurl = websiteurl;
88
		return this;
89
	}
90

  
91
	public Organization<DS> setLogourl(final String logourl) {
92
		this.logourl = logourl;
93
		return this;
94
	}
95

  
96
	public Organization<DS> setCountry(final String country) {
97
		this.country = country;
98
		return this;
99
	}
100

  
101
	public Organization<DS> setCollectedfrom(final String collectedfrom) {
102
		this.collectedfrom = collectedfrom;
103
		return this;
104
	}
105

  
106
	public Organization<DS> setDateofcollection(final Date dateofcollection) {
107
		this.dateofcollection = dateofcollection;
108
		return this;
109
	}
110

  
111
	public Organization<DS> setProvenanceaction(final String provenanceaction) {
112
		this.provenanceaction = provenanceaction;
113
		return this;
114
	}
115

  
116
	public Set<DS> getDatasources() {
117
		return datasources;
118
	}
119

  
120
	public void setDatasources(final Set<DS> datasources) {
121
		this.datasources = datasources;
122
	}
123

  
124
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/PidSystem.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public interface PidSystem {
4

  
5
	String getType();
6

  
7
	void setType(String type);
8

  
9
	String getScheme();
10

  
11
	void setScheme(String scheme);
12

  
13
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/SimpleDatasource.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.util.HashSet;
4
import java.util.Set;
5

  
6
public class SimpleDatasource implements Comparable<SimpleDatasource> {
7

  
8
	private String id;
9
	private String name;
10
	private String eoscDatasourceType;
11
	private String origId;
12
	private Set<String> apis = new HashSet<>();
13
	private boolean valid;
14

  
15
	public String getId() {
16
		return id;
17
	}
18

  
19
	public void setId(final String id) {
20
		this.id = id;
21
	}
22

  
23
	public String getName() {
24
		return name;
25
	}
26

  
27
	public void setName(final String name) {
28
		this.name = name;
29
	}
30

  
31
	public boolean isValid() {
32
		return valid;
33
	}
34

  
35
	public void setValid(final boolean valid) {
36
		this.valid = valid;
37
	}
38

  
39
	public String getEoscDatasourceType() {
40
		return eoscDatasourceType;
41
	}
42

  
43
	public void setEoscDatasourceType(final String eoscDatasourceType) {
44
		this.eoscDatasourceType = eoscDatasourceType;
45
	}
46

  
47
	public String getOrigId() {
48
		return origId;
49
	}
50

  
51
	public void setOrigId(final String origId) {
52
		this.origId = origId;
53
	}
54

  
55
	public Set<String> getApis() {
56
		return apis;
57
	}
58

  
59
	public void setApis(final Set<String> apis) {
60
		this.apis = apis;
61
	}
62

  
63
	@Override
64
	public int compareTo(final SimpleDatasource e) {
65
		return getName().compareTo(e.getName());
66
	}
67

  
68
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/DsmNotFoundException.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class DsmNotFoundException extends DsmException {
4

  
5
	public DsmNotFoundException(int code, String msg) {
6
		super(code, msg);
7
	}
8

  
9
	public DsmNotFoundException(int code, Throwable e) {
10
		super(code, e);
11
	}
12

  
13
	public DsmNotFoundException(int code, String msg, Throwable e) {
14
		super(code, msg, e);
15
	}
16

  
17
	public DsmNotFoundException(String msg) {
18
		this(404, msg);
19
	}
20

  
21
}
0 22

  
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/DsmForbiddenException.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class DsmForbiddenException extends DsmException {
4

  
5
	public DsmForbiddenException(int code, String msg) {
6
		super(code, msg);
7
	}
8

  
9
	public DsmForbiddenException(int code, Throwable e) {
10
		super(code, e);
11
	}
12

  
13
	public DsmForbiddenException(int code, String msg, Throwable e) {
14
		super(code, msg, e);
15
	}
16

  
17
	public DsmForbiddenException(String msg) {
18
		this(403, msg);
19
	}
20

  
21
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/AggregationStage.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
/**
4
 * Created by claudio on 12/09/16.
5
 */
6
public enum AggregationStage {
7
	COLLECT, TRANSFORM;
8

  
9
	public static AggregationStage parse(final String s) {
10
		switch (s) {
11
			case "collect":
12
			case "collection":
13
			case "COLLECT":
14
			case "COLLECTION":
15
				return AggregationStage.COLLECT;
16
			case "transform":
17
			case "transformation":
18
			case "TRANSFORM":
19
			case "TRANSFORMATION":
20
			case "transformDatasets":
21
			case "transformPublications":
22
				return AggregationStage.TRANSFORM;
23
		}
24
		throw new IllegalArgumentException("invalid AggregationStage: " + s);
25
	}
26
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/DsmException.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class DsmException extends Exception {
4

  
5
	/**
6
	 * 
7
	 */
8
	private static final long serialVersionUID = 8980196353591772127L;
9

  
10
	private int code;
11

  
12
	public DsmException(int code, String msg) {
13
		super(msg);
14
		this.code = code;
15
	}
16

  
17
	public DsmException(int code, Throwable e) {
18
		super(e);
19
		this.code = code;
20
	}
21

  
22
	public DsmException(int code, String msg, Throwable e) {
23
		super(msg, e);
24
		this.code = code;
25
	}
26

  
27
	public DsmException(String msg) {
28
		this(500, msg);
29
	}
30

  
31
	public int getCode() {
32
		return code;
33
	}
34

  
35
	public void setCode(final int code) {
36
		this.code = code;
37
	}
38
}
0 39

  
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/DsmRuntimeException.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class DsmRuntimeException extends RuntimeException {
4

  
5
	/**
6
	 *
7
	 */
8
	private static final long serialVersionUID = 8980196353591772127L;
9

  
10
	public DsmRuntimeException(String msg) {
11
		super(msg);
12
	}
13

  
14
	public DsmRuntimeException(String msg, Throwable e) {
15
		super(msg, e);
16
	}
17

  
18
	public DsmRuntimeException(Throwable e) {
19
		super(e);
20
	}
21

  
22
}
0 23

  
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/ApiParamImpl.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class ApiParamImpl implements ApiParam {
4

  
5
	private String param;
6
	private String value;
7

  
8
	@Override
9
	public String getParam() {
10
		return param;
11
	}
12

  
13
	@Override
14
	public void setParam(final String param) {
15
		this.param = param;
16
	}
17

  
18
	@Override
19
	public String getValue() {
20
		return value;
21
	}
22

  
23
	@Override
24
	public void setValue(final String value) {
25
		this.value = value;
26
	}
27
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/ApiParam.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public interface ApiParam {
4

  
5
	String getValue();
6

  
7
	void setValue(String value);
8

  
9
	String getParam();
10

  
11
	void setParam(String param);
12

  
13
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/BrowseTermImpl.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class BrowseTermImpl implements BrowseTerm {
4

  
5
	private String term;
6
	private long total;
7

  
8
	public BrowseTermImpl() {}
9

  
10
	public BrowseTermImpl(final String term, final int total) {
11
		this.term = term;
12
		this.total = total;
13
	}
14

  
15
	public String getTerm() {
16
		return term;
17
	}
18

  
19
	public void setTerm(final String term) {
20
		this.term = term;
21
	}
22

  
23
	public long getTotal() {
24
		return total;
25
	}
26

  
27
	public void setTotal(final long total) {
28
		this.total = total;
29
	}
30
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/BrowseTerm.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public interface BrowseTerm {
4

  
5
	String getTerm();
6

  
7
	void setTerm(String term);
8

  
9
	long getTotal();
10

  
11
	void setTotal(long total);
12

  
13
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-2.0.2/src/main/java/eu/dnetlib/enabling/datasources/common/ApiParamKey.java
1
package eu.dnetlib.enabling.datasources.common;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff