Package org.ivoa.dm.caom2
Class Artifact
java.lang.Object
org.ivoa.dm.caom2.Entity
org.ivoa.dm.caom2.CaomEntity
org.ivoa.dm.caom2.Artifact
- All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations,org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
@Entity
@VoDml(id="caom2:Artifact",
role=objectType)
public class Artifact
extends CaomEntity
implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
a physical product (typically a file).
objectType: Artifact
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for Artifact, mainly for use in the functional builder pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringthis is the checksum of the artifact data; the URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim} md5:4be91751541fd804e7207663a0822f56 \end{verbatim}.protected IntegerThis specifies the size of the stored artifact; for files, this is the file size.Thsi is a set of groups that are allowed to access the content of this artifact.protected DateThis timestamp after which content for the artifact is public.protected StringThis field specifies the format of the resolved artifact: should be a MIME-type.protected StringThis is an identifier to refer to an ArtifactDescription entity.protected Stringthe relationship of this Artifact to the parent Plane (DataLink semantics).protected ReleaseTypeThis field indicates whether this artifact is treated as data or metadata when determining access permission.protected StringThis identifier can be used to interact with an associated data management system.protected StringThis is a short string of hexadecimal digits generated from the uri to support operational use cases (mainly: dividing workload to perform validation in parallel).Fields inherited from class org.ivoa.dm.caom2.CaomEntity
accMetaChecksum, maxLastModifiedFields inherited from class org.ivoa.dm.caom2.Entity
id, lastModified, metaChecksum, metaProducer -
Constructor Summary
ConstructorsConstructorDescriptionArtifact()Creates a new ArtifactArtifact(String uri, String uriBucket, String productType, ReleaseType releaseType, String contentType, Integer contentLength, String contentChecksum, Date contentRelease, List<String> contentReadGroups, String descriptionID, Date maxLastModified, String accMetaChecksum, String id, Date lastModified, String metaChecksum, String metaProducer) full parameter constructor.Copy Constructor.Artifact(CaomEntity superinstance, String uri, String uriBucket, String productType, ReleaseType releaseType, String contentType, Integer contentLength, String contentChecksum, Date contentRelease, List<String> contentReadGroups, String descriptionID) Constructor from supertype instance. -
Method Summary
Modifier and TypeMethodDescriptioncopyMe()make a clone of the object taking into account current polymorhic type.static Artifactcreate a Artifact in functional builder style.voiddelete(jakarta.persistence.EntityManager em) voidReturns contentChecksum Attribute.Returns contentLength Attribute.Returns contentReadGroups Attribute.Returns contentRelease Attribute.Returns contentType Attribute.Returns descriptionID Attribute.Returns productType Attribute.Returns releaseType Attribute.getUri()Returns uri Attribute.Returns uriBucket Attribute.voidsetContentChecksum(String pContentChecksum) Set contentChecksum Attribute.voidsetContentLength(Integer pContentLength) Set contentLength Attribute.voidsetContentReadGroups(List<String> pContentReadGroups) Set contentReadGroups Attribute.voidsetContentRelease(Date pContentRelease) Set contentRelease Attribute.voidsetContentType(String pContentType) Set contentType Attribute.voidsetDescriptionID(String pDescriptionID) Set descriptionID Attribute.voidsetProductType(String pProductType) Set productType Attribute.voidsetReleaseType(ReleaseType pReleaseType) Set releaseType Attribute.voidSet uri Attribute.voidsetUriBucket(String pUriBucket) Set uriBucket Attribute.voidupdateUsing(Artifact other) Update this object with the content of the given object.withContentChecksum(String pContentChecksum) fluent setter for contentChecksum Attribute.withContentLength(Integer pContentLength) fluent setter for contentLength Attribute.withContentReadGroups(List<String> pContentReadGroups) fluent setter for contentReadGroups Attribute.withContentRelease(Date pContentRelease) fluent setter for contentRelease Attribute.withContentType(String pContentType) fluent setter for contentType Attribute.withDescriptionID(String pDescriptionID) fluent setter for descriptionID Attribute.withProductType(String pProductType) fluent setter for productType Attribute.withReleaseType(ReleaseType pReleaseType) fluent setter for releaseType Attribute.fluent setter for uri Attribute.withUriBucket(String pUriBucket) fluent setter for uriBucket Attribute.Methods inherited from class org.ivoa.dm.caom2.CaomEntity
getAccMetaChecksum, getMaxLastModified, setAccMetaChecksum, setMaxLastModified, updateUsing, withAccMetaChecksum, withMaxLastModifiedMethods inherited from class org.ivoa.dm.caom2.Entity
getId, getLastModified, getMetaChecksum, getMetaProducer, setId, setLastModified, setMetaChecksum, setMetaProducer, updateUsing, withId, withLastModified, withMetaChecksum, withMetaProducerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType
getId
-
Field Details
-
uri
@VoDml(id="caom2:Artifact.uri", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String uriThis identifier can be used to interact with an associated data management system. Existing usage: this is an internal identifier that an IVOA DataLink service can convert into a usable link to the data. TODO: There is an informal style used to make sure that these identifiers are globally unique and avoid collisions... : Attribute uri : multiplicity 1 -
uriBucket
@VoDml(id="caom2:Artifact.uriBucket", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String uriBucketThis is a short string of hexadecimal digits generated from the uri to support operational use cases (mainly: dividing workload to perform validation in parallel). The value is the first three characters of the hexadecimal representation of SHA-1 of the UTF-8 encoded bytes of the Observation.uri value. (NEW in CAOM-2.5). : Attribute uriBucket : multiplicity 1 -
productType
@VoDml(id="caom2:Artifact.productType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String productTypethe relationship of this Artifact to the parent Plane (DataLink semantics). : Attribute productType : multiplicity 1 -
releaseType
@VoDml(id="caom2:Artifact.releaseType", role=attribute, type="caom2:ReleaseType", typeRole=enumeration) protected ReleaseType releaseTypeThis field indicates whether this artifact is treated as data or metadata when determining access permission. Existing usage: some collections have small previews (productType=thumbnail) that are considered metadata and are thus viewable by all users. : Attribute releaseType : multiplicity 1 -
contentType
@VoDml(id="caom2:Artifact.contentType", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String contentTypeThis field specifies the format of the resolved artifact: should be a MIME-type. : Attribute contentType : multiplicity 0..1 -
contentLength
@VoDml(id="caom2:Artifact.contentLength", role=attribute, type="ivoa:integer", typeRole=primitiveType) protected Integer contentLengthThis specifies the size of the stored artifact; for files, this is the file size. : Attribute contentLength : multiplicity 0..1 -
contentChecksum
@VoDml(id="caom2:Artifact.contentChecksum", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String contentChecksumthis is the checksum of the artifact data; the URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim} md5:4be91751541fd804e7207663a0822f56 \end{verbatim}. : Attribute contentChecksum : multiplicity 0..1 -
contentRelease
@VoDml(id="caom2:Artifact.contentRelease", role=attribute, type="ivoa:datetime", typeRole=primitiveType) protected Date contentReleaseThis timestamp after which content for the artifact is public. If set, this value overrides the permission implied by the releaseType and Plane release dates. Existing usage: MAST?. : Attribute contentRelease : multiplicity 0..1 -
contentReadGroups
@VoDml(id="caom2:Artifact.contentReadGroups", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected List<String> contentReadGroupsThsi is a set of groups that are allowed to access the content of this artifact. If set, thisd overrides the permission implied by the releaseType and PLane release groups. Existing usage: unknown. : Attribute contentReadGroups : multiplicity 0..* -
descriptionID
@VoDml(id="caom2:Artifact.descriptionID", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String descriptionIDThis is an identifier to refer to an ArtifactDescription entity. (new in CAOM-2.5) Use case: provide standard descriptions for links in a DataLink response. : Attribute descriptionID : multiplicity 0..1
-
-
Constructor Details
-
Artifact
public Artifact()Creates a new Artifact -
Artifact
public Artifact(String uri, String uriBucket, String productType, ReleaseType releaseType, String contentType, Integer contentLength, String contentChecksum, Date contentRelease, List<String> contentReadGroups, String descriptionID, Date maxLastModified, String accMetaChecksum, String id, Date lastModified, String metaChecksum, String metaProducer) full parameter constructor.- Parameters:
uri- This identifier can be used to interact with an associated data management system. Existing usage: this is an internal identifier that an IVOA DataLink service can convert into a usable link to the data. TODO: There is an informal style used to make sure that these identifiers are globally unique and avoid collisions...uriBucket- This is a short string of hexadecimal digits generated from the uri to support operational use cases (mainly: dividing workload to perform validation in parallel). The value is the first three characters of the hexadecimal representation of SHA-1 of the UTF-8 encoded bytes of the Observation.uri value. (NEW in CAOM-2.5).productType- the relationship of this Artifact to the parent Plane (DataLink semantics).releaseType- This field indicates whether this artifact is treated as data or metadata when determining access permission. Existing usage: some collections have small previews (productType=thumbnail) that are considered metadata and are thus viewable by all users.contentType- This field specifies the format of the resolved artifact: should be a MIME-type.contentLength- This specifies the size of the stored artifact; for files, this is the file size.contentChecksum- this is the checksum of the artifact data; the URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim} md5:4be91751541fd804e7207663a0822f56 \end{verbatim}.contentRelease- This timestamp after which content for the artifact is public. If set, this value overrides the permission implied by the releaseType and Plane release dates. Existing usage: MAST?.contentReadGroups- Thsi is a set of groups that are allowed to access the content of this artifact. If set, thisd overrides the permission implied by the releaseType and PLane release groups. Existing usage: unknown.descriptionID- This is an identifier to refer to an ArtifactDescription entity. (new in CAOM-2.5) Use case: provide standard descriptions for links in a DataLink response.maxLastModified- The maximum last modification timestamp of this entity and all child entities is used to support incremental synchronization (of Observation instances). As with the instance lastModified timestamp above, this timestamp is intended to be set and/or updated when the entity is stored (e.g. in a database).accMetaChecksum- accumulated checksum of the metadata of this entity and all child entities; The URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim}md5:4be91751541fd804e7207663a0822f56.\end{verbatim} The accumulated checksum of an entity is computed by accumulating the byte representation of entity checksums in the following order: (1) the metaChecksum of the current entity, (2) the accMetaChecksum of all child entities accumulated in order of the child's Entity.id. For an entity with no children, the accMetaChecksum is derived only from the metaChecksum but it is not equal to it because it is a checksum of that checksum and not a checksum of the same metadata directly.id- The id is a globally unique identifier (primary key) for an instance.lastModified- The timestamp of last modification of this entity tracks changes in metadata and supports incremental operations. The timestamp is intended to be set and/or updated when the entity is stored (e.g. in a database).metaChecksum- This checksum of the metadata in this entity signals a change in the metadata of an instance and supports validation (e.g. to compare metadata before and after serialisation or persistence). A change in the metaChecksum can also be used to optimise operations like updating a row in the database only when the metaChecksum changed. A change in metaChecksum normally triggers a change in the lastModified timestamp. The URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim}md5:4be91751541fd804e7207663a0822f56.\end{verbatim} The checksum of an entity is computed by accumulating byte representation of individual metadata values in the following order: (1) Entity.id for entities, (2) Entity.metaProducer, (3) state fields in alphabetic order (foo.a comes before foo.b) and using depth-first recursion (foo.abc.x comes before foo.def). The lastModified timestamp is not included in the metaChecksum calculation. Null values are ignored so that the addition of new fields in future versions will not change/invalidate existing checksums. Non-null values are converted to bytes as follows: \begin{itemize} \item string: UTF-8 encoded bytes \item URI: UTF-8 encoded bytes of the string representation \item VocabularyTerm: UTF-8 encoded bytes of the term (do not include the namespace) \item enumeration: the literal value converted to bytes \item float: IEEE754 single (4 bytes) \item double: IEEE754 double (8 bytes) \item boolean: convert to single byte, false=0, true=1 (1 byte) \item byte: as-is (1 byte) \item short: (2 bytes, network byte order == big endian)) \item integer: (4 bytes, network byte order == big endian) \item long: (8 bytes, network byte order == big endian) \item date: treat as a long (milliseconds since 1970-01-01 00:00:00 UTC) \end{itemize} TODO: truncatedDates=false, digestFieldNames=true, digestFieldnamesLowerCase=true TODO: external data model components: recursion or specify conversion above (interval, point, shape, multishape) .metaProducer- This identifier is used to identify the tools used to produce the metadata. It also implicitly applies to child entities with null metaProducer. The form of the URI is not specified; implementations are free to use this to track metadata curation. For example, a pattern like {organisation}:{software name}-{version} is useful to support a variety of operational uses: query for metadata created by a version with a known bug or query for metadata created by an older version of the software and perform updates.
-
Artifact
Copy Constructor. Note that references will remain as is rather than be copied.- Parameters:
other- the object to be copied.
-
Artifact
public Artifact(CaomEntity superinstance, String uri, String uriBucket, String productType, ReleaseType releaseType, String contentType, Integer contentLength, String contentChecksum, Date contentRelease, List<String> contentReadGroups, String descriptionID) Constructor from supertype instance.- Parameters:
superinstance- The supertype.uri- This identifier can be used to interact with an associated data management system. Existing usage: this is an internal identifier that an IVOA DataLink service can convert into a usable link to the data. TODO: There is an informal style used to make sure that these identifiers are globally unique and avoid collisions...uriBucket- This is a short string of hexadecimal digits generated from the uri to support operational use cases (mainly: dividing workload to perform validation in parallel). The value is the first three characters of the hexadecimal representation of SHA-1 of the UTF-8 encoded bytes of the Observation.uri value. (NEW in CAOM-2.5).productType- the relationship of this Artifact to the parent Plane (DataLink semantics).releaseType- This field indicates whether this artifact is treated as data or metadata when determining access permission. Existing usage: some collections have small previews (productType=thumbnail) that are considered metadata and are thus viewable by all users.contentType- This field specifies the format of the resolved artifact: should be a MIME-type.contentLength- This specifies the size of the stored artifact; for files, this is the file size.contentChecksum- this is the checksum of the artifact data; the URI must conform to the pattern {algorithm}:{hex value}, for example: \begin{verbatim} md5:4be91751541fd804e7207663a0822f56 \end{verbatim}.contentRelease- This timestamp after which content for the artifact is public. If set, this value overrides the permission implied by the releaseType and Plane release dates. Existing usage: MAST?.contentReadGroups- Thsi is a set of groups that are allowed to access the content of this artifact. If set, thisd overrides the permission implied by the releaseType and PLane release groups. Existing usage: unknown.descriptionID- This is an identifier to refer to an ArtifactDescription entity. (new in CAOM-2.5) Use case: provide standard descriptions for links in a DataLink response.
-
-
Method Details
-
copyMe
make a clone of the object taking into account current polymorhic type.- Specified by:
copyMein classCaomEntity- Returns:
- the cloned object.
-
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.
-
getUri
Returns uri Attribute.- Returns:
- uri Attribute
-
setUri
Set uri Attribute.- Parameters:
pUri- value to set
-
withUri
fluent setter for uri Attribute.- Parameters:
pUri- value to set- Returns:
- Artifact
-
getUriBucket
Returns uriBucket Attribute.- Returns:
- uriBucket Attribute
-
setUriBucket
Set uriBucket Attribute.- Parameters:
pUriBucket- value to set
-
withUriBucket
fluent setter for uriBucket Attribute.- Parameters:
pUriBucket- value to set- Returns:
- Artifact
-
getProductType
Returns productType Attribute.- Returns:
- productType Attribute
-
setProductType
Set productType Attribute.- Parameters:
pProductType- value to set
-
withProductType
fluent setter for productType Attribute.- Parameters:
pProductType- value to set- Returns:
- Artifact
-
getReleaseType
Returns releaseType Attribute.- Returns:
- releaseType Attribute
-
setReleaseType
Set releaseType Attribute.- Parameters:
pReleaseType- value to set
-
withReleaseType
fluent setter for releaseType Attribute.- Parameters:
pReleaseType- value to set- Returns:
- Artifact
-
getContentType
Returns contentType Attribute.- Returns:
- contentType Attribute
-
setContentType
Set contentType Attribute.- Parameters:
pContentType- value to set
-
withContentType
fluent setter for contentType Attribute.- Parameters:
pContentType- value to set- Returns:
- Artifact
-
getContentLength
Returns contentLength Attribute.- Returns:
- contentLength Attribute
-
setContentLength
Set contentLength Attribute.- Parameters:
pContentLength- value to set
-
withContentLength
fluent setter for contentLength Attribute.- Parameters:
pContentLength- value to set- Returns:
- Artifact
-
getContentChecksum
Returns contentChecksum Attribute.- Returns:
- contentChecksum Attribute
-
setContentChecksum
Set contentChecksum Attribute.- Parameters:
pContentChecksum- value to set
-
withContentChecksum
fluent setter for contentChecksum Attribute.- Parameters:
pContentChecksum- value to set- Returns:
- Artifact
-
getContentRelease
Returns contentRelease Attribute.- Returns:
- contentRelease Attribute
-
setContentRelease
Set contentRelease Attribute.- Parameters:
pContentRelease- value to set
-
withContentRelease
fluent setter for contentRelease Attribute.- Parameters:
pContentRelease- value to set- Returns:
- Artifact
-
getContentReadGroups
Returns contentReadGroups Attribute.- Returns:
- contentReadGroups Attribute
-
setContentReadGroups
Set contentReadGroups Attribute.- Parameters:
pContentReadGroups- value to set
-
withContentReadGroups
fluent setter for contentReadGroups Attribute.- Parameters:
pContentReadGroups- value to set- Returns:
- Artifact
-
getDescriptionID
Returns descriptionID Attribute.- Returns:
- descriptionID Attribute
-
setDescriptionID
Set descriptionID Attribute.- Parameters:
pDescriptionID- value to set
-
withDescriptionID
fluent setter for descriptionID Attribute.- Parameters:
pDescriptionID- value to set- Returns:
- Artifact
-
createArtifact
create a Artifact 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- Overrides:
forceLoadin classCaomEntity
-
delete
public void delete(jakarta.persistence.EntityManager em) - Specified by:
deletein interfaceorg.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
-