java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<SET,TET>>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.base.RelationElementManagement<ResourceManagement,T,org.gcube.informationsystem.types.reference.entities.ResourceSchema,TET>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.RelationManagement<ResourceManagement,org.gcube.informationsystem.types.reference.entities.ResourceSchema>
org.gcube.informationsystem.resourceregistry.persistence.orientdb.instances.relations.IsRelatedToManagement
All Implemented Interfaces:
ERManagement

public class IsRelatedToManagement extends RelationManagement<ResourceManagement,org.gcube.informationsystem.types.reference.entities.ResourceSchema>
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

  • Constructor Details

    • IsRelatedToManagement

      public IsRelatedToManagement()
      Creates a new IsRelatedToManagement instance with default propagation constraints.
  • Method Details

    • getSpecificNotFoundException

      protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.isrelatedto.IsRelatedToNotFoundException getSpecificNotFoundException(org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException e)
      Description copied from class: ElementManagement
      Converts a generic NotFoundException into a subclass-specific NotFoundException.
      Specified by:
      getSpecificNotFoundException in class ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema,org.gcube.informationsystem.types.reference.entities.ResourceSchema>>
      Parameters:
      e - the generic exception
      Returns:
      the specific NotFoundException
    • getSpecificAvailableInAnotherContextException

      public org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.isrelatedto.IsRelatedToAvailableInAnotherContextException getSpecificAvailableInAnotherContextException(String message)
      Description copied from interface: ERManagement
      Returns the subclass-specific AvailableInAnotherContextException instance.
      Parameters:
      message - the exception message
      Returns:
      the specific AvailableInAnotherContextException
    • getSpecificAlreadyPresentException

      protected org.gcube.informationsystem.resourceregistry.api.exceptions.instances.relations.isrelatedto.IsRelatedToAlreadyPresentException getSpecificAlreadyPresentException(String message)
      Description copied from class: ElementManagement
      Converts a generic AlreadyPresentException into a subclass-specific AlreadyPresentException.
      Specified by:
      getSpecificAlreadyPresentException in class ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema,org.gcube.informationsystem.types.reference.entities.ResourceSchema>>
      Parameters:
      message - the exception message
      Returns:
      the specific AlreadyPresentException
    • newTargetEntityManagement

      protected ResourceManagement newTargetEntityManagement() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Description copied from class: RelationElementManagement
      Creates a new management instance for the target entity of the relation (subclass hook).
      Specified by:
      newTargetEntityManagement in class RelationElementManagement<ResourceManagement,ResourceManagement,org.gcube.informationsystem.types.reference.entities.ResourceSchema,org.gcube.informationsystem.types.reference.entities.ResourceSchema>
      Returns:
      the target entity management instance
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on database or lookup error
    • reallyCreate

      protected com.orientechnologies.orient.core.record.OEdge reallyCreate() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Description copied from class: ElementManagement
      Persists a new element in the database (subclass hook).
      Overrides:
      reallyCreate in class RelationManagement<ResourceManagement,org.gcube.informationsystem.types.reference.entities.ResourceSchema>
      Returns:
      the persisted OrientDB vertex
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException - if the element already exists in the database
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on any database error
    • createCompleteJsonNode

      protected org.gcube.com.fasterxml.jackson.databind.JsonNode createCompleteJsonNode() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Description copied from class: ElementManagement
      Abstract method to create the complete JSON node representation of the element.
      Overrides:
      createCompleteJsonNode in class RelationElementManagement<ResourceManagement,ResourceManagement,org.gcube.informationsystem.types.reference.entities.ResourceSchema,org.gcube.informationsystem.types.reference.entities.ResourceSchema>
      Returns:
      the complete JSON node representing the element and its relationships
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on serialization or mapping error
    • sanityCheck

      public void sanityCheck() throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      Description copied from class: ElementManagement
      Performs runtime validation of the schema constraints this service enforces from the definition rather than through OrientDB: the mandatory properties, and the min and max bounds of the numeric values a creation or an update wrote. A System Restore, the only caller that sets ElementManagement.preservePassedMetadata, reproduces the archive as it is: it does not validate again the content the dumped registry held.
      Overrides:
      sanityCheck in class ElementManagement<com.orientechnologies.orient.core.record.OEdge,org.gcube.informationsystem.types.reference.relations.RelationSchema<org.gcube.informationsystem.types.reference.entities.ResourceSchema,org.gcube.informationsystem.types.reference.entities.ResourceSchema>>
      Throws:
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException - if a schema constraint is violated
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - on database lookup failure