Class Instance

java.lang.Object
org.gcube.resourcemanagement.resource.Instance
All Implemented Interfaces:
Comparable<Instance>

public abstract class Instance extends Object implements Comparable<Instance>
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • excludedFacetKeys

      protected static Set<String> excludedFacetKeys
    • mapper

      protected org.gcube.com.fasterxml.jackson.databind.ObjectMapper mapper
    • id

      protected UUID id
      UUID of the instance
    • type

      protected String type
      The type of the instance
    • properties

      protected Map<String,org.gcube.com.fasterxml.jackson.databind.JsonNode> properties
      Properties which describe the instance. For example for any GCubeResource all the properties of the Facet which identify the instance. e.g. EService -- isIdentifiedBy --> SoftwareFacet All the properties (mandatory or not) defined in the SoftwareFacet instance identifiyng the EService
    • mandatoryRelatedResources

      protected Set<Instance> mandatoryRelatedResources
    • derivatedRelatedResources

      protected Set<DerivatedRelatedResourceGroup<Instance>> derivatedRelatedResources
    • newInstances

      protected List<org.gcube.informationsystem.base.reference.IdentifiableElement> newInstances
    • addedElements

      protected List<org.gcube.informationsystem.model.reference.ERElement> addedElements
      The elements that have been added to the context. It is used to keep track of the elements that have been added to the context to inform the clinet of the result of add to context. It is not used when we read an instace ofr add to context operation.
  • Constructor Details

    • Instance

      public Instance()
  • Method Details

    • getAsInstances

      public static <I extends Instance> Set<I> getAsInstances(Class<I> iClass, Collection<org.gcube.informationsystem.model.reference.entities.Resource> resources) throws jakarta.ws.rs.WebApplicationException
      Throws:
      jakarta.ws.rs.WebApplicationException
    • getAsInstances

      public static <I extends Instance> Set<I> getAsInstances(Class<I> iClass, org.gcube.informationsystem.model.reference.entities.Resource... resources) throws jakarta.ws.rs.WebApplicationException
      Throws:
      jakarta.ws.rs.WebApplicationException
    • setIdentifingProperties

      protected abstract void setIdentifingProperties(org.gcube.informationsystem.model.reference.entities.Resource r) throws jakarta.ws.rs.WebApplicationException
      Throws:
      jakarta.ws.rs.WebApplicationException
    • setResource

      public void setResource(org.gcube.informationsystem.model.reference.entities.Resource r) throws jakarta.ws.rs.WebApplicationException
      Throws:
      jakarta.ws.rs.WebApplicationException
    • getID

      public UUID getID()
    • setID

      public void setID(UUID id)
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getProperties

      public Map<String,org.gcube.com.fasterxml.jackson.databind.JsonNode> getProperties()
    • setProperties

      public void setProperties(Map<String,org.gcube.com.fasterxml.jackson.databind.JsonNode> properties)
    • addProperty

      public void addProperty(String key, org.gcube.com.fasterxml.jackson.databind.JsonNode value)
    • getMandatoryRelatedResources

      public Set<Instance> getMandatoryRelatedResources()
    • setMandatoryRelatedResources

      public void setMandatoryRelatedResources(Set<Instance> mandatoryRelatedResources)
    • addMandatoryRelatedResource

      public void addMandatoryRelatedResource(Instance instance)
    • addMandatoryRelatedResources

      public void addMandatoryRelatedResources(Set<Instance> instances)
    • getDerivatedRelatedResources

      public Set<DerivatedRelatedResourceGroup<Instance>> getDerivatedRelatedResources()
    • setDerivatedRelatedResources

      public void setDerivatedRelatedResources(Set<DerivatedRelatedResourceGroup<Instance>> derivatedRelatedResources)
    • addDerivatedRelatedResource

      public void addDerivatedRelatedResource(DerivatedRelatedResourceGroup<Instance> derivatedRelatedResource)
    • addDerivatedRelatedResources

      public void addDerivatedRelatedResources(Set<DerivatedRelatedResourceGroup<Instance>> derivatedRelatedResources)
    • getNewInstances

      public List<org.gcube.informationsystem.base.reference.IdentifiableElement> getNewInstances()
    • setNewInstances

      public void setNewInstances(List<org.gcube.informationsystem.base.reference.IdentifiableElement> newInstances)
    • addNewInstance

      public void addNewInstance(org.gcube.informationsystem.base.reference.IdentifiableElement newInstance)
    • addNewInstances

      public void addNewInstances(List<org.gcube.informationsystem.base.reference.IdentifiableElement> newInstances)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getAddedElements

      public List<org.gcube.informationsystem.model.reference.ERElement> getAddedElements()
      All the ERElement added as result of addToContext The added element are got from the return of the addToContext operation from the resource registry.
      Returns:
    • setAddedElements

      public void setAddedElements(List<org.gcube.informationsystem.model.reference.ERElement> addedElements)
    • addAddedElement

      public void addAddedElement(org.gcube.informationsystem.model.reference.ERElement addedElement)
    • addAddedElements

      public void addAddedElements(List<org.gcube.informationsystem.model.reference.ERElement> addedElements)
    • addAddedElements

      public void addAddedElements(org.gcube.informationsystem.model.reference.ERElement... addedElements)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • compareTo

      public int compareTo(Instance o)
      Specified by:
      compareTo in interface Comparable<Instance>