Package org.ivoa.dm.execution
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for DataResource, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Longinserted database keyprotected Stringthe URL that can be used to access the data resource.protected PhysicalLocationReferenceObject location : the location of the data.protected Stringthe mime type of the data resource.protected Doublethe size of the data resource in GB. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DataResourceDataResource(DataResource other) Copy Constructor.DataResource(PhysicalLocation location, Double size, String mimeType, String accessUrl) full parameter constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic DataResourcecreate a DataResource in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns accessUrl Attribute.getId()Returns location ReferenceReturns mimeType Attribute.getSize()Returns size Attribute.voidsetAccessUrl(String pAccessUrl) Set accessUrl Attribute.voidsetLocation(PhysicalLocation pLocation) Defines location ReferencevoidsetMimeType(String pMimeType) Set mimeType Attribute.voidSet size Attribute.voidupdateUsing(DataResource other) Update this object with the content of the given object.withAccessUrl(String pAccessUrl) fluent setter for accessUrl Attribute.withMimeType(String pMimeType) fluent setter for mimeType Attribute.fluent setter for size Attribute.
-
Field Details
-
_id
inserted database key -
location
@VoDml(id="execution:DataResource.location", role=reference, type="execution:PhysicalLocation", typeRole=objectType) protected PhysicalLocation locationReferenceObject location : the location of the data. ( Multiplicity : 1 ) -
size
@VoDml(id="execution:DataResource.size", role=attribute, type="ivoa:real", typeRole=primitiveType) protected Double sizethe 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 mimeTypethe 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 accessUrlthe 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
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
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>- Returns:
- the id
-
updateUsing
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
Returns location Reference- Returns:
- location Reference
-
setLocation
Defines location Reference- Parameters:
pLocation- reference to set
-
getSize
Returns size Attribute.- Returns:
- size Attribute
-
setSize
Set size Attribute.- Parameters:
pSize- value to set
-
withSize
fluent setter for size Attribute.- Parameters:
pSize- value to set- Returns:
- DataResource
-
getMimeType
Returns mimeType Attribute.- Returns:
- mimeType Attribute
-
setMimeType
Set mimeType Attribute.- Parameters:
pMimeType- value to set
-
withMimeType
fluent setter for mimeType Attribute.- Parameters:
pMimeType- value to set- Returns:
- DataResource
-
getAccessUrl
Returns accessUrl Attribute.- Returns:
- accessUrl Attribute
-
setAccessUrl
Set accessUrl Attribute.- Parameters:
pAccessUrl- value to set
-
withAccessUrl
fluent setter for accessUrl Attribute.- Parameters:
pAccessUrl- value to set- Returns:
- DataResource
-
createDataResource
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:
forceLoadin interfaceorg.ivoa.vodml.jpa.JPAManipulations
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<Long>
-