2017-08-04 15:04:35 +02:00
package org.gcube.data_catalogue.grsf_publish_ws.json.input.record ;
2016-12-01 19:19:22 +01:00
import java.util.List ;
import javax.validation.Valid ;
2017-10-04 17:30:07 +02:00
import javax.validation.constraints.NotNull ;
import javax.validation.constraints.Size ;
2016-12-01 19:19:22 +01:00
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CkanResource ;
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.CustomField ;
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Group ;
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.Tag ;
2017-05-24 16:53:31 +02:00
import org.gcube.data_catalogue.grsf_publish_ws.custom_annotations.TimeSeries ;
2018-01-11 10:30:23 +01:00
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.AnnotationBean ;
2017-10-25 16:45:34 +02:00
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.RefersToBean ;
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.Resource ;
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.SimilarRecordBean ;
import org.gcube.data_catalogue.grsf_publish_ws.json.input.others.TimeSeriesBean ;
2017-10-27 14:37:41 +02:00
import org.gcube.datacatalogue.common.Constants ;
import org.gcube.datacatalogue.common.enums.Sources ;
import org.gcube.datacatalogue.common.enums.Status ;
2016-12-01 19:19:22 +01:00
import com.fasterxml.jackson.annotation.JsonProperty ;
/ * *
* Information that both Stock and Fishery records must contain .
2018-05-10 16:44:48 +02:00
* @author Costantino Perciante ( ISTI - CNR )
* @author Luca Frosini ( ISTI - CNR )
2016-12-01 19:19:22 +01:00
* /
2018-02-26 17:19:34 +01:00
public abstract class Common extends Base {
2017-07-12 18:05:35 +02:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . DATA_OWNER_JSON_KEY )
@CustomField ( key = Constants . DATA_OWNER_CUSTOM_KEY )
2017-07-13 11:50:05 +02:00
private List < String > dataOwner ;
2016-12-01 19:19:22 +01:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . DATABASE_SOURCES_JSON_KEY )
2016-12-01 19:19:22 +01:00
@CkanResource
@Valid
private List < Resource < Sources > > databaseSources ;
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . SOURCES_OF_INFORMATION_JSON_KEY )
2016-12-01 19:19:22 +01:00
@CkanResource
@Valid
private List < Resource < String > > sourceOfInformation ;
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . REFERS_TO_JSON_KEY )
2016-12-01 19:19:22 +01:00
@Valid
private List < RefersToBean > refersTo ;
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . SHORT_NAME_JSON_KEY )
@CustomField ( key = Constants . SHORT_NAME_CUSTOM_KEY )
2017-08-01 11:54:21 +02:00
private String shortName ;
2016-12-01 19:19:22 +01:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . TRACEABILITY_FLAG_JSON_KEY )
@CustomField ( key = Constants . TRACEABILITY_FLAG_CUSTOM_KEY )
2018-02-27 11:53:41 +01:00
@Group ( condition = " true " , groupNameOverValue = Constants . TRACEABILITY_FLAG_GROUP_NAME ) // record is added to group grsf-traceability-flag if Traceability Flag is true
2016-12-01 22:20:46 +01:00
private Boolean traceabilityFlag ;
2016-12-01 19:19:22 +01:00
2018-02-26 17:19:34 +01:00
@JsonProperty ( Constants . SDG_FLAG_JSON_KEY )
@CustomField ( key = Constants . SDG_FLAG_CUSTOM_KEY )
2018-02-27 11:53:41 +01:00
@Group ( condition = " true " , groupNameOverValue = Constants . SDG_FLAG_GROUP_NAME ) // record is added to group grsf-sdg-flag if sdg Flag is true
2018-02-26 17:19:34 +01:00
private Boolean sdgFlag ;
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . STATUS_OF_THE_GRSF_RECORD_JSON_KEY )
@CustomField ( key = Constants . STATUS_OF_THE_GRSF_RECORD_CUSTOM_KEY )
2016-12-01 19:19:22 +01:00
private Status status ;
// automatically compiled
2017-10-27 14:37:41 +02:00
@CustomField ( key = Constants . SYSTEM_TYPE_CUSTOM_KEY )
2017-09-21 14:06:30 +02:00
private String systemType ;
2016-12-03 11:50:38 +01:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . CATCHES_JSON_KEY )
@CustomField ( key = Constants . CATCHES_CUSTOM_KEY )
2017-05-24 16:53:31 +02:00
@TimeSeries
@Valid
2017-06-30 15:32:38 +02:00
private List < TimeSeriesBean < String , String > > catches ;
2017-05-24 16:53:31 +02:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . LANDINGS_JSON_KEY )
@CustomField ( key = Constants . LANDINGS_CUSTOM_KEY )
2017-06-30 15:32:38 +02:00
@TimeSeries
@Valid
private List < TimeSeriesBean < String , String > > landings ;
2017-05-24 16:53:31 +02:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . SPECIES_JSON_KEY )
@CustomField ( key = Constants . SPECIES_CUSTOM_KEY )
2017-10-25 16:45:34 +02:00
@Tag
2017-06-30 15:32:38 +02:00
private List < String > species ;
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . SIMILAR_GRSF_RECORDS_JSON_KEY )
@CustomField ( key = Constants . SIMILAR_GRSF_RECORDS_CUSTOM_KEY )
2017-08-01 10:26:33 +02:00
private List < SimilarRecordBean > similarGRSFRecords ;
2017-09-22 11:29:45 +02:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . SIMILAR_SOURCE_RECORDS_JSON_KEY )
@CustomField ( key = Constants . SIMILAR_SOURCE_RECORDS_CUSTOM_KEY )
2017-08-01 10:26:33 +02:00
private List < SimilarRecordBean > similarSourceRecords ;
2017-12-12 14:28:26 +01:00
2017-10-04 17:30:07 +02:00
// automatically set
2017-10-27 14:37:41 +02:00
@CustomField ( key = Constants . DOMAIN_CUSTOM_KEY )
2017-10-04 17:30:07 +02:00
private String domain ;
2017-12-12 14:28:26 +01:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . UUID_KB_JSON_KEY )
@CustomField ( key = Constants . UUID_KB_CUSTOM_KEY )
2017-10-04 17:30:07 +02:00
@NotNull ( message = " grsf_uuid cannot be null " )
@Size ( min = 1 , message = " grsf_uuid cannot be empty " )
private String uuid ;
2017-12-12 14:28:26 +01:00
2017-10-27 14:37:41 +02:00
@JsonProperty ( Constants . MANAGEMENT_ENTITIES_JSON_KEY )
@CustomField ( key = Constants . MANAGEMENT_ENTITIES_CUSTOM_KEY )
private List < String > managementBodyAuthorities ;
2017-07-14 16:13:10 +02:00
2017-11-28 11:31:27 +01:00
@JsonProperty ( Constants . SPATIAL_GEOJSON_JSON_KEY )
@CustomField ( key = Constants . SPATIAL_GEOJSON_CUSTOM_KEY )
private String spatial ;
2017-12-12 14:28:26 +01:00
@JsonProperty ( Constants . CONNECTED_JSON_KEY )
@CustomField ( key = Constants . CONNECTED_CUSTOM_KEY )
2018-02-01 14:56:47 +01:00
private List < String > connectedBeans ;
2017-12-12 14:28:26 +01:00
2018-01-11 10:30:23 +01:00
@JsonProperty ( Constants . ANNOTATION_PUBLISHER_JSON_KEY )
@CustomField ( key = Constants . ANNOTATION_PUBLISHER_CUSTOM_KEY )
private List < AnnotationBean > annotations ;
2018-05-10 16:44:48 +02:00
@JsonProperty ( Constants . SIMILARITIES_INDICATOR )
@Tag
private String similaritiesIndicator ;
2018-05-16 15:12:15 +02:00
@JsonProperty ( Constants . CONNECTIONS_INDICATOR )
@Tag
private String connectionsIndicator ;
2018-05-10 16:44:48 +02:00
2016-12-01 22:20:46 +01:00
public Common ( ) {
2016-12-01 19:19:22 +01:00
super ( ) ;
}
2017-05-24 16:53:31 +02:00
/ * *
* @param dataOwner
* @param databaseSources
* @param sourceOfInformation
* @param refersTo
2017-08-01 11:54:21 +02:00
* @param shortName
2017-05-24 16:53:31 +02:00
* @param traceabilityFlag
* @param status
2017-10-04 17:30:07 +02:00
* @param systemType
2017-06-30 15:32:38 +02:00
* @param catches
* @param landings
* @param species
2017-08-01 10:26:33 +02:00
* @param similarGRSFRecords
* @param similarSourceRecords
2017-10-04 17:30:07 +02:00
* @param domain
* @param uuid
2017-10-27 14:37:41 +02:00
* @param managementBodyAuthorities
2017-11-28 11:31:27 +01:00
* @param spatial
2018-01-11 10:30:23 +01:00
* @param connectedBeans
* @param annotations
2017-05-24 16:53:31 +02:00
* /
2017-07-13 11:50:05 +02:00
public Common ( List < String > dataOwner ,
List < Resource < Sources > > databaseSources ,
2016-12-01 19:19:22 +01:00
List < Resource < String > > sourceOfInformation ,
2017-08-01 11:54:21 +02:00
List < RefersToBean > refersTo , String shortName ,
2017-09-21 14:06:30 +02:00
Boolean traceabilityFlag , Status status , String systemType ,
2017-07-28 14:48:46 +02:00
List < TimeSeriesBean < String , String > > catches ,
2017-07-14 16:13:10 +02:00
List < TimeSeriesBean < String , String > > landings ,
2017-08-01 10:26:33 +02:00
List < String > species , List < SimilarRecordBean > similarGRSFRecords ,
2017-10-04 17:30:07 +02:00
List < SimilarRecordBean > similarSourceRecords , String domain ,
2018-01-11 10:30:23 +01:00
String uuid , List < String > managementBodyAuthorities ,
2018-02-01 14:56:47 +01:00
String spatial , List < String > connectedBeans ,
2018-01-11 10:30:23 +01:00
List < AnnotationBean > annotations ) {
2016-12-01 19:19:22 +01:00
super ( ) ;
this . dataOwner = dataOwner ;
this . databaseSources = databaseSources ;
this . sourceOfInformation = sourceOfInformation ;
this . refersTo = refersTo ;
2017-08-01 11:54:21 +02:00
this . shortName = shortName ;
2016-12-01 19:19:22 +01:00
this . traceabilityFlag = traceabilityFlag ;
this . status = status ;
2017-09-21 14:06:30 +02:00
this . systemType = systemType ;
2017-06-30 15:32:38 +02:00
this . catches = catches ;
this . landings = landings ;
this . species = species ;
2017-08-01 10:26:33 +02:00
this . similarGRSFRecords = similarGRSFRecords ;
this . similarSourceRecords = similarSourceRecords ;
2017-10-04 17:30:07 +02:00
this . domain = domain ;
this . uuid = uuid ;
2017-10-27 14:37:41 +02:00
this . managementBodyAuthorities = managementBodyAuthorities ;
2017-11-28 11:31:27 +01:00
this . spatial = spatial ;
2018-01-11 10:30:23 +01:00
this . connectedBeans = connectedBeans ;
this . annotations = annotations ;
2017-10-27 14:37:41 +02:00
}
public List < String > getManagementBodyAuthorities ( ) {
return managementBodyAuthorities ;
}
public void setManagementBodyAuthorities ( List < String > managementBodyAuthorities ) {
this . managementBodyAuthorities = managementBodyAuthorities ;
2017-10-04 17:30:07 +02:00
}
public String getDomain ( ) {
return domain ;
}
public void setDomain ( String domain ) {
this . domain = domain ;
}
public String getUuid ( ) {
return uuid ;
}
public void setUuid ( String uuid ) {
this . uuid = uuid ;
2017-02-17 18:05:41 +01:00
}
2017-09-21 14:06:30 +02:00
public String getSystemType ( ) {
return systemType ;
2017-02-17 18:05:41 +01:00
}
2017-09-21 14:06:30 +02:00
public void setSystemType ( String systemType ) {
this . systemType = systemType ;
2016-12-03 11:50:38 +01:00
}
public Boolean getTraceabilityFlag ( ) {
return traceabilityFlag ;
2016-12-01 19:19:22 +01:00
}
public List < RefersToBean > getRefersTo ( ) {
return refersTo ;
}
public void setRefersTo ( List < RefersToBean > refersTo ) {
this . refersTo = refersTo ;
}
public List < Resource < Sources > > getDatabaseSources ( ) {
return databaseSources ;
}
public void setDatabaseSources ( List < Resource < Sources > > databaseSources ) {
this . databaseSources = databaseSources ;
}
public List < Resource < String > > getSourceOfInformation ( ) {
return sourceOfInformation ;
}
public void setSourceOfInformation ( List < Resource < String > > sourceOfInformation ) {
this . sourceOfInformation = sourceOfInformation ;
}
2017-08-01 11:54:21 +02:00
public String getShortName ( ) {
return shortName ;
2016-12-01 19:19:22 +01:00
}
2017-08-01 11:54:21 +02:00
public void setShortName ( String shortName ) {
this . shortName = shortName ;
2016-12-01 19:19:22 +01:00
}
2016-12-01 22:20:46 +01:00
public Boolean isTraceabilityFlag ( ) {
2016-12-01 19:19:22 +01:00
return traceabilityFlag ;
}
2016-12-01 22:20:46 +01:00
public void setTraceabilityFlag ( Boolean traceabilityFlag ) {
2016-12-01 19:19:22 +01:00
this . traceabilityFlag = traceabilityFlag ;
}
public Status getStatus ( ) {
return status ;
}
public void setStatus ( Status status ) {
this . status = status ;
}
2017-06-30 15:32:38 +02:00
public List < String > getSpecies ( ) {
return species ;
}
public void setSpecies ( List < String > species ) {
this . species = species ;
}
public List < TimeSeriesBean < String , String > > getCatches ( ) {
return catches ;
}
public void setCatches ( List < TimeSeriesBean < String , String > > catches ) {
this . catches = catches ;
}
2017-02-17 18:05:41 +01:00
2017-06-30 15:32:38 +02:00
public List < TimeSeriesBean < String , String > > getLandings ( ) {
return landings ;
2017-05-24 16:53:31 +02:00
}
2017-06-30 15:32:38 +02:00
public void setLandings ( List < TimeSeriesBean < String , String > > landings ) {
this . landings = landings ;
2017-05-24 16:53:31 +02:00
}
2017-07-13 11:50:05 +02:00
public List < String > getDataOwner ( ) {
return dataOwner ;
2017-05-24 16:53:31 +02:00
}
2017-07-13 11:50:05 +02:00
public void setDataOwner ( List < String > dataOwner ) {
this . dataOwner = dataOwner ;
2017-05-24 16:53:31 +02:00
}
2017-08-01 10:26:33 +02:00
public List < SimilarRecordBean > getSimilarGRSFRecords ( ) {
return similarGRSFRecords ;
2017-07-14 16:13:10 +02:00
}
2017-08-01 10:26:33 +02:00
public void setSimilarGRSFRecords ( List < SimilarRecordBean > similarGRSFRecords ) {
this . similarGRSFRecords = similarGRSFRecords ;
}
public List < SimilarRecordBean > getSimilarSourceRecords ( ) {
return similarSourceRecords ;
}
public void setSimilarSourceRecords ( List < SimilarRecordBean > similarSourceRecords ) {
this . similarSourceRecords = similarSourceRecords ;
2017-07-14 16:13:10 +02:00
}
2017-11-28 11:31:27 +01:00
public String getSpatial ( ) {
return spatial ;
}
public void setSpatial ( String spatial ) {
this . spatial = spatial ;
}
2018-02-01 14:56:47 +01:00
public List < String > getConnectedBeans ( ) {
2017-12-12 14:28:26 +01:00
return connectedBeans ;
}
2018-02-01 14:56:47 +01:00
public void setConnectedBeans ( List < String > connectedBeans ) {
2017-12-12 14:28:26 +01:00
this . connectedBeans = connectedBeans ;
}
2018-01-11 10:30:23 +01:00
public List < AnnotationBean > getAnnotations ( ) {
return annotations ;
}
public void setAnnotations ( List < AnnotationBean > annotations ) {
this . annotations = annotations ;
}
2018-02-26 17:19:34 +01:00
public Boolean getSdgFlag ( ) {
return sdgFlag ;
}
public void setSdgFlag ( Boolean sdgFlag ) {
this . sdgFlag = sdgFlag ;
}
2018-05-10 16:44:48 +02:00
public String getSimilaritiesIndicator ( ) {
return similaritiesIndicator ;
}
public void setSimilaritiesIndicator ( String similaritiesIndicator ) {
this . similaritiesIndicator = similaritiesIndicator ;
}
2016-12-01 19:19:22 +01:00
@Override
public String toString ( ) {
2017-07-27 16:45:18 +02:00
return " Common [dataOwner= " + dataOwner + " , databaseSources= "
+ databaseSources + " , sourceOfInformation= "
+ sourceOfInformation + " , refersTo= " + refersTo
2017-08-01 11:54:21 +02:00
+ " , shortName= " + shortName + " , traceabilityFlag= "
2018-02-26 17:19:34 +01:00
+ traceabilityFlag + " , sdgFlag= " + sdgFlag + " , status= "
+ status + " , systemType= " + systemType + " , catches= "
+ catches + " , landings= " + landings + " , species= " + species
+ " , similarGRSFRecords= " + similarGRSFRecords
+ " , similarSourceRecords= " + similarSourceRecords
+ " , domain= " + domain + " , uuid= " + uuid
+ " , managementBodyAuthorities= " + managementBodyAuthorities
+ " , spatial= " + spatial + " , connectedBeans= " + connectedBeans
+ " , annotations= " + annotations + " ] " ;
2016-12-01 19:19:22 +01:00
}
2017-07-12 18:05:35 +02:00
}