Class DataResource

java.lang.Object
org.ivoa.dm.execution.DataResource
All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>

@Entity @VoDml(id="execution:DataResource", role=objectType) public class DataResource extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
A data resource that can be used as input or output for a job. objectType: DataResource
  • Field Details

    • _id

      protected Long _id
      inserted database key
    • location

      @VoDml(id="execution:DataResource.location", role=reference, type="execution:PhysicalLocation", typeRole=objectType) protected PhysicalLocation location
      ReferenceObject location : the location of the data. ( Multiplicity : 1 )
    • size

      @VoDml(id="execution:DataResource.size", role=attribute, type="ivoa:real", typeRole=primitiveType) protected Double size
      the size of the data resource in GB. : Attribute size type ivoa:real : multiplicity 1
    • mimeType

      @VoDml(id="execution:DataResource.mimeType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String mimeType
      the mime type of the data resource. : Attribute mimeType type ivoa:string : multiplicity 0..1
    • accessUrl

      @VoDml(id="execution:DataResource.accessUrl", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String accessUrl
      the URL that can be used to access the data resource. : Attribute accessUrl type ivoa:anyURI : multiplicity 1
  • Constructor Details

    • DataResource

      public DataResource()
      Creates a new DataResource
    • DataResource

      public DataResource(PhysicalLocation location, Double size, String mimeType, String accessUrl)
      full parameter constructor.
      Parameters:
      location - the location of the data.
      size - the size of the data resource in GB.
      mimeType - the mime type of the data resource.
      accessUrl - the URL that can be used to access the data resource.
    • DataResource

      public DataResource(DataResource other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • getId

      public Long getId()
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
      Returns:
      the id
    • updateUsing

      public void updateUsing(DataResource other)
      Update this object with the content of the given object. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
    • getLocation

      public PhysicalLocation getLocation()
      Returns location Reference
      Returns:
      location Reference
    • setLocation

      public void setLocation(PhysicalLocation pLocation)
      Defines location Reference
      Parameters:
      pLocation - reference to set
    • getSize

      public Double getSize()
      Returns size Attribute.
      Returns:
      size Attribute
    • setSize

      public void setSize(Double pSize)
      Set size Attribute.
      Parameters:
      pSize - value to set
    • withSize

      public DataResource withSize(Double pSize)
      fluent setter for size Attribute.
      Parameters:
      pSize - value to set
      Returns:
      DataResource
    • getMimeType

      public String getMimeType()
      Returns mimeType Attribute.
      Returns:
      mimeType Attribute
    • setMimeType

      public void setMimeType(String pMimeType)
      Set mimeType Attribute.
      Parameters:
      pMimeType - value to set
    • withMimeType

      public DataResource withMimeType(String pMimeType)
      fluent setter for mimeType Attribute.
      Parameters:
      pMimeType - value to set
      Returns:
      DataResource
    • getAccessUrl

      public String getAccessUrl()
      Returns accessUrl Attribute.
      Returns:
      accessUrl Attribute
    • setAccessUrl

      public void setAccessUrl(String pAccessUrl)
      Set accessUrl Attribute.
      Parameters:
      pAccessUrl - value to set
    • withAccessUrl

      public DataResource withAccessUrl(String pAccessUrl)
      fluent setter for accessUrl Attribute.
      Parameters:
      pAccessUrl - value to set
      Returns:
      DataResource
    • createDataResource

      public static DataResource createDataResource(Consumer<DataResource.DataResourceBuilder> f)
      create a DataResource in functional builder style.
      Parameters:
      f - the functional builder.
      Returns:
      an object initialized from the builder.
    • forceLoad

      public void forceLoad()
      Specified by:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • delete

      public void delete(jakarta.persistence.EntityManager em)
      Specified by:
      delete in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>