Project

General

Profile

« Previous | Next » 

Revision 50709

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

View differences:

modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.0/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.0/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.0/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 updateApiDetails(String dsId, String apiId, String metadataIdentifierPath, String baseUrl, Map<String, String> params) throws DsmException;
31

  
32
	boolean isRemovable(String dsId, String apiId) throws DsmException;
33

  
34
	void regenerateProfiles() throws DsmException;
35

  
36
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.0/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.0/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.0/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.0/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.0/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.0/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.0/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.0/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
import javax.persistence.*;
7

  
8
import com.google.common.collect.ComparisonChain;
9
import com.google.gson.Gson;
10

  
11
/**
12
 * Api
13
 */
14
@MappedSuperclass
15
public class Api<AP extends ApiParam> implements Comparable<Api<AP>> {
16

  
17
	@Id
18
	protected String id = null;
19
	protected String protocol = null;
20
	protected String datasource = null;
21
	protected String contentdescription = null;
22
	protected Boolean active = false;
23
	protected Boolean removable = false;
24
	protected String typology = null;
25
	protected String compatibility;
26

  
27
	@Transient
28
	protected boolean compatibilityOverrided = false;
29

  
30
	@Column(name = "metadata_identifier_path")
31
	protected String metadataIdentifierPath;
32

  
33
	@Column(name = "last_collection_total")
34
	protected Integer lastCollectionTotal;
35

  
36
	@Column(name = "last_collection_date")
37
	protected Timestamp lastCollectionDate;
38

  
39
	@Column(name = "last_collection_mdid")
40
	protected String lastCollectionMdid;
41

  
42
	@Column(name = "last_aggregation_total")
43
	protected Integer lastAggregationTotal;
44

  
45
	@Column(name = "last_aggregation_date")
46
	protected Timestamp lastAggregationDate;
47

  
48
	@Column(name = "last_aggregation_mdid")
49
	protected String lastAggregationMdid;
50

  
51
	@Column(name = "last_download_total")
52
	protected Integer lastDownloadTotal;
53

  
54
	@Column(name = "last_download_date")
55
	protected Timestamp lastDownloadDate;
56

  
57
	@Column(name = "last_download_objid")
58
	protected String lastDownloadObjid;
59

  
60
	@Column(name = "last_validation_job")
61
	protected String lastValidationJob;
62
	protected String baseurl = null;
63

  
64
	@OneToMany(mappedBy = "id.api", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
65
	protected Set<AP> apiParams;
66

  
67
	public Api() {}
68

  
69
	public String getId() {
70
		return id;
71
	}
72

  
73
	public String getProtocol() {
74
		return protocol;
75
	}
76

  
77
	public String getDatasource() {
78
		return datasource;
79
	}
80

  
81
	public String getContentdescription() {
82
		return contentdescription;
83
	}
84

  
85
	public Boolean getActive() {
86
		return active;
87
	}
88

  
89
	public Boolean getRemovable() {
90
		return removable;
91
	}
92

  
93
	public String getTypology() {
94
		return typology;
95
	}
96

  
97
	public String getCompatibility() {
98
		return compatibility;
99
	}
100

  
101
	public boolean isCompatibilityOverrided() {
102
		return compatibilityOverrided;
103
	}
104

  
105
	public String getMetadataIdentifierPath() {
106
		return metadataIdentifierPath;
107
	}
108

  
109
	public Integer getLastCollectionTotal() {
110
		return lastCollectionTotal;
111
	}
112

  
113
	public Timestamp getLastCollectionDate() {
114
		return lastCollectionDate;
115
	}
116

  
117
	public String getLastCollectionMdid() {
118
		return lastCollectionMdid;
119
	}
120

  
121
	public Integer getLastAggregationTotal() {
122
		return lastAggregationTotal;
123
	}
124

  
125
	public Timestamp getLastAggregationDate() {
126
		return lastAggregationDate;
127
	}
128

  
129
	public String getLastAggregationMdid() {
130
		return lastAggregationMdid;
131
	}
132

  
133
	public Integer getLastDownloadTotal() {
134
		return lastDownloadTotal;
135
	}
136

  
137
	public Timestamp getLastDownloadDate() {
138
		return lastDownloadDate;
139
	}
140

  
141
	public String getLastDownloadObjid() {
142
		return lastDownloadObjid;
143
	}
144

  
145
	public String getLastValidationJob() {
146
		return lastValidationJob;
147
	}
148

  
149
	public String getBaseurl() {
150
		return baseurl;
151
	}
152

  
153
	public Set<AP> getApiParams() {
154
		return apiParams;
155
	}
156

  
157
	public Api<AP> setId(final String id) {
158
		this.id = id;
159
		return this;
160
	}
161

  
162
	public Api<AP> setProtocol(final String protocol) {
163
		this.protocol = protocol;
164
		return this;
165
	}
166

  
167
	public Api<AP> setDatasource(final String datasource) {
168
		this.datasource = datasource;
169
		return this;
170
	}
171

  
172
	public Api<AP> setContentdescription(final String contentdescription) {
173
		this.contentdescription = contentdescription;
174
		return this;
175
	}
176

  
177
	public Api<AP> setActive(final Boolean active) {
178
		this.active = active;
179
		return this;
180
	}
181

  
182
	public Api<AP> setRemovable(final Boolean removable) {
183
		this.removable = removable;
184
		return this;
185
	}
186

  
187
	public Api<AP> setTypology(final String typology) {
188
		this.typology = typology;
189
		return this;
190
	}
191

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  
298
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.0/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.0/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
			return AggregationStage.TRANSFORM;
21

  
22
		}
23
		throw new IllegalArgumentException("invalid AggregationStage: " + s);
24
	}
25
}
modules/dnet-datasource-manager-common/tags/dnet-datasource-manager-common-1.0.0/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.0/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.0/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.0/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.0/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.0/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.0/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 = null;
15
	protected String officialname = null;
16
	protected String englishname = null;
17
	protected String websiteurl = null;
18
	protected String logourl = null;
19
	protected String contactemail = null;
20
	protected Double latitude;
21
	protected Double longitude;
22
	protected String timezone = null;
23

  
24
	@Column(name = "namespaceprefix", columnDefinition = "bpchar(12)")
25
	protected String namespaceprefix;
26

  
27
	protected String languages;
28

  
29
	protected String od_contenttypes;
30
	protected String collectedfrom = null;
31
	protected Date dateofvalidation = null;
32
	protected String typology = null;
33
	protected String provenanceaction;
34
	protected Date dateofcollection;
35
	protected String platform;
36

  
37
	@Column(name = "activationid")
38
	protected String activationId;
39
	protected String description = null;
40

  
41
	protected Date releasestartdate;
42
	protected Date releaseenddate;
43
	protected String missionstatementurl;
44
	protected Boolean dataprovider;
45
	protected Boolean serviceprovider;
46

  
47
	protected String databaseaccesstype;
48
	protected String datauploadtype;
49
	protected String databaseaccessrestriction;
50
	protected String datauploadrestriction;
51

  
52
	protected Boolean versioning;
53
	protected String citationguidelineurl;
54
	protected String qualitymanagementkind;
55
	protected String pidsystems;
56

  
57
	protected String certificates;
58
	protected String aggregator;
59

  
60
	protected String issn = null;
61
	protected String eissn = null;
62
	protected String lissn = null;
63

  
64
	protected String registeredby = null;
65

  
66
	private Date registrationdate = null;
67

  
68
	protected String subjects;
69

  
70
	protected Boolean managed;
71

  
72
	@ManyToMany(
73
			cascade = { CascadeType.PERSIST, CascadeType.MERGE },
74
			fetch = FetchType.LAZY)
75
	@JoinTable(
76
			name = "dsm_datasource_organization",
77
			joinColumns = @JoinColumn(name="datasource"),
78
			inverseJoinColumns = @JoinColumn(name="organization"))
79
	protected Set<ORG> organizations;
80

  
81
	@ManyToMany(
82
			cascade = { CascadeType.PERSIST, CascadeType.MERGE },
83
			fetch = FetchType.LAZY )
84
	@JoinTable(
85
			name = "dsm_datasourcepids",
86
			joinColumns = @JoinColumn(name = "datasource"),
87
			inverseJoinColumns = @JoinColumn(name = "pid"))
88
	protected Set<ID> identities;
89

  
90
	public Datasource() {}
91

  
92
	public String getId() {
93
		return id;
94
	}
95

  
96
	public String getOfficialname() {
97
		return officialname;
98
	}
99

  
100
	public String getEnglishname() {
101
		return englishname;
102
	}
103

  
104
	public String getWebsiteurl() {
105
		return websiteurl;
106
	}
107

  
108
	public String getLogourl() {
109
		return logourl;
110
	}
111

  
112
	public String getContactemail() {
113
		return contactemail;
114
	}
115

  
116
	public Double getLatitude() {
117
		return latitude;
118
	}
119

  
120
	public Double getLongitude() {
121
		return longitude;
122
	}
123

  
124
	public String getTimezone() {
125
		return timezone;
126
	}
127

  
128
	public String getNamespaceprefix() {
129
		return namespaceprefix;
130
	}
131

  
132
	public String getLanguages() {
133
		return languages;
134
	}
135

  
136
	public String getOd_contenttypes() {
137
		return od_contenttypes;
138
	}
139

  
140
	public String getCollectedfrom() {
141
		return collectedfrom;
142
	}
143

  
144
	public Date getDateofvalidation() {
145
		return dateofvalidation;
146
	}
147

  
148
	public String getTypology() {
149
		return typology;
150
	}
151

  
152
	public String getProvenanceaction() {
153
		return provenanceaction;
154
	}
155

  
156
	public Date getDateofcollection() {
157
		return dateofcollection;
158
	}
159

  
160
	public String getPlatform() {
161
		return platform;
162
	}
163

  
164
	public String getActivationId() {
165
		return activationId;
166
	}
167

  
168
	public String getDescription() {
169
		return description;
170
	}
171

  
172
	public Date getReleasestartdate() {
173
		return releasestartdate;
174
	}
175

  
176
	public Date getReleaseenddate() {
177
		return releaseenddate;
178
	}
179

  
180
	public String getMissionstatementurl() {
181
		return missionstatementurl;
182
	}
183

  
184
	public Boolean isDataprovider() {
185
		return dataprovider;
186
	}
187

  
188
	public Boolean isServiceprovider() {
189
		return serviceprovider;
190
	}
191

  
192
	public String getDatabaseaccesstype() {
193
		return databaseaccesstype;
194
	}
195

  
196
	public String getDatauploadtype() {
197
		return datauploadtype;
198
	}
199

  
200
	public String getDatabaseaccessrestriction() {
201
		return databaseaccessrestriction;
202
	}
203

  
204
	public String getDatauploadrestriction() {
205
		return datauploadrestriction;
206
	}
207

  
208
	public Boolean isVersioning() {
209
		return versioning;
210
	}
211

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

  
216
	public String getQualitymanagementkind() {
217
		return qualitymanagementkind;
218
	}
219

  
220
	public String getPidsystems() {
221
		return pidsystems;
222
	}
223

  
224
	public String getCertificates() {
225
		return certificates;
226
	}
227

  
228
	public String getAggregator() {
229
		return aggregator;
230
	}
231

  
232
	public String getIssn() {
233
		return issn;
234
	}
235

  
236
	public String getEissn() {
237
		return eissn;
238
	}
239

  
240
	public String getLissn() {
241
		return lissn;
242
	}
243

  
244
	public String getRegisteredby() {
245
		return registeredby;
246
	}
247

  
248
	public Date getRegistrationdate() {
249
		return registrationdate;
250
	}
251

  
252
	public String getSubjects() {
253
		return subjects;
254
	}
255

  
256
	public Boolean isManaged() {
257
		return managed;
258
	}
259

  
260
	public Set<ORG> getOrganizations() {
261
		return organizations;
262
	}
263

  
264
	public Set<ID> getIdentities() {
265
		return identities;
266
	}
267

  
268
	public Datasource<ORG, ID> setId(final String id) {
269
		this.id = id;
270
		return this;
271
	}
272

  
273
	public Datasource<ORG, ID> setOfficialname(final String officialname) {
274
		this.officialname = officialname;
275
		return this;
276
	}
277

  
278
	public Datasource<ORG, ID> setEnglishname(final String englishname) {
279
		this.englishname = englishname;
280
		return this;
281
	}
282

  
283
	public Datasource<ORG, ID> setWebsiteurl(final String websiteurl) {
284
		this.websiteurl = websiteurl;
285
		return this;
286
	}
287

  
288
	public Datasource<ORG, ID> setLogourl(final String logourl) {
289
		this.logourl = logourl;
290
		return this;
291
	}
292

  
293
	public Datasource<ORG, ID> setContactemail(final String contactemail) {
294
		this.contactemail = contactemail;
295
		return this;
296
	}
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff