diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Actor.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Actor.java index 3b2eaec..03c7a26 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Actor.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Actor.java @@ -20,11 +20,13 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; */ @Abstract @JsonDeserialize(as=ActorImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=ContactFacet.class, min=1), - @ResourceSchemaEntry(consistOfType=HasContact.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(targetFacetType=ContactReferenceFacet.class) -}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=ContactFacet.class, min=1, description=" An Actor has at least a Contact Facet which permit to identify the Actor per se. "), + @ResourceSchemaEntry(relation=HasContact.class, facet=ContactFacet.class, description=" An Actor can have other Contact Facets which provide secondary contact information. "), + @ResourceSchemaEntry(facet=ContactReferenceFacet.class) + } +) public interface Actor extends GCubeResource { public static final String NAME = "Actor"; // Actor.class.getSimpleName(); diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConcreteDataset.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConcreteDataset.java index 44da8fb..4164d58 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConcreteDataset.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConcreteDataset.java @@ -18,14 +18,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Concrete_Dataset */ @JsonDeserialize(as=ConcreteDatasetImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=HasMaintainer.class, targetFacetType=ContactFacet.class, min=1), - @ResourceSchemaEntry(targetFacetType=AccessPointFacet.class, min=1) -}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=HasMaintainer.class, facet=ContactFacet.class, min=1, description="The contact information of the entity responsible for the maintenance of the concrete dataset"), + @ResourceSchemaEntry(facet=AccessPointFacet.class, min=1, description="The access point to use for having access to the concrete dataset. The embargoState can be modeled through the access policy defined in the consistsOf relation.") + } +) public interface ConcreteDataset extends Dataset { public static final String NAME = "ConcreteDataset"; // ConcreteDataset.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Dataset information through the list of its facets"; + public static final String DESCRIPTION = "Any incarnation/manifestation of a dataset or part of it"; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Configuration.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Configuration.java index d55dfe5..5b66a2c 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Configuration.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Configuration.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; public interface Configuration extends ConfigurationTemplate { public static final String NAME = "Configuration"; // Configuration.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Configuration information through the list of its facets"; + public static final String DESCRIPTION = "An instance of a configuration template characterising the behaviour and shape of the resource it is attached to."; public static final String VERSION = "1.0.0"; } \ No newline at end of file diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConfigurationTemplate.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConfigurationTemplate.java index bde16ec..17af0de 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConfigurationTemplate.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/ConfigurationTemplate.java @@ -7,7 +7,7 @@ import org.gcube.informationsystem.types.annotations.ResourceSchema; import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.ConfigurationTemplateImpl; import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet; -import org.gcube.resourcemanagement.model.reference.entities.facets.SimpleFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.SimplePropertyFacet; import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -17,10 +17,12 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Configuration_Template */ @JsonDeserialize(as=ConfigurationTemplateImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=IdentifierFacet.class, min=1), - @ResourceSchemaEntry(targetFacetType=SimpleFacet.class, min=1) -}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=IdentifierFacet.class, min=1), + @ResourceSchemaEntry(facet=SimplePropertyFacet.class, min=1) + } +) public interface ConfigurationTemplate extends GCubeResource { public static final String NAME = "ConfigurationTemplate"; //ConfigurationTemplate.class.getSimpleName(); diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Dataset.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Dataset.java index 60e6db0..eecebbf 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Dataset.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Dataset.java @@ -32,29 +32,31 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * @author Luca Frosini (ISTI - CNR) * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Dataset */ -@JsonDeserialize(as=DatasetImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=IdentifierFacet.class, min=1), - @ResourceSchemaEntry(consistOfType=HasContact.class, targetFacetType=ContactFacet.class, min=1), - @ResourceSchemaEntry(consistOfType=HasContributor.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(consistOfType=HasCreator.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(consistOfType=HasCurator.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(consistOfType=HasMaintainer.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(consistOfType=HasOwner.class, targetFacetType=ContactFacet.class), - @ResourceSchemaEntry(targetFacetType=AccessPointFacet.class), - @ResourceSchemaEntry(targetFacetType=LicenseFacet.class), - @ResourceSchemaEntry(targetFacetType=EventFacet.class), - @ResourceSchemaEntry(targetFacetType=ProvenanceFacet.class), - @ResourceSchemaEntry(consistOfType=HasCoverage.class, targetFacetType=CoverageFacet.class, min=1), - @ResourceSchemaEntry(consistOfType=HasTemporalCoverage.class, targetFacetType=CoverageFacet.class), - @ResourceSchemaEntry(consistOfType=HasSpatialCoverage.class, targetFacetType=CoverageFacet.class), - @ResourceSchemaEntry(targetFacetType=DescriptiveMetadataFacet.class), - @ResourceSchemaEntry(targetFacetType=SubjectFacet.class) -}) +@JsonDeserialize(as = DatasetImpl.class) +@ResourceSchema( + facets = { + @ResourceSchemaEntry(relation = IsIdentifiedBy.class, facet = IdentifierFacet.class, min = 1, description = "The set of Identifiers associated with the Dataset instance."), + @ResourceSchemaEntry(relation = HasContact.class, facet = ContactFacet.class, min = 1, description = "The contact information of the entity responsible for the dataset."), + @ResourceSchemaEntry(relation = HasContributor.class, facet = ContactFacet.class, description = "The contact information on contributors supporting the creation and development of the Dataset."), + @ResourceSchemaEntry(relation = HasCreator.class, facet = ContactFacet.class, description = " The contact information of the creator of the Dataset."), + @ResourceSchemaEntry(relation = HasCurator.class, facet = ContactFacet.class, description = " The contact information of the entity responsible for the curation of the dataset."), + @ResourceSchemaEntry(relation = HasMaintainer.class, facet = ContactFacet.class, description = "The contact information of the entity responsible for the maintenance of the dataset."), + @ResourceSchemaEntry(relation = HasOwner.class, facet = ContactFacet.class, description = "The contact information of the entity having the ownership of the dataset."), + @ResourceSchemaEntry(facet = AccessPointFacet.class, description = "The access point to use for having access to the dataset. The embargoState can be modeled through the access policy defined in the consistsOf relation."), + @ResourceSchemaEntry(facet = LicenseFacet.class, description = "The licence governing dataset exploitation. The duration of license (if any) is captured by the expiry date defined in the consistsOf relation."), + @ResourceSchemaEntry(facet = EventFacet.class, description = "Any 'event' characterising the lifecycle of the dataset, e.g. collection date, last collection date."), + @ResourceSchemaEntry(facet = ProvenanceFacet.class, description = "Any provenance record associated with the dataset."), + @ResourceSchemaEntry(relation = HasCoverage.class, facet = CoverageFacet.class, min = 1, description = "Any coverage related information (e.g. topic, species) characterising the content of the dataset."), + @ResourceSchemaEntry(relation = HasTemporalCoverage.class, facet = CoverageFacet.class, description = "Any temporal coverage information characterising the content of the dataset, e.g. the time-span covered by the dataset."), + @ResourceSchemaEntry(relation = HasSpatialCoverage.class, facet = CoverageFacet.class, description = "Any geo-spatial coverage information characterising the content of the dataset, e.g. the area covered by the dataset."), + @ResourceSchemaEntry(facet = DescriptiveMetadataFacet.class, description = "Any descriptive information associated with the dataset, e.g. for discovery purposes."), + @ResourceSchemaEntry(facet = SubjectFacet.class, description = "Any subject/tag associated with the dataset for descriptive and discovery purposes.") + } +) public interface Dataset extends GCubeResource { - + public static final String NAME = "Dataset"; // Dataset.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Dataset information through the list of its facets"; + public static final String DESCRIPTION = "Any set of digital objects representing data and treated collectively as a unit."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/EService.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/EService.java index 74efa50..3224376 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/EService.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/EService.java @@ -19,19 +19,21 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * @author Luca Frosini (ISTI - CNR) * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#E-Service */ -@JsonDeserialize(as=EServiceImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=SoftwareFacet.class, min=1), - @ResourceSchemaEntry(targetFacetType=SoftwareFacet.class), - @ResourceSchemaEntry(targetFacetType=AccessPointFacet.class, min=1), - @ResourceSchemaEntry(targetFacetType=EventFacet.class, min=1, max=1), - @ResourceSchemaEntry(targetFacetType=ServiceStateFacet.class, min=1, max=1), - @ResourceSchemaEntry(targetFacetType=LicenseFacet.class) -}) +@JsonDeserialize(as = EServiceImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation = IsIdentifiedBy.class, facet = SoftwareFacet.class, min = 1, description = "The main software enabling the EService capabilities."), + @ResourceSchemaEntry(facet = SoftwareFacet.class, description = "Software available in the EService environment that characterizes the specific EService instance."), + @ResourceSchemaEntry(facet = AccessPointFacet.class, min = 1, description = "Identify the endpoints of the EService."), + @ResourceSchemaEntry(facet = EventFacet.class, min = 1, description = "Events characterising the current status and lifecycle of the service, e.g. ActivationTime, DeploymentTime."), + @ResourceSchemaEntry(facet = ServiceStateFacet.class, min = 1, max = 1, description = "The current status of the EService, e.g. STARTED, ready, down, failed."), + @ResourceSchemaEntry(facet = LicenseFacet.class, description = "The specific terms of use governing the exploitation of the EService.") + } +) public interface EService extends Service { public static final String NAME = "EService"; // EService.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Electronic Service (aka Running Service) information through the list of its facets"; + public static final String DESCRIPTION = "Any Electronic Service (aka Running Service) that is registered in the infrastructure and made available by an Access Point."; public static final String VERSION = "1.0.0"; public static EService getInstance() { diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/GCubeResource.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/GCubeResource.java index 3568e2f..f40ae25 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/GCubeResource.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/GCubeResource.java @@ -18,7 +18,11 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; */ @Abstract @JsonDeserialize(as=GCubeResourceImpl.class) -@ResourceSchema({@ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, min=1)}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, min=1, description=" Any Resource has at least one Facet which in some way allow to identify the Resource per se.") + } +) public interface GCubeResource extends Resource { public static final String NAME = "GCubeResource"; // GCubeResource.class.getSimpleName(); diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/HostingNode.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/HostingNode.java index a752c3a..d4b18fc 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/HostingNode.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/HostingNode.java @@ -3,7 +3,19 @@ */ package org.gcube.resourcemanagement.model.reference.entities.resources; +import org.gcube.informationsystem.types.annotations.ResourceSchema; +import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.HostingNodeImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.ContainerStateFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.EventFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.SimplePropertyFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasVolatileMemory; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -12,10 +24,22 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Hosting_Node */ @JsonDeserialize(as=HostingNodeImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=NetworkingFacet.class, min=1, description="The Network ID characterising the Hosting Node."), + @ResourceSchemaEntry(facet=CPUFacet.class, min=1, description="The CPU equipping the Hosting Node."), + @ResourceSchemaEntry(relation=HasPersistentMemory.class, facet=MemoryFacet.class, min=1, description="The Disk Space Capacity of the Hosting Node."), + @ResourceSchemaEntry(relation=HasVolatileMemory.class, facet=MemoryFacet.class, min=1, description="The RAM Capacity of the Hosting Node."), + @ResourceSchemaEntry(facet=EventFacet.class, min=1, description="Every event characterizing the life cycle of the Hosting Node, e.g. the activation time."), + @ResourceSchemaEntry(facet=ContainerStateFacet.class, min=1, max=1, description="The current state of the Hosting Node, e.g. started, ready, certified, down, failed."), + @ResourceSchemaEntry(facet=SimplePropertyFacet.class, description="Any pair property worth associating with the Hosting Node, e.g. Environment Variables"), + @ResourceSchemaEntry(facet=SoftwareFacet.class, description=" Any Software characterising the Hosting Node. Useful to report the hosted software that are not registered in the Resource Registry as Software Resource, e.g. Operating System") + } +) public interface HostingNode extends Service { public static final String NAME = "HostingNode"; //HostingNode.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Hosting Node information through the list of its facets"; + public static final String DESCRIPTION = "The HostingNode represent a container capable of managing the lifecycle of an electronic service, i.e., being capable to host and operate an EService."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/LegalBody.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/LegalBody.java index d4062d3..19a25a3 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/LegalBody.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/LegalBody.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; public interface LegalBody extends Actor { public static final String NAME = "LegalBody"; // LegalBody.class.getSimpleName(); - public static final String DESCRIPTION = "Actor"; + public static final String DESCRIPTION = "A legal entity playing the role of an Actor."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Person.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Person.java index 3404d7a..4c82e2b 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Person.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Person.java @@ -16,7 +16,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; public interface Person extends Actor { public static final String NAME = "Person"; // Person.class.getSimpleName(); - public static final String DESCRIPTION = "Person"; + public static final String DESCRIPTION = "Any human playing the role of Actor."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/RunningPlugin.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/RunningPlugin.java index 34a0f42..aa679c4 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/RunningPlugin.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/RunningPlugin.java @@ -15,7 +15,7 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; public interface RunningPlugin extends EService { public static final String NAME = "RunningPlugin"; // RunningPlugin.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Running Plugin information through the list of its facets"; + public static final String DESCRIPTION = "Any instance of a Plugin deployed and running by an EService."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Schema.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Schema.java index 95f4ab2..7941924 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Schema.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Schema.java @@ -22,17 +22,19 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Schema */ @JsonDeserialize(as=SchemaImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=SchemaFacet.class, min=1), - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=JSONSchemaFacet.class), - @ResourceSchemaEntry(consistOfType=IsIdentifiedBy.class, targetFacetType=XSDSchemaFacet.class), - @ResourceSchemaEntry(consistOfType=HasContact.class, targetFacetType=ContactFacet.class, min=1), - @ResourceSchemaEntry(targetFacetType=DescriptiveMetadataFacet.class), - @ResourceSchemaEntry(targetFacetType=SubjectFacet.class) -}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=SchemaFacet.class, min=1), + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=JSONSchemaFacet.class), + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=XSDSchemaFacet.class), + @ResourceSchemaEntry(relation=HasContact.class, facet=ContactFacet.class, min=1), + @ResourceSchemaEntry(facet=DescriptiveMetadataFacet.class), + @ResourceSchemaEntry(facet=SubjectFacet.class) + } +) public interface Schema extends GCubeResource { public static final String NAME = "Schema"; // Schema.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Schema information through the list of its facets"; + public static final String DESCRIPTION = "Any reference schema to be used to specify values compliant with it. Examples include controlled vocabularies, ontologies, etc."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Service.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Service.java index 9ea8054..d798b52 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Service.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Service.java @@ -19,15 +19,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; */ @Abstract @JsonDeserialize(as=ServiceImpl.class) -@ResourceSchema({ - @ResourceSchemaEntry(targetFacetType=DescriptiveMetadataFacet.class), - @ResourceSchemaEntry(targetFacetType=SubjectFacet.class), - @ResourceSchemaEntry(targetFacetType=CapabilityFacet.class) -}) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(facet=DescriptiveMetadataFacet.class, description="Any descriptive information associated with the service, e.g. for discovery purposes."), + @ResourceSchemaEntry(facet=SubjectFacet.class, description="Any subject/tag associated with the service for descriptive, cataloguing and discovery purposes."), + @ResourceSchemaEntry(facet=CapabilityFacet.class, description="Any facility supported/offered by the Service.") + } +) public interface Service extends GCubeResource { public static final String NAME = "Service"; // Service.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Service information through the list of its facets"; + public static final String DESCRIPTION = "An abstract entity to represent any typology of Service worth registering in the infrastructure."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Site.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Site.java index 1d76731..70e8746 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Site.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Site.java @@ -3,7 +3,17 @@ */ package org.gcube.resourcemanagement.model.reference.entities.resources; +import org.gcube.informationsystem.types.annotations.ResourceSchema; +import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.SiteImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.ContactFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.IdentifierFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.LocationFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasContact; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasMaintainer; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasManager; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -12,10 +22,20 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Site */ @JsonDeserialize(as=SiteImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=IdentifierFacet.class, min=1, description="The Site Identifier."), + @ResourceSchemaEntry(relation=HasContact.class, facet=ContactFacet.class, min=1, description="The main contact for the Site."), + @ResourceSchemaEntry(relation=HasMaintainer.class, facet=ContactFacet.class, min=1, description="Contact information of the maintainer of the Site."), + @ResourceSchemaEntry(relation=HasManager.class, facet=ContactFacet.class, min=1, description="Contact information of the Site Manager."), + @ResourceSchemaEntry(facet=LocationFacet.class, min=1), + @ResourceSchemaEntry(facet=NetworkingFacet.class, min=1), + } +) public interface Site extends GCubeResource { public static final String NAME = "Site"; // Site.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Site information through the list of its facets"; + public static final String DESCRIPTION = "An entity representing the location (physical or virtual) hosting and providing the resources associated with it."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Software.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Software.java index d1aa17a..8c674b9 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Software.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/Software.java @@ -3,7 +3,12 @@ */ package org.gcube.resourcemanagement.model.reference.entities.resources; +import org.gcube.informationsystem.types.annotations.ResourceSchema; +import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.SoftwareImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.CapabilityFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -12,10 +17,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Software */ @JsonDeserialize(as=SoftwareImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=SoftwareFacet.class, min=1, description="Software coordinates which identify the Software per se."), + @ResourceSchemaEntry(facet=SoftwareFacet.class, min=1, description="Apart the one connected by the IsIdentifiedBy relation (gCube coordinates) the others identify the software in other way e.g. (Maven coordinates)."), + @ResourceSchemaEntry(facet=CapabilityFacet.class) + } +) public interface Software extends GCubeResource { public static final String NAME = "Software"; // Software.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Software information through the list of its facets"; + public static final String DESCRIPTION = "Any Software entity worth being represented for management purposes."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualMachine.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualMachine.java index 4f2252d..1643cd8 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualMachine.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualMachine.java @@ -3,7 +3,18 @@ */ package org.gcube.resourcemanagement.model.reference.entities.resources; +import org.gcube.informationsystem.types.annotations.ResourceSchema; +import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.VirtualMachineImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.CPUFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.EventFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.MemoryFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.NetworkingFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet; +import org.gcube.resourcemanagement.model.reference.entities.facets.StateFacet; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasPersistentMemory; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.HasVolatileMemory; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -12,10 +23,21 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Virtual_Machine */ @JsonDeserialize(as=VirtualMachineImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=NetworkingFacet.class, min=1, description="The Network ID characterising the Virtual Machine."), + @ResourceSchemaEntry(facet=CPUFacet.class, min=1, description="The CPU equipping the Virtual Machine."), + @ResourceSchemaEntry(relation=HasPersistentMemory.class, facet=MemoryFacet.class, min=1, description="The Disk Space Capacity of the Virtual Machine."), + @ResourceSchemaEntry(relation=HasVolatileMemory.class, facet=MemoryFacet.class, min=1, description="The RAM Capacity of the Virtual Machine."), + @ResourceSchemaEntry(facet=EventFacet.class, min=1, description="Every event characterizing the life cycle of the Virtual Machine, e.g. the activation time."), + @ResourceSchemaEntry(facet=StateFacet.class, min=1, max=1, description="The current state of the Virtual Machine, e.g. started, ready, down, unreachable."), + @ResourceSchemaEntry(facet=SoftwareFacet.class, description=" Any Software characterising the Virtual Machine. Useful to report the hosted software that are not registered in the Resource Registry as Software Resource, e.g. Operating System") + } +) public interface VirtualMachine extends Service { public static final String NAME = "VirtualMachine"; //VirtualMachine.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Hosting Node information through the list of its facets"; + public static final String DESCRIPTION = "A Virtual Machine is an emulation of a physical computer which appears to the running operative system as real hardware."; public static final String VERSION = "1.0.0"; } diff --git a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualService.java b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualService.java index 3cf8a66..644b643 100644 --- a/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualService.java +++ b/src/main/java/org/gcube/resourcemanagement/model/reference/entities/resources/VirtualService.java @@ -3,7 +3,11 @@ */ package org.gcube.resourcemanagement.model.reference.entities.resources; +import org.gcube.informationsystem.types.annotations.ResourceSchema; +import org.gcube.informationsystem.types.annotations.ResourceSchemaEntry; import org.gcube.resourcemanagement.model.impl.entities.resources.VirtualServiceImpl; +import org.gcube.resourcemanagement.model.reference.entities.facets.SoftwareFacet; +import org.gcube.resourcemanagement.model.reference.relations.consistsof.IsIdentifiedBy; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; @@ -12,9 +16,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; * https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Virtual_Service */ @JsonDeserialize(as=VirtualServiceImpl.class) +@ResourceSchema( + facets={ + @ResourceSchemaEntry(relation=IsIdentifiedBy.class, facet=SoftwareFacet.class, min=1), + } +) public interface VirtualService extends Service { public static final String NAME = "VirtualService"; // VirtualService.class.getSimpleName(); - public static final String DESCRIPTION = "Collect Virtual Service information through the list of its facets"; + public static final String DESCRIPTION = "An abstract service (non physically existing service) worth being represented as an existing Service for management purposes. Examples of usage include cases where classes or set of services are to be managed like an existing unit."; public static final String VERSION = "1.0.0"; } diff --git a/src/test/java/org/gcube/resourcemanagement/model/reference/entities/resources/ResourceTypeDefintionsTest.java b/src/test/java/org/gcube/resourcemanagement/model/reference/entities/resources/ResourceTypeDefintionsTest.java new file mode 100644 index 0000000..8c89cb6 --- /dev/null +++ b/src/test/java/org/gcube/resourcemanagement/model/reference/entities/resources/ResourceTypeDefintionsTest.java @@ -0,0 +1,21 @@ +package org.gcube.resourcemanagement.model.reference.entities.resources; + +import org.gcube.informationsystem.base.reference.entities.BaseEntity; +import org.gcube.informationsystem.model.reference.entities.Entity; +import org.gcube.informationsystem.model.reference.entities.Resource; +import org.gcube.informationsystem.types.TypeBinder; +import org.junit.Test; + +public class ResourceTypeDefintionsTest { + + @Test + public void serialize() throws Exception{ + TypeBinder.serializeType(BaseEntity.class); + TypeBinder.serializeType(Entity.class); + TypeBinder.serializeType(Resource.class); + TypeBinder.serializeType(GCubeResource.class); + TypeBinder.serializeType(Actor.class); + TypeBinder.serializeType(Dataset.class); + } + +}