Documenting types

This commit is contained in:
Luca Frosini 2020-12-21 14:24:06 +01:00
parent fcf73ad9bc
commit 9438dd07fb
4 changed files with 38 additions and 54 deletions

View File

@ -3,11 +3,10 @@
*/
package org.gcube.resourcemanagement.model.impl.entities.facets;
import java.net.URI;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.model.impl.entities.FacetImpl;
import org.gcube.resourcemanagement.model.reference.entities.facets.SubjectFacet;
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
/**
* @author Luca Frosini (ISTI - CNR)
@ -20,41 +19,16 @@ public class SubjectFacetImpl extends FacetImpl implements SubjectFacet {
*/
private static final long serialVersionUID = -266229852500187672L;
protected String value;
protected URI schema;
protected ValueSchema subject;
/**
* @return the value
*/
@Override
public String getValue() {
return value;
public ValueSchema getSubject() {
return subject;
}
/**
* @param value the value to set
*/
@Override
public void setValue(String value) {
this.value = value;
}
/**
* @return the schema
*/
@Override
public URI getSchema() {
return schema;
}
/**
* @param schema the schema to set
*/
@Override
public void setSchema(URI schema) {
this.schema = schema;
public void setSubject(ValueSchema subject) {
this.subject = subject;
}
}
}

View File

@ -3,8 +3,6 @@
*/
package org.gcube.resourcemanagement.model.reference.entities.facets;
import java.net.URI;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.model.reference.entities.Facet;
import org.gcube.informationsystem.types.annotations.ISProperty;
@ -12,15 +10,21 @@ import org.gcube.informationsystem.types.reference.Change;
import org.gcube.informationsystem.types.reference.TypeMetadata;
import org.gcube.informationsystem.utils.TypeVersion;
import org.gcube.resourcemanagement.model.impl.entities.facets.SubjectFacetImpl;
import org.gcube.resourcemanagement.model.reference.properties.ValueSchema;
/**
* @author Luca Frosini (ISTI - CNR)
* SubjectFacet captures information on subjects associated with the resource for
* description, classification and discovery purposes.
*
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Subject_Facet
*
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=SubjectFacetImpl.class)
@TypeMetadata(
name = SubjectFacet.NAME,
description = "Collect any \"extent\"-related information.",
description = "SubjectFacet captures information on subjects associated with "
+ "the resource for description, classification and discovery purposes.",
version = TypeVersion.MINIMAL_VERSION_STRING
)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
@ -28,14 +32,9 @@ public interface SubjectFacet extends Facet {
public static final String NAME = "SubjectFacet"; // SubjectFacet.class.getSimpleName();
@ISProperty(mandatory=true, nullable=false)
public String getValue();
@ISProperty(description = "The value of the subject according to the schema", mandatory=true, nullable=false)
public ValueSchema getSubject();
public void setValue(String value);
public void setSubject(ValueSchema subject);
@ISProperty(mandatory=true, nullable=false)
public URI getSchema();
public void setSchema(URI schema);
}
}

View File

@ -11,13 +11,14 @@ import org.gcube.resourcemanagement.model.reference.entities.resources.Service;
/**
* An action triggered when a {@link Service} is deactivated.
*
* @author Manuele Simi (ISTI CNR)
* @author Manuele Simi (ISTI - CNR)
* @author Luca Frosini (ISTI - CNR)
*
*/
@JsonDeserialize(as=HasRemoveActionImpl.class)
@TypeMetadata(
name = .NAME,
description = "",
name = HasRemoveAction.NAME,
description = "An action triggered when a {@link Service} is deactivated.",
version = TypeVersion.MINIMAL_VERSION_STRING
)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
@ -26,4 +27,4 @@ extends HasAction<Out, In> {
public static final String NAME = "HasRemoveAction";
}
}

View File

@ -13,13 +13,23 @@ import org.gcube.informationsystem.utils.TypeVersion;
import org.gcube.resourcemanagement.model.impl.relations.consistsof.IsIdentifiedByImpl;
/**
* Each gCube resource has been defined to have at least a Facet linked with an IsIdentifiedBy relation.
* IsIdentifiedBy indicates that the target facet represents a sort of identification for the source resource.
*
* For instance, a software can consist of one or more SoftwareFacets but the one related with
* IsIdentifiedBy represents the identify of the software.
*
* @author Luca Frosini (ISTI - CNR)
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#isIdentifiedBy
*
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#IsIdentifiedBy
*/
@JsonDeserialize(as=IsIdentifiedByImpl.class)
@TypeMetadata(
name = .NAME,
description = "",
name = IsIdentifiedBy.NAME,
description = "Each gCube resource has been defined to have at least a Facet linked with an IsIdentifiedBy relation.\n"
+ "IsIdentifiedBy indicates that the target facet represents a sort of identification for the source resource.\n"
+ "For instance, a software can consist of one or more SoftwareFacets but the one related with "
+ "IsIdentifiedBy represents the identify of the software.",
version = TypeVersion.MINIMAL_VERSION_STRING
)
@Change(version = TypeVersion.MINIMAL_VERSION_STRING, description = TypeVersion.MINIMAL_VERSION_DESCRIPTION)
@ -28,4 +38,4 @@ public interface IsIdentifiedBy<S extends Resource, T extends Facet>
public static final String NAME = "IsIdentifiedBy"; //IsIdentifiedBy.class.getSimpleName();
}
}