information-system-model/src/main/java/org/gcube/informationsystem/model/reference/properties/Metadata.java

54 lines
2.7 KiB
Java
Raw Normal View History

/**
*
*/
2020-01-20 10:24:55 +01:00
package org.gcube.informationsystem.model.reference.properties;
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;
import org.gcube.informationsystem.types.annotations.Final;
import org.gcube.informationsystem.types.annotations.ISProperty;
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;
/**
2021-01-20 17:26:13 +01:00
* @author Luca Frosini (ISTI - CNR)
*/
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)
@Final
2023-04-18 17:51:23 +02:00
public interface Metadata extends Property {
2023-04-18 17:51:23 +02:00
public static final String NAME = "Metadata"; // Metadata.class.getSimpleName();
/**
* 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";
2021-03-08 11:18:24 +01:00
public static final String CREATED_BY_PROPERTY = "createdBy";
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";
public static final String LAST_UPDATE_TIME_PROPERTY = "lastUpdateTime";
@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();
2020-02-04 09:44:10 +01:00
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = CREATION_TIME_PROPERTY, description = "Creation time. It is represented in the format " + Element.DATETIME_PATTERN + ".", readonly = true, mandatory = true, nullable = false)
public Date getCreationTime();
@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();
2020-02-04 09:44:10 +01:00
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@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)
public Date getLastUpdateTime();
}