Adding resources schema definition

This commit is contained in:
Luca Frosini 2020-01-15 17:26:54 +01:00
parent 001b670742
commit b723c19ffa
18 changed files with 197 additions and 71 deletions

View File

@ -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();

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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();

View File

@ -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";
}

View File

@ -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() {

View File

@ -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();

View File

@ -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 <key,value> 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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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";
}

View File

@ -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);
}
}