Project

General

Profile

« Previous | Next » 

Revision 55597

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

View differences:

modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/dnet-datasource-manager-common.iml
1
<?xml version="1.0" encoding="UTF-8"?>
2
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
3
  <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
4
    <output url="file://$MODULE_DIR$/target/classes" />
5
    <output-test url="file://$MODULE_DIR$/target/test-classes" />
6
    <content url="file://$MODULE_DIR$">
7
      <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
8
      <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
9
      <excludeFolder url="file://$MODULE_DIR$/target" />
10
    </content>
11
    <orderEntry type="inheritedJdk" />
12
    <orderEntry type="sourceFolder" forTests="false" />
13
    <orderEntry type="library" name="Maven: com.google.guava:guava:23.3-jre" level="project" />
14
    <orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:1.3.9" level="project" />
15
    <orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.0.18" level="project" />
16
    <orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.1" level="project" />
17
    <orderEntry type="library" name="Maven: org.codehaus.mojo:animal-sniffer-annotations:1.14" level="project" />
18
    <orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.0" level="project" />
19
    <orderEntry type="library" name="Maven: javax.persistence:persistence-api:1.0" level="project" />
20
    <orderEntry type="library" name="Maven: log4j:log4j:1.2.17" level="project" />
21
  </component>
22
</module>
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/deploy.info
1
{"type_source": "SVN", "goal": "package -U -T 4C source:jar", "url": "http://svn-public.driver.research-infrastructures.eu/driver/dnet45/modules/dnet-datasource-manager-common/trunk/", "deploy_repository": "dnet45-snapshots", "version": "4", "mail": "sandro.labruzzo@isti.cnr.it,michele.artini@isti.cnr.it, claudio.atzori@isti.cnr.it, alessia.bardi@isti.cnr.it", "deploy_repository_url": "http://maven.research-infrastructures.eu/nexus/content/repositories/dnet45-snapshots", "name": "dnet-datasource-manager-common"}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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-1.0.6/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-1.0.6/src/main/java/eu/dnetlib/enabling/datasources/common/ApiParamKey.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import java.io.Serializable;
4
import java.util.Objects;
5

  
6
import javax.persistence.Embeddable;
7
import javax.persistence.JoinColumn;
8
import javax.persistence.ManyToOne;
9
import javax.persistence.MappedSuperclass;
10

  
11
import com.google.common.collect.ComparisonChain;
12

  
13
/**
14
 * Created by claudio on 13/04/2017.
15
 */
16
@Embeddable
17
@MappedSuperclass
18
public class ApiParamKey<A extends Api> implements Serializable {
19

  
20
	/**
21
	 * 
22
	 */
23
	protected static final long serialVersionUID = 1640636806392015938L;
24

  
25
	@ManyToOne
26
	@JoinColumn(name = "api")
27
	protected A api = null;
28

  
29
	protected String param;
30

  
31
	public ApiParamKey() {}
32

  
33
	public String getParam() {
34
		return param;
35
	}
36

  
37
	public ApiParamKey setParam(final String param) {
38
		this.param = param;
39
		return this;
40
	}
41

  
42
	public A getApi() {
43
		return api;
44
	}
45

  
46
	public void setApi(final A api) {
47
		this.api = api;
48
	}
49

  
50
	public int hashCode() {
51
		return Objects.hash(getParam(), getApi().getId());
52
	}
53

  
54
	@Override
55
	public boolean equals(final Object o) {
56
		if (this == o) { return true; }
57
		if (o == null || getClass() != o.getClass()) { return false; }
58
		ApiParamKey apk = (ApiParamKey) o;
59
		return ComparisonChain.start()
60
				.compare(getParam(), apk.getParam())
61
				.compare(getApi(), apk.getApi())
62
				.result() == 0;
63
	}
64

  
65
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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
	public AggregationInfo() {}
14

  
15
	public int getNumberOfRecords() {
16
		return numberOfRecords;
17
	}
18

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

  
23
	public String getDate() {
24
		return date;
25
	}
26

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

  
31
	public AggregationStage getAggregationStage() {
32
		return aggregationStage;
33
	}
34

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

  
39
	public boolean isIndexedVersion() {
40
		return indexedVersion;
41
	}
42

  
43
	public void setIndexedVersion(final boolean indexedVersion) {
44
		this.indexedVersion = indexedVersion;
45
	}
46
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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
import javax.persistence.*;
6

  
7
@MappedSuperclass
8
public class Organization<DS extends Datasource<?, ?>> {
9

  
10
	@Id
11
	protected String id;
12
	protected String legalshortname;
13
	protected String legalname;
14
	protected String websiteurl;
15
	protected String logourl;
16

  
17
	protected String country;
18
	protected String collectedfrom;
19

  
20
	protected Date dateofcollection;
21
	protected String provenanceaction;
22

  
23
	@ManyToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, fetch = FetchType.EAGER, mappedBy = "organizations")
24
	protected Set<DS> datasources;
25

  
26
	public Organization() {}
27

  
28
	public String getId() {
29
		return id;
30
	}
31

  
32
	public String getLegalshortname() {
33
		return legalshortname;
34
	}
35

  
36
	public String getLegalname() {
37
		return legalname;
38
	}
39

  
40
	public String getWebsiteurl() {
41
		return websiteurl;
42
	}
43

  
44
	public String getLogourl() {
45
		return logourl;
46
	}
47

  
48
	public String getCountry() {
49
		return country;
50
	}
51

  
52
	public String getCollectedfrom() {
53
		return collectedfrom;
54
	}
55

  
56
	public Date getDateofcollection() {
57
		return dateofcollection;
58
	}
59

  
60
	public String getProvenanceaction() {
61
		return provenanceaction;
62
	}
63

  
64
	public Organization<DS> setId(final String id) {
65
		this.id = id;
66
		return this;
67
	}
68

  
69
	public Organization<DS> setLegalshortname(final String legalshortname) {
70
		this.legalshortname = legalshortname;
71
		return this;
72
	}
73

  
74
	public Organization<DS> setLegalname(final String legalname) {
75
		this.legalname = legalname;
76
		return this;
77
	}
78

  
79
	public Organization<DS> setWebsiteurl(final String websiteurl) {
80
		this.websiteurl = websiteurl;
81
		return this;
82
	}
83

  
84
	public Organization<DS> setLogourl(final String logourl) {
85
		this.logourl = logourl;
86
		return this;
87
	}
88

  
89
	public Organization<DS> setCountry(final String country) {
90
		this.country = country;
91
		return this;
92
	}
93

  
94
	public Organization<DS> setCollectedfrom(final String collectedfrom) {
95
		this.collectedfrom = collectedfrom;
96
		return this;
97
	}
98

  
99
	public Organization<DS> setDateofcollection(final Date dateofcollection) {
100
		this.dateofcollection = dateofcollection;
101
		return this;
102
	}
103

  
104
	public Organization<DS> setProvenanceaction(final String provenanceaction) {
105
		this.provenanceaction = provenanceaction;
106
		return this;
107
	}
108

  
109
	public Set<DS> getDatasources() {
110
		return datasources;
111
	}
112

  
113
	public void setDatasources(final Set<DS> datasources) {
114
		this.datasources = datasources;
115
	}
116

  
117
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/src/main/java/eu/dnetlib/enabling/datasources/common/SearchApisEntry.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import javax.xml.bind.annotation.XmlRootElement;
4

  
5
@XmlRootElement
6
public class SearchApisEntry implements Comparable<SearchApisEntry> {
7

  
8
	private String id;
9
	private String compliance;
10
	private String protocol;
11
	private boolean active;
12
	private String repoId = "unknown";
13
	private String repoName = "unknown";
14
	private String alternativeName = "unknown";
15
	private String repoOrganization = "unknown";
16
	private String repoCountry = "-";
17
	private String repoPrefix = "";
18
	private String aggrDate = "";
19
	private int aggrTotal = 0;
20

  
21
	public SearchApisEntry() {}
22

  
23
	public SearchApisEntry(final String id, final String compliance, final String protocol, final boolean active, final String repoId,
24
			final String repoName, final String repoCountry,
25
			final String repoPrefix, final String aggrDate, final int aggrTotal) {
26
		this.id = id;
27
		this.compliance = compliance;
28
		this.protocol = protocol;
29
		this.active = active;
30
		this.repoId = repoId;
31
		this.repoName = repoName;
32
		this.repoCountry = repoCountry;
33
		this.repoPrefix = repoPrefix;
34
		this.aggrDate = aggrDate;
35
		this.aggrTotal = aggrTotal;
36
	}
37

  
38
	public String getId() {
39
		return id;
40
	}
41

  
42
	public void setId(final String id) {
43
		this.id = id;
44
	}
45

  
46
	public String getCompliance() {
47
		return compliance;
48
	}
49

  
50
	public void setCompliance(final String compliance) {
51
		this.compliance = compliance;
52
	}
53

  
54
	public boolean isActive() {
55
		return active;
56
	}
57

  
58
	public void setActive(final boolean active) {
59
		this.active = active;
60
	}
61

  
62
	public String getRepoId() {
63
		return repoId;
64
	}
65

  
66
	public void setRepoId(final String repoId) {
67
		this.repoId = repoId;
68
	}
69

  
70
	public String getRepoName() {
71
		return repoName;
72
	}
73

  
74
	public void setRepoName(final String repoName) {
75
		this.repoName = repoName;
76
	}
77

  
78
	public String getRepoCountry() {
79
		return repoCountry;
80
	}
81

  
82
	public void setRepoCountry(final String repoCountry) {
83
		this.repoCountry = repoCountry;
84
	}
85

  
86
	public String getRepoPrefix() {
87
		return repoPrefix;
88
	}
89

  
90
	public void setRepoPrefix(final String repoPrefix) {
91
		this.repoPrefix = repoPrefix;
92
	}
93

  
94
	@Override
95
	public int compareTo(final SearchApisEntry e) {
96
		return compliance.compareTo(e.getCompliance());
97
	}
98

  
99
	public String getAggrDate() {
100
		return aggrDate;
101
	}
102

  
103
	public void setAggrDate(final String aggrDate) {
104
		this.aggrDate = aggrDate;
105
	}
106

  
107
	public int getAggrTotal() {
108
		return aggrTotal;
109
	}
110

  
111
	public void setAggrTotal(final int aggrTotal) {
112
		this.aggrTotal = aggrTotal;
113
	}
114

  
115
	public String getProtocol() {
116
		return protocol;
117
	}
118

  
119
	public void setProtocol(final String protocol) {
120
		this.protocol = protocol;
121
	}
122

  
123
	public String getAlternativeName() {
124
		return alternativeName;
125
	}
126

  
127
	public void setAlternativeName(String alternativeName) {
128
		this.alternativeName = alternativeName;
129
	}
130

  
131
	public String getRepoOrganization() {
132
		return repoOrganization;
133
	}
134

  
135
	public void setRepoOrganization(String repoOrganization) {
136
		this.repoOrganization = repoOrganization;
137
	}
138

  
139
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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 typology;
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 getTypology() {
40
		return typology;
41
	}
42

  
43
	public void setTypology(final String typology) {
44
		this.typology = typology;
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-1.0.6/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-1.0.6/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
	protected String datasource = null;
29
	protected String contentdescription = null;
30
	protected Boolean active = false;
31
	protected Boolean removable = true;
32
	protected String typology = null;
33
	protected String compatibility;
34

  
35
	@Transient
36
	protected boolean compatibilityOverrided = false;
37

  
38
	@Column(name = "metadata_identifier_path")
39
	protected String metadataIdentifierPath;
40

  
41
	@Column(name = "last_collection_total")
42
	protected Integer lastCollectionTotal;
43

  
44
	@Column(name = "last_collection_date")
45
	protected Timestamp lastCollectionDate;
46

  
47
	@Column(name = "last_collection_mdid")
48
	protected String lastCollectionMdid;
49

  
50
	@Column(name = "last_aggregation_total")
51
	protected Integer lastAggregationTotal;
52

  
53
	@Column(name = "last_aggregation_date")
54
	protected Timestamp lastAggregationDate;
55

  
56
	@Column(name = "last_aggregation_mdid")
57
	protected String lastAggregationMdid;
58

  
59
	@Column(name = "last_download_total")
60
	protected Integer lastDownloadTotal;
61

  
62
	@Column(name = "last_download_date")
63
	protected Timestamp lastDownloadDate;
64

  
65
	@Column(name = "last_download_objid")
66
	protected String lastDownloadObjid;
67

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

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

  
75
	public Api() {}
76

  
77
	public String getId() {
78
		return id;
79
	}
80

  
81
	public String getProtocol() {
82
		return protocol;
83
	}
84

  
85
	public String getDatasource() {
86
		return datasource;
87
	}
88

  
89
	public String getContentdescription() {
90
		return contentdescription;
91
	}
92

  
93
	public Boolean getActive() {
94
		return active;
95
	}
96

  
97
	public Boolean getRemovable() {
98
		return removable;
99
	}
100

  
101
	public String getTypology() {
102
		return typology;
103
	}
104

  
105
	public String getCompatibility() {
106
		return compatibility;
107
	}
108

  
109
	public boolean isCompatibilityOverrided() {
110
		return compatibilityOverrided;
111
	}
112

  
113
	public String getMetadataIdentifierPath() {
114
		return metadataIdentifierPath;
115
	}
116

  
117
	public Integer getLastCollectionTotal() {
118
		return lastCollectionTotal;
119
	}
120

  
121
	public Timestamp getLastCollectionDate() {
122
		return lastCollectionDate;
123
	}
124

  
125
	public String getLastCollectionMdid() {
126
		return lastCollectionMdid;
127
	}
128

  
129
	public Integer getLastAggregationTotal() {
130
		return lastAggregationTotal;
131
	}
132

  
133
	public Timestamp getLastAggregationDate() {
134
		return lastAggregationDate;
135
	}
136

  
137
	public String getLastAggregationMdid() {
138
		return lastAggregationMdid;
139
	}
140

  
141
	public Integer getLastDownloadTotal() {
142
		return lastDownloadTotal;
143
	}
144

  
145
	public Timestamp getLastDownloadDate() {
146
		return lastDownloadDate;
147
	}
148

  
149
	public String getLastDownloadObjid() {
150
		return lastDownloadObjid;
151
	}
152

  
153
	public String getLastValidationJob() {
154
		return lastValidationJob;
155
	}
156

  
157
	public String getBaseurl() {
158
		return baseurl;
159
	}
160

  
161
	public Set<AP> getApiParams() {
162
		return apiParams;
163
	}
164

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

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

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

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

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

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

  
195
	public Api<AP> setTypology(final String typology) {
196
		this.typology = typology;
197
		return this;
198
	}
199

  
200
	public Api<AP> setCompatibility(final String compatibility) {
201
		this.compatibility = compatibility;
202
		return this;
203
	}
204

  
205
	public Api<AP> setCompatibilityOverrided(final boolean compatibilityOverrided) {
206
		this.compatibilityOverrided = compatibilityOverrided;
207
		return this;
208
	}
209

  
210
	public Api<AP> setMetadataIdentifierPath(final String metadataIdentifierPath) {
211
		this.metadataIdentifierPath = metadataIdentifierPath;
212
		return this;
213
	}
214

  
215
	public Api<AP> setLastCollectionTotal(final Integer lastCollectionTotal) {
216
		this.lastCollectionTotal = lastCollectionTotal;
217
		return this;
218
	}
219

  
220
	public Api<AP> setLastCollectionDate(final Timestamp lastCollectionDate) {
221
		this.lastCollectionDate = lastCollectionDate;
222
		return this;
223
	}
224

  
225
	public Api<AP> setLastCollectionMdid(final String lastCollectionMdid) {
226
		this.lastCollectionMdid = lastCollectionMdid;
227
		return this;
228
	}
229

  
230
	public Api<AP> setLastAggregationTotal(final Integer lastAggregationTotal) {
231
		this.lastAggregationTotal = lastAggregationTotal;
232
		return this;
233
	}
234

  
235
	public Api<AP> setLastAggregationDate(final Timestamp lastAggregationDate) {
236
		this.lastAggregationDate = lastAggregationDate;
237
		return this;
238
	}
239

  
240
	public Api<AP> setLastAggregationMdid(final String lastAggregationMdid) {
241
		this.lastAggregationMdid = lastAggregationMdid;
242
		return this;
243
	}
244

  
245
	public Api<AP> setLastDownloadTotal(final Integer lastDownloadTotal) {
246
		this.lastDownloadTotal = lastDownloadTotal;
247
		return this;
248
	}
249

  
250
	public Api<AP> setLastDownloadDate(final Timestamp lastDownloadDate) {
251
		this.lastDownloadDate = lastDownloadDate;
252
		return this;
253
	}
254

  
255
	public Api<AP> setLastDownloadObjid(final String lastDownloadObjid) {
256
		this.lastDownloadObjid = lastDownloadObjid;
257
		return this;
258
	}
259

  
260
	public Api<AP> setLastValidationJob(final String lastValidationJob) {
261
		this.lastValidationJob = lastValidationJob;
262
		return this;
263
	}
264

  
265
	public Api<AP> setBaseurl(final String baseurl) {
266
		this.baseurl = baseurl;
267
		return this;
268
	}
269

  
270
	public Api<AP> setApiParams(final Set<AP> apiParams) {
271
		this.apiParams = apiParams;
272
		return this;
273
	}
274

  
275
	@Override
276
	public boolean equals(final Object o) {
277
		if (this == o) { return true; }
278
		if (o == null || getClass() != o.getClass()) { return false; }
279
		final Api<?> api = (Api<?>) o;
280
		return Objects.equals(this.id, api.id);
281
	}
282

  
283
	/*
284
	 * (non-Javadoc)
285
	 *
286
	 * @see eu.dnetlib.openaire.exporter.model.datasource.db.ApiInterface#hashCode()
287
	 */
288

  
289
	@Override
290
	public int hashCode() {
291
		return Objects.hash(id);
292
	}
293

  
294
	@Override
295
	public String toString() {
296
		return new Gson().toJson(this);
297
	}
298

  
299
	@Override
300
	public int compareTo(final Api<AP> a) {
301
		return ComparisonChain.start()
302
				.compare(getId(), a.getId())
303
				.result();
304
	}
305

  
306
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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-1.0.6/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-1.0.6/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-1.0.6/src/main/java/eu/dnetlib/enabling/datasources/common/DsmNotFoundException.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class DsmNotFoundException extends Exception {
4

  
5
	private int code;
6

  
7
	public DsmNotFoundException(int code, String msg) {
8
		super(msg);
9
		this.code = code;
10
	}
11

  
12
	public DsmNotFoundException(int code, Throwable e) {
13
		super(e);
14
		this.code = code;
15
	}
16

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

  
22
	public DsmNotFoundException(String msg) {
23
		this(404, msg);
24
	}
25

  
26
	public int getCode() {
27
		return code;
28
	}
29

  
30
	public void setCode(final int code) {
31
		this.code = code;
32
	}
33
}
0 34

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

  
3
public class DsmForbiddenException extends Exception {
4

  
5
	private int code;
6

  
7
	public DsmForbiddenException(int code, String msg) {
8
		super(msg);
9
		this.code = code;
10
	}
11

  
12
	public DsmForbiddenException(int code, Throwable e) {
13
		super(e);
14
		this.code = code;
15
	}
16

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

  
22
	public DsmForbiddenException(String msg) {
23
		this(403, msg);
24
	}
25

  
26
	public int getCode() {
27
		return code;
28
	}
29

  
30
	public void setCode(final int code) {
31
		this.code = code;
32
	}
33

  
34
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/src/main/java/eu/dnetlib/enabling/datasources/common/BrowsableField.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
public class BrowsableField {
4

  
5
	private String id;
6
	private String label;
7

  
8
	public BrowsableField() {}
9

  
10
	public BrowsableField(String id, String label) {
11
		this.id = id;
12
		this.label = label;
13
	}
14

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

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

  
23
	public String getLabel() {
24
		return label;
25
	}
26

  
27
	public void setLabel(String label) {
28
		this.label = label;
29
	}
30

  
31
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/src/main/java/eu/dnetlib/enabling/datasources/common/Identity.java
1
package eu.dnetlib.enabling.datasources.common;
2

  
3
import javax.persistence.Id;
4
import javax.persistence.MappedSuperclass;
5

  
6
/**
7
 * Created by claudio on 13/04/2017.
8
 */
9
@MappedSuperclass
10
public class Identity {
11

  
12
	@Id
13
	protected String pid;
14

  
15
	protected String issuertype;
16

  
17
	public Identity() {}
18

  
19
	public String getPid() {
20
		return this.pid;
21
	}
22

  
23
	public String getIssuertype() {
24
		return this.issuertype;
25
	}
26

  
27
	public Identity setPid(final String pid) {
28
		this.pid = pid;
29
		return this;
30
	}
31

  
32
	public Identity setIssuertype(final String issuertype) {
33
		this.issuertype = issuertype;
34
		return this;
35
	}
36

  
37
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.6/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-1.0.6/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
import javax.persistence.*;
6

  
7
/**
8
 * Datasource
9
 */
10
@MappedSuperclass
11
public class Datasource<ORG extends Organization, ID extends Identity> {
12

  
13
	@Id
14
	protected String id;
15

  
16
	@Column(nullable = false)
17
	protected String officialname;
18
	protected String englishname;
19
	protected String websiteurl;
20
	protected String logourl;
21
	protected String contactemail;
22
	protected Double latitude;
23
	protected Double longitude;
24
	protected String timezone;
25

  
26
	@Column(name = "namespaceprefix", columnDefinition = "bpchar(12)", nullable = false, updatable = false)
27
	protected String namespaceprefix;
28

  
29
	protected String languages;
30

  
31
	protected String od_contenttypes;
32
	protected String collectedfrom;
33
	protected Date dateofvalidation;
34
	protected String typology;
35
	protected String provenanceaction;
36
	protected Date dateofcollection;
37
	protected String platform;
38

  
39
	@Column(name = "activationid")
40
	protected String activationId;
41
	protected String description;
42

  
43
	protected Date releasestartdate;
44
	protected Date releaseenddate;
45
	protected String missionstatementurl;
46
	protected Boolean dataprovider;
47
	protected Boolean serviceprovider;
48

  
49
	protected String databaseaccesstype;
50
	protected String datauploadtype;
51
	protected String databaseaccessrestriction;
52
	protected String datauploadrestriction;
53

  
54
	protected Boolean versioning;
55
	protected String citationguidelineurl;
56
	protected String qualitymanagementkind;
57
	protected String pidsystems;
58

  
59
	protected String certificates;
60
	protected String aggregator;
61

  
62
	protected String issn;
63
	protected String eissn;
64
	protected String lissn;
65

  
66
	protected String registeredby;
67

  
68
	private Date registrationdate;
69

  
70
	protected String subjects;
71

  
72
	protected Boolean managed;
73

  
74
	@Column(name = "consenttermsofuse")
75
	protected Boolean consentTermsOfUse;
76

  
77
	@Column(name = "fulltextdownload")
78
	protected Boolean fullTextDownload;
79

  
80
	@ManyToMany(
81
			cascade = { CascadeType.PERSIST, CascadeType.MERGE },
82
			fetch = FetchType.LAZY)
83
	@JoinTable(
84
			name = "dsm_datasource_organization",
85
			joinColumns = @JoinColumn(name="datasource"),
86
			inverseJoinColumns = @JoinColumn(name="organization"))
87
	protected Set<ORG> organizations;
88

  
89
	@ManyToMany(
90
			cascade = { CascadeType.PERSIST, CascadeType.MERGE },
91
			fetch = FetchType.LAZY )
92
	@JoinTable(
93
			name = "dsm_datasourcepids",
94
			joinColumns = @JoinColumn(name = "datasource"),
95
			inverseJoinColumns = @JoinColumn(name = "pid"))
96
	protected Set<ID> identities;
97

  
98
	public Datasource() {}
99

  
100
	public String getId() {
101
		return id;
102
	}
103

  
104
	public String getOfficialname() {
105
		return officialname;
106
	}
107

  
108
	public String getEnglishname() {
109
		return englishname;
110
	}
111

  
112
	public String getWebsiteurl() {
113
		return websiteurl;
114
	}
115

  
116
	public String getLogourl() {
117
		return logourl;
118
	}
119

  
120
	public String getContactemail() {
121
		return contactemail;
122
	}
123

  
124
	public Double getLatitude() {
125
		return latitude;
126
	}
127

  
128
	public Double getLongitude() {
129
		return longitude;
130
	}
131

  
132
	public String getTimezone() {
133
		return timezone;
134
	}
135

  
136
	public String getNamespaceprefix() {
137
		return namespaceprefix;
138
	}
139

  
140
	public String getLanguages() {
141
		return languages;
142
	}
143

  
144
	public String getOd_contenttypes() {
145
		return od_contenttypes;
146
	}
147

  
148
	public String getCollectedfrom() {
149
		return collectedfrom;
150
	}
151

  
152
	public Date getDateofvalidation() {
153
		return dateofvalidation;
154
	}
155

  
156
	public String getTypology() {
157
		return typology;
158
	}
159

  
160
	public String getProvenanceaction() {
161
		return provenanceaction;
162
	}
163

  
164
	public Date getDateofcollection() {
165
		return dateofcollection;
166
	}
167

  
168
	public String getPlatform() {
169
		return platform;
170
	}
171

  
172
	public String getActivationId() {
173
		return activationId;
174
	}
175

  
176
	public String getDescription() {
177
		return description;
178
	}
179

  
180
	public Date getReleasestartdate() {
181
		return releasestartdate;
182
	}
183

  
184
	public Date getReleaseenddate() {
185
		return releaseenddate;
186
	}
187

  
188
	public String getMissionstatementurl() {
189
		return missionstatementurl;
190
	}
191

  
192
	public Boolean getDataprovider() {
193
		return dataprovider;
194
	}
195

  
196
	public Boolean getServiceprovider() {
197
		return serviceprovider;
198
	}
199

  
200
	public String getDatabaseaccesstype() {
201
		return databaseaccesstype;
202
	}
203

  
204
	public String getDatauploadtype() {
205
		return datauploadtype;
206
	}
207

  
208
	public String getDatabaseaccessrestriction() {
209
		return databaseaccessrestriction;
210
	}
211

  
212
	public String getDatauploadrestriction() {
213
		return datauploadrestriction;
214
	}
215

  
216
	public Boolean getVersioning() {
217
		return versioning;
218
	}
219

  
220
	public String getCitationguidelineurl() {
221
		return citationguidelineurl;
222
	}
223

  
224
	public String getQualitymanagementkind() {
225
		return qualitymanagementkind;
226
	}
227

  
228
	public String getPidsystems() {
229
		return pidsystems;
230
	}
231

  
232
	public String getCertificates() {
233
		return certificates;
234
	}
235

  
236
	public String getAggregator() {
237
		return aggregator;
238
	}
239

  
240
	public String getIssn() {
241
		return issn;
242
	}
243

  
244
	public String getEissn() {
245
		return eissn;
246
	}
247

  
248
	public String getLissn() {
249
		return lissn;
250
	}
251

  
252
	public String getRegisteredby() {
253
		return registeredby;
254
	}
255

  
256
	public Date getRegistrationdate() {
257
		return registrationdate;
258
	}
259

  
260
	public String getSubjects() {
261
		return subjects;
262
	}
263

  
264
	public Boolean getManaged() {
265
		return managed;
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> setId(final String id) {
277
		this.id = id;
278
		return this;
279
	}
280

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

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff