Class CaomEntity

java.lang.Object
org.ivoa.dm.caom2.Entity
org.ivoa.dm.caom2.CaomEntity
All Implemented Interfaces:
org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
Direct Known Subclasses:
Artifact, Observation, Plane

@Entity @VoDml(id="caom2:CaomEntity", role=objectType) public abstract class CaomEntity extends Entity implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
This is an extension of the base Entity class to support accumulated metadata checksums and accumulated lastModified timestamps for entities with child entities. objectType: CaomEntity
  • Field Details

    • maxLastModified

      @VoDml(id="caom2:CaomEntity.maxLastModified", role=attribute, type="ivoa:datetime", typeRole=primitiveType) protected Date 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). : Attribute maxLastModified : multiplicity 0..1
    • accMetaChecksum

      @VoDml(id="caom2:CaomEntity.accMetaChecksum", role=attribute, type="ivoa:anyURI", typeRole=primitiveType) protected String 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. : Attribute accMetaChecksum : multiplicity 0..1
  • Constructor Details

    • CaomEntity

      public CaomEntity()
      Creates a new CaomEntity
    • CaomEntity

      public CaomEntity(Date maxLastModified, String accMetaChecksum, String id, Date lastModified, String metaChecksum, String metaProducer)
      full parameter constructor.
      Parameters:
      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.
    • CaomEntity

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

    • copyMe

      public abstract Entity copyMe()
      make a clone of the object taking into account current polymorhic type.
      Specified by:
      copyMe in class Entity
      Returns:
      the cloned object.
    • updateUsing

      public void updateUsing(CaomEntity 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.
    • getMaxLastModified

      public Date getMaxLastModified()
      Returns maxLastModified Attribute.
      Returns:
      maxLastModified Attribute
    • setMaxLastModified

      public void setMaxLastModified(Date pMaxLastModified)
      Set maxLastModified Attribute.
      Parameters:
      pMaxLastModified - value to set
    • withMaxLastModified

      public CaomEntity withMaxLastModified(Date pMaxLastModified)
      fluent setter for maxLastModified Attribute.
      Parameters:
      pMaxLastModified - value to set
      Returns:
      CaomEntity
    • getAccMetaChecksum

      public String getAccMetaChecksum()
      Returns accMetaChecksum Attribute.
      Returns:
      accMetaChecksum Attribute
    • setAccMetaChecksum

      public void setAccMetaChecksum(String pAccMetaChecksum)
      Set accMetaChecksum Attribute.
      Parameters:
      pAccMetaChecksum - value to set
    • withAccMetaChecksum

      public CaomEntity withAccMetaChecksum(String pAccMetaChecksum)
      fluent setter for accMetaChecksum Attribute.
      Parameters:
      pAccMetaChecksum - value to set
      Returns:
      CaomEntity
    • forceLoad

      public void forceLoad()
      Specified by:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
      Overrides:
      forceLoad in class Entity