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 ;
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 ;
2023-04-18 17:51:23 +02:00
import org.gcube.informationsystem.model.impl.properties.MetadataImpl ;
2023-01-24 19:52:18 +01:00
import org.gcube.informationsystem.types.annotations.Final ;
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
/ * *
2021-01-20 17:26:13 +01:00
* @author Luca Frosini ( ISTI - CNR )
2019-03-22 15:18:23 +01:00
* /
2023-04-18 17:51:23 +02:00
@JsonDeserialize ( as = MetadataImpl . class )
@TypeMetadata ( name = Metadata . 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 )
2023-01-24 19:52:18 +01:00
@Final
2023-04-18 17:51:23 +02:00
public interface Metadata extends Property {
2019-03-22 15:18:23 +01:00
2023-04-18 17:51:23 +02:00
public static final String NAME = " Metadata " ; // Metadata.class.getSimpleName();
2019-03-22 15:18:23 +01:00
/ * *
* Used to set Creator when the user is not known
* /
public static final String UNKNOWN_USER = " UNKNOWN_USER " ;
2023-05-10 17:29:54 +02:00
public static final String HIDDEN_FOR_PRIVACY_USER = " HIDDEN_FOR_PRIVACY " ;
2019-03-22 15:18:23 +01:00
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 " ;
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
2019-03-22 15:18:23 +01:00
}