2019-03-22 15:18:23 +01:00
/ * *
*
* /
2020-01-20 10:24:55 +01:00
package org.gcube.informationsystem.model.reference.properties ;
2019-03-22 15:18:23 +01:00
import java.util.Date ;
import java.util.UUID ;
2020-07-07 17:04:25 +02:00
import org.gcube.com.fasterxml.jackson.annotation.JsonFormat ;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize ;
2020-02-04 09:44:10 +01:00
import org.gcube.informationsystem.base.reference.Element ;
2020-01-20 10:24:55 +01:00
import org.gcube.informationsystem.model.impl.properties.HeaderImpl ;
2019-03-22 15:18:23 +01:00
import org.gcube.informationsystem.types.annotations.ISProperty ;
2020-12-15 11:28:34 +01:00
import org.gcube.informationsystem.types.reference.Change ;
import org.gcube.informationsystem.types.reference.TypeMetadata ;
2021-10-21 10:11:45 +02:00
import org.gcube.informationsystem.utils.Version ;
2019-03-22 15:18:23 +01:00
/ * *
* https : //wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Header
2021-01-20 17:26:13 +01:00
*
* @author Luca Frosini ( ISTI - CNR )
2019-03-22 15:18:23 +01:00
* /
@JsonDeserialize ( as = HeaderImpl . class )
2023-01-20 11:22:52 +01:00
@TypeMetadata ( name = Header . NAME , description = " This type provides metadata per every IdentifiableElement " , version = Version . MINIMAL_VERSION_STRING )
2021-10-21 10:11:45 +02:00
@Change ( version = Version . MINIMAL_VERSION_STRING , description = Version . MINIMAL_VERSION_DESCRIPTION )
2020-01-20 10:24:55 +01:00
public interface Header extends Property {
2019-03-22 15:18:23 +01:00
public static final String NAME = " Header " ; // Header.class.getSimpleName();
/ * *
* Used to set Creator when the user is not known
* /
public static final String UNKNOWN_USER = " UNKNOWN_USER " ;
public static final String UUID_PROPERTY = " uuid " ;
2021-03-08 11:18:24 +01:00
public static final String CREATED_BY_PROPERTY = " createdBy " ;
2019-03-22 15:18:23 +01:00
public static final String CREATION_TIME_PROPERTY = " creationTime " ;
2021-03-08 11:18:24 +01:00
public static final String LAST_UPDATE_BY_PROPERTY = " lastUpdateBy " ;
2019-03-22 15:18:23 +01:00
public static final String LAST_UPDATE_TIME_PROPERTY = " lastUpdateTime " ;
2020-11-09 15:46:01 +01:00
/ * *
* Used when requested to include contexts in header .
* This is not a native property ( it is just generated by server for administration clients convenience )
* /
public static final String __CONTEXTS = " contexts " ;
2023-01-20 11:22:52 +01:00
@ISProperty ( name = CREATED_BY_PROPERTY , description = " The user that created the Entity or the Relation. It is initialized at Creation Time. " , readonly = true , mandatory = true , nullable = false )
2021-03-08 11:18:24 +01:00
public String getCreatedBy ( ) ;
2019-03-22 15:18:23 +01:00
2020-02-04 09:44:10 +01:00
@JsonFormat ( shape = JsonFormat . Shape . STRING , pattern = Element . DATETIME_PATTERN )
2023-01-20 11:22:52 +01:00
@ISProperty ( name = CREATION_TIME_PROPERTY , description = " Creation time. It is represented in the format " + Element . DATETIME_PATTERN + " . " , readonly = true , mandatory = true , nullable = false )
2019-03-22 15:18:23 +01:00
public Date getCreationTime ( ) ;
2023-01-20 11:22:52 +01:00
@ISProperty ( name = LAST_UPDATE_BY_PROPERTY , description = " The user that made the last update to the Entity or the Relation. At Creation Time, it assumes the same value of " + CREATED_BY_PROPERTY + " . " , mandatory = true , nullable = false )
2021-03-08 11:18:24 +01:00
public String getLastUpdateBy ( ) ;
2019-03-22 15:18:23 +01:00
2020-02-04 09:44:10 +01:00
@JsonFormat ( shape = JsonFormat . Shape . STRING , pattern = Element . DATETIME_PATTERN )
2023-01-20 11:22:52 +01:00
@ISProperty ( name = LAST_UPDATE_TIME_PROPERTY , description = " Last Update time. At creation time it assumes the same value of " + CREATION_TIME_PROPERTY + " . It is represented in the format " + Element . DATETIME_PATTERN , mandatory = true , nullable = false )
2019-03-22 15:18:23 +01:00
public Date getLastUpdateTime ( ) ;
2023-01-20 11:22:52 +01:00
@ISProperty ( name = UUID_PROPERTY , description = " This UUID is be used to identify the Entity or the Relation univocally. " , readonly = true , mandatory = true , nullable = false )
public UUID getUUID ( ) ;
public void setUUID ( UUID uuid ) ;
2019-03-22 15:18:23 +01:00
}