2019-03-22 15:18:23 +01:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2021-10-25 11:38:06 +02:00
|
|
|
package org.gcube.informationsystem.contexts.reference.entities;
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.UUID;
|
|
|
|
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
|
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
2023-05-04 18:12:19 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonPropertyOrder;
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
2023-05-04 18:12:19 +02:00
|
|
|
import org.gcube.informationsystem.base.reference.Element;
|
|
|
|
import org.gcube.informationsystem.base.reference.IdentifiableElement;
|
2020-01-30 10:26:43 +01:00
|
|
|
import org.gcube.informationsystem.base.reference.entities.EntityElement;
|
2021-10-25 11:38:06 +02:00
|
|
|
import org.gcube.informationsystem.contexts.impl.entities.ContextImpl;
|
|
|
|
import org.gcube.informationsystem.contexts.reference.relations.IsParentOf;
|
2019-03-22 15:18:23 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.relations.Relation;
|
|
|
|
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:03:02 +01:00
|
|
|
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Context
|
2021-01-20 17:26:13 +01:00
|
|
|
*
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2019-03-22 15:18:23 +01:00
|
|
|
*/
|
|
|
|
@JsonDeserialize(as = ContextImpl.class)
|
2023-05-04 18:12:19 +02:00
|
|
|
@JsonPropertyOrder({ IdentifiableElement.ID_PROPERTY, Element.TYPE_PROPERTY, IdentifiableElement.METADATA_PROPERTY})
|
2023-04-26 21:39:57 +02:00
|
|
|
@TypeMetadata(name = Context.NAME, description = "This type is the used to define a Context", 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-30 10:26:43 +01:00
|
|
|
public interface Context extends EntityElement {
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
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";
|
|
|
|
|
|
|
|
@ISProperty(name = NAME_PROPERTY, mandatory = true, nullable = false)
|
|
|
|
public String getName();
|
|
|
|
|
|
|
|
public void setName(String name);
|
|
|
|
|
|
|
|
@JsonGetter
|
|
|
|
@JsonIgnoreProperties({ Relation.TARGET_PROPERTY })
|
2019-11-04 18:06:46 +01:00
|
|
|
public IsParentOf getParent();
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
@JsonIgnore
|
|
|
|
public void setParent(UUID uuid);
|
|
|
|
|
|
|
|
@JsonIgnore
|
|
|
|
public void setParent(Context context);
|
|
|
|
|
|
|
|
@JsonIgnore
|
2019-11-04 18:06:46 +01:00
|
|
|
public void setParent(IsParentOf isParentOf);
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
@JsonGetter
|
|
|
|
@JsonIgnoreProperties({ Relation.SOURCE_PROPERTY })
|
2019-11-04 18:06:46 +01:00
|
|
|
public List<IsParentOf> getChildren();
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
public void addChild(UUID uuid);
|
|
|
|
|
|
|
|
public void addChild(Context child);
|
|
|
|
|
2019-11-04 18:06:46 +01:00
|
|
|
public void addChild(IsParentOf isParentOf);
|
2019-03-22 15:18:23 +01:00
|
|
|
|
|
|
|
}
|