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

66 lines
2.6 KiB
Java

/**
*
*/
package org.gcube.informationsystem.model.reference.properties;
import java.util.Date;
import java.util.UUID;
import org.gcube.com.fasterxml.jackson.annotation.JsonFormat;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.base.reference.Element;
import org.gcube.informationsystem.model.impl.properties.HeaderImpl;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.reference.Change;
import org.gcube.informationsystem.types.reference.TypeMetadata;
import org.gcube.informationsystem.utils.TypeVersion;
/**
* @author Luca Frosini (ISTI - CNR)
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Header
*/
@JsonDeserialize(as=HeaderImpl.class)
@TypeMetadata(name = Header.NAME, description = "This class provides metadata per every IdentifiableElement", version = TypeVersion.MINIMAL_VERSION_STRING)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
public interface Header extends Property {
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";
public static final String CREATOR_PROPERTY = "creator";
public static final String MODIFIED_BY_PROPERTY = "modifiedBy";
public static final String CREATION_TIME_PROPERTY = "creationTime";
public static final String LAST_UPDATE_TIME_PROPERTY = "lastUpdateTime";
/**
* 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";
@ISProperty(name = UUID_PROPERTY, readonly = true, mandatory = true, nullable = false)
public UUID getUUID();
public void setUUID(UUID uuid);
@ISProperty(name = CREATOR_PROPERTY, readonly = true, mandatory = true, nullable = false)
public String getCreator();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = CREATION_TIME_PROPERTY, readonly = true, mandatory = true, nullable = false)
public Date getCreationTime();
@ISProperty(name = MODIFIED_BY_PROPERTY, mandatory = true, nullable = false)
public String getModifiedBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = LAST_UPDATE_TIME_PROPERTY, mandatory = true, nullable = false)
public Date getLastUpdateTime();
}