Project

General

Profile

1
package eu.dnetlib.domain.data;
2

    
3
import com.google.gwt.user.client.rpc.IsSerializable;
4
import eu.dnetlib.domain.DriverResource;
5

    
6
import java.util.*;
7

    
8
/**
9
 * The domain object for the Repository resource data structure
10
 * 
11
 */
12
public class Repository extends DriverResource implements IsSerializable {
13
	private static final long serialVersionUID = -7241644234046760972L;
14

    
15
	// new
16
	private String id;
17
	private String officialName;
18
	private String englishName;
19
	private String websiteUrl;
20
	private String logoUrl;
21
	private String contactEmail;
22
	private String countryName;
23
	private String countryCode;
24
	private String organization;
25
	private Double latitude = 0.0;
26
	private Double longitude = 0.0;
27
	private Double timezone = 0.0;
28
	private String namespacePrefix;
29
	private String odNumberOfItems;
30
	private String odNumberOfItemsDate;
31
	private String odPolicies;
32
	private String odLanguages;
33
	private String odContentTypes;
34
	private String collectedFrom;
35
	private Boolean inferred = false;
36
	private Boolean deletedByInference = false;
37
	private Double trust = 0.9;
38
	private String inferenceProvenance;
39
	private Date dateOfValidation;
40
	private String datasourceClass;
41
	private String provenanceActionClass;
42
	private Date dateOfCollection;
43
	private String typology;
44
	private String activationId;
45
	private Boolean mergehomonyms = true;
46
	private String description;
47
	private Date releaseStartDate;
48
	private Date releaseEndDate;
49
	private String missionStatementUrl;
50
	private Boolean dataProvider = false;
51
	private Boolean serviceProvider = false;
52
	private String databaseAccessType;
53
	private String dataUploadType;
54
	private String databaseAccessRestriction;
55
	private String dataUploadRestriction;
56
	private Boolean versioning = false;
57
	private String citationGuidelineUrl;
58
	private String qualityManagementKind;
59
	private String pidSystems;
60
	private String certificates;
61
	private String aggregator;
62
	private String issn;
63
	private String eissn;
64
	private String lissn;
65
	private List<RepositoryInterface> interfaces = new ArrayList<RepositoryInterface>();
66

    
67
	private String availableDiskSpace = null;
68
	private String securityParameters = null;
69
	private String protocol = null;
70
	private String registeredBy = null;
71

    
72
	private String datasourceType = null;
73
	private String datasourceAggregatorId = null;
74
	private String datasourceOriginalIdValue = null;
75
	private String datasourceOriginalIdProvenance = null;
76
	private Boolean datasourceAggregated = null;
77
	private String datasourceComplianceDegreeValue = null;
78
	private String datasourceComplianceDegreeEncoding = null;
79

    
80
	private Integer numberOfObjects = Integer.valueOf(0);
81
	private Integer maxSizeOfDatastructure = Integer.valueOf(0);
82
	private Integer maxNumberOfDataStructures = Integer.valueOf(0);
83

    
84

    
85
	private Boolean registered = false;
86

    
87
	// QOS parameters
88
//	private String availability = null;
89
//	private String capacity = null;
90
//	private Integer responseTime = null;
91
//	private double throughput = 0.0D;
92

    
93
	// status parameters
94
//	private Integer handledDatastructure = null;
95
//	private Integer usedDiskspace = null;
96
//	private Date lastUpdate = null;
97

    
98
	// blackboard
99
//	private RepositoryBlackboard blackboard = null;
100

    
101
	private Map<String, String> extraFields = new HashMap<String, String>();
102

    
103
	// extra fields that need to be added to the XML schema
104
	// private String administratorEmail = null;
105
	// private String administratorName = null;
106
	// private String administratorContactInfo = null;
107

    
108
	// private List<RepositoryInterface> interfaces = new
109
	// ArrayList<RepositoryInterface>();
110
	private static List<DataCollectionType> dataCollectionTypes = new ArrayList<DataCollectionType>();
111

    
112

    
113
	private PiwikInfo piwikInfo;
114

    
115
	private List<String> environments = new ArrayList<String>();
116

    
117
	public Repository() {
118
		this.setDateOfCreation(new Date());
119
		this.setResourceKind("RepositoryServiceResources");
120
		this.setResourceType("RepositoryServiceResourceType");
121
	}
122

    
123
	public Map<String, String> getExtraFields() {
124
		return extraFields;
125
	}
126

    
127
	public void setExtraFields(Map<String, String> extraFields) {
128
		this.extraFields = extraFields;
129
	}
130

    
131
	public String getRegisteredBy() {
132
		return registeredBy;
133
	}
134

    
135
	public void setRegisteredBy(String registeredBy) {
136
		this.registeredBy = registeredBy;
137
	}
138

    
139
	public String getCountryName() {
140
		return countryName;
141
	}
142

    
143
	public void setCountryName(String countryName) {
144
		this.countryName = countryName;
145
	}
146

    
147
	public String getCountryCode() {
148
		return countryCode;
149
	}
150

    
151
	public void setCountryCode(String countryCode) {
152
		this.countryCode = countryCode;
153
	}
154

    
155
	public String getEnglishName() {
156
		return englishName;
157
	}
158

    
159
	public void setEnglishName(String englishName) {
160
		this.englishName = englishName;
161
	}
162

    
163
	
164
//	public String getId() {
165
//		return this.getResourceId();
166
//	}
167
//
168
//	public void setId(String id) {
169
//		this.setResourceId(id);
170
//	}
171

    
172
	public String getId() {
173
		return id;
174
	}
175

    
176
	public void setId(String id) {
177
		this.id = id;
178
	}
179

    
180
	public Integer getNumberOfObjects() {
181
		return numberOfObjects;
182
	}
183

    
184
	public String getDescription() {
185
		return description;
186
	}
187

    
188
	public void setDescription(String description) {
189
		this.description = description;
190
	}
191

    
192
	public void setNumberOfObjects(Integer numberOfObjects) {
193
		this.numberOfObjects = numberOfObjects;
194
	}
195

    
196
	public String getOfficialName() {
197
		return officialName;
198
	}
199

    
200
	public void setOfficialName(String officialName) {
201
		this.officialName = officialName;
202
	}
203

    
204
	public Date getRegistrationDate() {
205
		return this.getDateOfCreation();
206
	}
207

    
208
	public void setRegistrationDate(Date registrationDate) {
209
		this.setDateOfCreation(registrationDate);
210
	}
211

    
212
	public List<RepositoryInterface> getInterfaces() {
213
		return interfaces;
214
	}
215

    
216
	public void setInterfaces(List<RepositoryInterface> interfaces) {
217
		this.interfaces = interfaces;
218
	}
219

    
220
	public String getTypology() {
221
		return typology;
222
	}
223

    
224
	public void setTypology(String typology) {
225
		this.typology = typology;
226
	}
227

    
228
	public Double getLatitude() {
229
		return latitude;
230
	}
231

    
232
	public Double getTimezone() {
233
		return timezone;
234
	}
235

    
236
	public void setTimezone(Double timezone) throws IllegalArgumentException {
237
		if (timezone < -12 || timezone > 12 || (timezone % 0.5) != 0) {
238
			String t = String.valueOf(timezone);
239
			throw new IllegalArgumentException(
240
					"timezone must be in the range [-12.0, 12.0] and must me divided by 0.5. Value given is "
241
							+ t);
242
		}
243
		this.timezone = timezone;
244
	}
245
	public boolean equals(Object o) {
246
		if (!(o instanceof Repository))
247
			return false;
248
		else
249
			return this.equals((Repository) o);
250
	}
251

    
252
	public boolean equals(Repository r) {
253
		// TODO: fill with required fields...
254

    
255
		if (this.getEnglishName() != null && r.getEnglishName() == null) {
256
			return false;
257
		} else if (this.getEnglishName() == null
258
				&& r.getEnglishName() != null) {
259
			return false;
260
		} else if (this.getEnglishName() != null
261
				&& r.getEnglishName() != null) {
262
			return this.getEnglishName().equals(r.getEnglishName());
263
		}
264

    
265
		return true;
266
	}
267

    
268
	@Override
269
	public int hashCode() {
270
        return officialName.hashCode();
271
	}
272

    
273
	public String getAvailableDiskSpace() {
274
		return availableDiskSpace;
275
	}
276

    
277
	public void setAvailableDiskSpace(String availableDiskSpace) {
278
		this.availableDiskSpace = availableDiskSpace;
279
	}
280

    
281
	public String getSecurityParameters() {
282
		return securityParameters;
283
	}
284

    
285
	public void setSecurityParameters(String securityParameters) {
286
		this.securityParameters = securityParameters;
287
	}
288

    
289
	public Integer getMaxSizeOfDatastructure() {
290
		return maxSizeOfDatastructure;
291
	}
292

    
293
	public void setMaxSizeOfDatastructure(Integer maxSizeOfDatastructure) {
294
		this.maxSizeOfDatastructure = maxSizeOfDatastructure;
295
	}
296

    
297
	public Integer getMaxNumberOfDataStructures() {
298
		return maxNumberOfDataStructures;
299
	}
300

    
301
	public void setMaxNumberOfDataStructures(Integer maxNumberOfDataStructures) {
302
		this.maxNumberOfDataStructures = maxNumberOfDataStructures;
303
	}
304

    
305

    
306
	public Boolean isVerified() {
307
		return extraFields.containsKey("VERIFIED")
308
				&& extraFields.get("VERIFIED").toLowerCase().equals("yes");
309
	}
310

    
311
	public void setProtocol(String protocol) {
312
		this.protocol = protocol;
313
	}
314

    
315
	public String getProtocol() {
316
		return protocol;
317
	}
318

    
319
	public void setDatasourceType(String datasourceType) {
320
		this.datasourceType = datasourceType;
321
	}
322

    
323
	public String getDatasourceType() {
324
		return datasourceType;
325
	}
326

    
327
	public Boolean getDatasourceAggregated() {
328
		return datasourceAggregated;
329
	}
330

    
331
	public void setDatasourceAggregated(Boolean datasourceAggregated) {
332
		this.datasourceAggregated = datasourceAggregated;
333
	}
334

    
335
	public String getDatasourceComplianceDegreeValue() {
336
		return datasourceComplianceDegreeValue;
337
	}
338

    
339
	public void setDatasourceComplianceDegreeValue(
340
			String datasourceComplianceDegreeValue) {
341
		this.datasourceComplianceDegreeValue = datasourceComplianceDegreeValue;
342
	}
343

    
344
	public String getDatasourceComplianceDegreeEncoding() {
345
		return datasourceComplianceDegreeEncoding;
346
	}
347

    
348
	public void setDatasourceComplianceDegreeEncoding(
349
			String datasourceComplianceDegreeEncoding) {
350
		this.datasourceComplianceDegreeEncoding = datasourceComplianceDegreeEncoding;
351
	}
352

    
353
	public void setDatasourceAggregatorId(String datasourceAggregatorId) {
354
		this.datasourceAggregatorId = datasourceAggregatorId;
355
	}
356

    
357
	public String getDatasourceAggregatorId() {
358
		return datasourceAggregatorId;
359
	}
360

    
361
	public void setDatasourceOriginalIdValue(String datasourceOriginalIdValue) {
362
		this.datasourceOriginalIdValue = datasourceOriginalIdValue;
363
	}
364

    
365
	public String getDatasourceOriginalIdValue() {
366
		return datasourceOriginalIdValue;
367
	}
368

    
369
	public void setDatasourceOriginalIdProvenance(
370
			String datasourceOriginalIdProvenance) {
371
		this.datasourceOriginalIdProvenance = datasourceOriginalIdProvenance;
372
	}
373

    
374
	public String getDatasourceOriginalIdProvenance() {
375
		return datasourceOriginalIdProvenance;
376
	}
377

    
378
	public List<DataCollectionType> getDataCollectionTypes() {
379
		return dataCollectionTypes;
380
	}
381

    
382
	public void setDataCollectionTypes(
383
			List<DataCollectionType> dataCollectionTypes) {
384
		this.dataCollectionTypes = dataCollectionTypes;
385
	}
386

    
387
	public void setEnvironments(List<String> environments) {
388
		this.environments = environments;
389
	}
390

    
391
	public List<String> getEnvironments() {
392
		return environments;
393
	}
394

    
395
	// new
396

    
397
	public String getWebsiteUrl() {
398
		return websiteUrl;
399
	}
400

    
401
	public void setWebsiteUrl(String websiteUrl) {
402
		this.websiteUrl = websiteUrl;
403
	}
404

    
405
	public String getLogoUrl() {
406
		return logoUrl;
407
	}
408

    
409
	public void setLogoUrl(String logoUrl) {
410
		this.logoUrl = logoUrl;
411
	}
412

    
413
	public String getContactEmail() {
414
		return contactEmail;
415
	}
416

    
417
	public void setContactEmail(String contactEmail) {
418
		this.contactEmail = contactEmail;
419
	}
420

    
421
	public String getOrganization() {
422
		return organization;
423
	}
424

    
425
	public void setOrganization(String organization) {
426
		this.organization = organization;
427
	}
428

    
429
	public Double getLongitude() {
430
		return longitude;
431
	}
432

    
433
	public void setLongitude(Double longitude) {
434
		this.longitude = longitude;
435
	}
436

    
437
	public String getNamespacePrefix() {
438
		return namespacePrefix;
439
	}
440

    
441
	public void setNamespacePrefix(String namespacePrefix) {
442
		this.namespacePrefix = namespacePrefix;
443
	}
444

    
445
	public String getOdNumberOfItems() {
446
		return odNumberOfItems;
447
	}
448

    
449
	public void setOdNumberOfItems(String odNumberOfItems) {
450
		this.odNumberOfItems = odNumberOfItems;
451
	}
452

    
453
	public String getOdNumberOfItemsDate() {
454
		return odNumberOfItemsDate;
455
	}
456

    
457
	public void setOdNumberOfItemsDate(String odNumberOfItemsDate) {
458
		this.odNumberOfItemsDate = odNumberOfItemsDate;
459
	}
460

    
461
	public String getOdPolicies() {
462
		return odPolicies;
463
	}
464

    
465
	public void setOdPolicies(String odPolicies) {
466
		this.odPolicies = odPolicies;
467
	}
468

    
469
	public String getOdLanguages() {
470
		return odLanguages;
471
	}
472

    
473
	public void setOdLanguages(String odLanguages) {
474
		this.odLanguages = odLanguages;
475
	}
476

    
477
	public String getOdContentTypes() {
478
		return odContentTypes;
479
	}
480

    
481
	public void setOdContentTypes(String odContentTypes) {
482
		this.odContentTypes = odContentTypes;
483
	}
484

    
485
	public String getCollectedFrom() {
486
		return collectedFrom;
487
	}
488

    
489
	public void setCollectedFrom(String collectedFrom) {
490
		this.collectedFrom = collectedFrom;
491
	}
492

    
493
	public Boolean getInferred() {
494
		return inferred;
495
	}
496

    
497
	public void setInferred(Boolean inferred) {
498
		this.inferred = inferred;
499
	}
500

    
501
	public Boolean getDeletedByInference() {
502
		return deletedByInference;
503
	}
504

    
505
	public void setDeletedByInference(Boolean deletedByInference) {
506
		this.deletedByInference = deletedByInference;
507
	}
508

    
509
	public Double getTrust() {
510
		return trust;
511
	}
512

    
513
	public void setTrust(Double trust) {
514
		this.trust = trust;
515
	}
516

    
517
	public String getInferenceProvenance() {
518
		return inferenceProvenance;
519
	}
520

    
521
	public void setInferenceProvenance(String inferenceProvenance) {
522
		this.inferenceProvenance = inferenceProvenance;
523
	}
524

    
525
	public Date getDateOfValidation() {
526
		return dateOfValidation;
527
	}
528

    
529
	public void setDateOfValidation(Date dateOfValidation) {
530
		this.dateOfValidation = dateOfValidation;
531
	}
532

    
533
	public String getDatasourceClass() {
534
		return datasourceClass;
535
	}
536

    
537
	public void setDatasourceClass(String datasourceClass) {
538
		this.datasourceClass = datasourceClass;
539
	}
540

    
541
	public String getProvenanceActionClass() {
542
		return provenanceActionClass;
543
	}
544

    
545
	public void setProvenanceActionClass(String provenanceActionClass) {
546
		this.provenanceActionClass = provenanceActionClass;
547
	}
548

    
549
	public Date getDateOfCollection() {
550
		return dateOfCollection;
551
	}
552

    
553
	public void setDateOfCollection(Date dateOfCollection) {
554
		this.dateOfCollection = dateOfCollection;
555
	}
556

    
557
	public String getActivationId() {
558
		return activationId;
559
	}
560

    
561
	public void setActivationId(String activationId) {
562
		this.activationId = activationId;
563
	}
564

    
565
	public Boolean getMergehomonyms() {
566
		return mergehomonyms;
567
	}
568

    
569
	public void setMergehomonyms(Boolean mergehomonyms) {
570
		this.mergehomonyms = mergehomonyms;
571
	}
572

    
573
	public Date getReleaseStartDate() {
574
		return releaseStartDate;
575
	}
576

    
577
	public void setReleaseStartDate(Date releaseStartDate) {
578
		this.releaseStartDate = releaseStartDate;
579
	}
580

    
581
	public Date getReleaseEndDate() {
582
		return releaseEndDate;
583
	}
584

    
585
	public void setReleaseEndDate(Date releaseEndDate) {
586
		this.releaseEndDate = releaseEndDate;
587
	}
588

    
589
	public String getMissionStatementUrl() {
590
		return missionStatementUrl;
591
	}
592

    
593
	public void setMissionStatementUrl(String missionStatementUrl) {
594
		this.missionStatementUrl = missionStatementUrl;
595
	}
596

    
597
	public Boolean getDataProvider() {
598
		return dataProvider;
599
	}
600

    
601
	public void setDataProvider(Boolean dataProvider) {
602
		this.dataProvider = dataProvider;
603
	}
604

    
605
	public Boolean getServiceProvider() {
606
		return serviceProvider;
607
	}
608

    
609
	public void setServiceProvider(Boolean serviceProvider) {
610
		this.serviceProvider = serviceProvider;
611
	}
612

    
613
	public String getDatabaseAccessType() {
614
		return databaseAccessType;
615
	}
616

    
617
	public void setDatabaseAccessType(String databaseAccessType) {
618
		this.databaseAccessType = databaseAccessType;
619
	}
620

    
621
	public String getDataUploadType() {
622
		return dataUploadType;
623
	}
624

    
625
	public void setDataUploadType(String dataUploadType) {
626
		this.dataUploadType = dataUploadType;
627
	}
628

    
629
	public String getDatabaseAccessRestriction() {
630
		return databaseAccessRestriction;
631
	}
632

    
633
	public void setDatabaseAccessRestriction(String databaseAccessRestriction) {
634
		this.databaseAccessRestriction = databaseAccessRestriction;
635
	}
636

    
637
	public String getDataUploadRestriction() {
638
		return dataUploadRestriction;
639
	}
640

    
641
	public void setDataUploadRestriction(String dataUploadRestriction) {
642
		this.dataUploadRestriction = dataUploadRestriction;
643
	}
644

    
645
	public Boolean getVersioning() {
646
		return versioning;
647
	}
648

    
649
	public void setVersioning(Boolean versioning) {
650
		this.versioning = versioning;
651
	}
652

    
653
	public String getCitationGuidelineUrl() {
654
		return citationGuidelineUrl;
655
	}
656

    
657
	public void setCitationGuidelineUrl(String citationGuidelineUrl) {
658
		this.citationGuidelineUrl = citationGuidelineUrl;
659
	}
660

    
661
	public String getQualityManagementKind() {
662
		return qualityManagementKind;
663
	}
664

    
665
	public void setQualityManagementKind(String qualityManagementKind) {
666
		this.qualityManagementKind = qualityManagementKind;
667
	}
668

    
669
	public String getPidSystems() {
670
		return pidSystems;
671
	}
672

    
673
	public void setPidSystems(String pidSystems) {
674
		this.pidSystems = pidSystems;
675
	}
676

    
677
	public String getCertificates() {
678
		return certificates;
679
	}
680

    
681
	public void setCertificates(String certificates) {
682
		this.certificates = certificates;
683
	}
684

    
685
	public String getAggregator() {
686
		return aggregator;
687
	}
688

    
689
	public void setAggregator(String aggregator) {
690
		this.aggregator = aggregator;
691
	}
692

    
693
	public String getIssn() {
694
		return issn;
695
	}
696

    
697
	public void setIssn(String issn) {
698
		this.issn = issn;
699
	}
700

    
701
	public String getEissn() {
702
		return eissn;
703
	}
704

    
705
	public void setEissn(String eissn) {
706
		this.eissn = eissn;
707
	}
708

    
709
	public String getLissn() {
710
		return lissn;
711
	}
712

    
713
	public void setLissn(String lissn) {
714
		this.lissn = lissn;
715
	}
716

    
717
	public void setLatitude(Double latitude) {
718
		this.latitude = latitude;
719
	}
720

    
721
	public Boolean isRegistered() {
722
		return registered;
723
	}
724

    
725
	public void setRegistered(Boolean registered) {
726
		this.registered = registered;
727
	}
728

    
729
	public PiwikInfo getPiwikInfo() {
730
		return piwikInfo;
731
	}
732

    
733
	public void setPiwikInfo(PiwikInfo piwikInfo) {
734
		this.piwikInfo = piwikInfo;
735
	}
736
}
(12-12/23)