137 lines
4.5 KiB
Java
137 lines
4.5 KiB
Java
/**
|
|
*
|
|
*/
|
|
package org.gcube.informationsystem.contexts.reference.entities;
|
|
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.UUID;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnyGetter;
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonAnySetter;
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
import org.gcube.informationsystem.base.reference.Element;
|
|
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
|
import org.gcube.informationsystem.base.reference.SchemaMixedElement;
|
|
import org.gcube.informationsystem.base.reference.entities.EntityElement;
|
|
import org.gcube.informationsystem.contexts.impl.entities.ContextImpl;
|
|
import org.gcube.informationsystem.contexts.reference.relations.IsParentOf;
|
|
import org.gcube.informationsystem.model.reference.relations.Relation;
|
|
import org.gcube.informationsystem.serialization.AdditionalPropertiesSerializer;
|
|
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.Version;
|
|
|
|
/**
|
|
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Context
|
|
*
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
@JsonDeserialize(as = ContextImpl.class)
|
|
@JsonPropertyOrder({ Element.TYPE_PROPERTY, IdentifiableElement.ID_PROPERTY, IdentifiableElement.METADATA_PROPERTY})
|
|
@TypeMetadata(name = Context.NAME, description = "This type is the used to define a Context", version = Version.MINIMAL_VERSION_STRING)
|
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
|
public interface Context extends EntityElement, SchemaMixedElement {
|
|
|
|
public static final String NAME = "Context"; // Context.class.getSimpleName();
|
|
|
|
public static final String NAME_PROPERTY = "name";
|
|
public static final String PARENT_PROPERTY = "parent";
|
|
public static final String CHILDREN_PROPERTY = "children";
|
|
|
|
/**
|
|
* {
|
|
* ...
|
|
* "availableAt" : [
|
|
* "https://i-marine.d4science.org/group/alienandinvasivespecies",
|
|
* "https://services.d4science.org/group/alienandinvasivespecies"
|
|
* ]
|
|
* ...
|
|
* }
|
|
* For non VRE context this field could be null or could have multiple value
|
|
* For VRE it is normally one value only (but some exception could exists
|
|
*/
|
|
public static final String AVAILABLE_AT_PROPERTY = "availableAt";
|
|
|
|
//
|
|
/**
|
|
* This information is provided to allowed user only (by role)
|
|
* {
|
|
* ...
|
|
* "fullpaths" : [
|
|
* {
|
|
* "fullpath": "/gcube/devsec/myTest",
|
|
* "time": "2023-12-11 15:35:41.289 +0000", // Same of creationTime in metadata
|
|
* },
|
|
* {
|
|
* "fullpath": "/gcube/devsec/myTestVRE",
|
|
* "time": "2023-12-13 16:13:12.336 +0000",
|
|
* }
|
|
* {
|
|
* "fullpath": "/gcube/devsec/myVRE",
|
|
* "time": "2023-12-18 12:37:48.172 +0000", // Same of lastUpdateTime in metadata
|
|
* }
|
|
* ]
|
|
* ...
|
|
* }
|
|
*/
|
|
public static final String CONTEXT_FULLPATH_CHANGES_LOG_PROPERTY = "fullpathChangelog";
|
|
|
|
/**
|
|
* This information is provided to allowed user only (by role)
|
|
* The symmetric key for the context
|
|
*/
|
|
public static final String CONTEXT_KEY_PROPERTY = "key";
|
|
|
|
|
|
@ISProperty(name = NAME_PROPERTY, mandatory = true, nullable = false)
|
|
public String getName();
|
|
|
|
public void setName(String name);
|
|
|
|
@JsonGetter
|
|
@JsonIgnoreProperties({ Relation.TARGET_PROPERTY })
|
|
public IsParentOf getParent();
|
|
|
|
@JsonIgnore
|
|
public void setParent(UUID uuid);
|
|
|
|
@JsonIgnore
|
|
public void setParent(Context context);
|
|
|
|
@JsonIgnore
|
|
public void setParent(IsParentOf isParentOf);
|
|
|
|
@JsonGetter
|
|
@JsonIgnoreProperties({ Relation.SOURCE_PROPERTY })
|
|
public List<IsParentOf> getChildren();
|
|
|
|
public void addChild(UUID uuid);
|
|
|
|
public void addChild(Context child);
|
|
|
|
public void addChild(IsParentOf isParentOf);
|
|
|
|
@JsonAnyGetter
|
|
@JsonSerialize(using = AdditionalPropertiesSerializer.class)
|
|
@Override
|
|
public Map<String,Object> getAdditionalProperties();
|
|
|
|
@Override
|
|
public void setAdditionalProperties(Map<String,Object> additionalProperties);
|
|
|
|
@Override
|
|
public Object getAdditionalProperty(String key);
|
|
|
|
@JsonAnySetter
|
|
@Override
|
|
public void setAdditionalProperty(String key, Object value);
|
|
|
|
}
|