Class MetadataDocument<E>

java.lang.Object
org.bson.Document
fr.gouv.vitam.common.database.server.mongodb.VitamDocument<E>
fr.gouv.vitam.metadata.core.database.collections.MetadataDocument<E>
Type Parameters:
E - Class associated with this Document
All Implemented Interfaces:
Serializable, Map<String,Object>, org.bson.conversions.Bson
Direct Known Subclasses:
ObjectGroup, Unit

public abstract class MetadataDocument<E> extends VitamDocument<E>
The default Vitam Type object to be stored in the database (MongoDb/ElasticSearch mode)
See Also:
  • Field Details

  • Constructor Details

    • MetadataDocument

      public MetadataDocument()
      Empty constructor
    • MetadataDocument

      public MetadataDocument(com.fasterxml.jackson.databind.JsonNode content)
      Constructor from Json
      Parameters:
      content - in JsonNode format for building MetadataDocument
    • MetadataDocument

      public MetadataDocument(org.bson.Document content)
      Constructor from Document
      Parameters:
      content - in Document format for building MetadataDocument
    • MetadataDocument

      public MetadataDocument(String content)
      Constructor from Json as text
      Parameters:
      content - in String format for building MetadataDocument
  • Method Details

    • checkId

      public MetadataDocument<E> checkId()
      Create a new ID
      Overrides:
      checkId in class VitamDocument<E>
      Returns:
      this MetadataDocument
    • getId

      public final String getId()
      Overrides:
      getId in class VitamDocument<E>
      Returns:
      the ID
    • getCollection

      protected abstract com.mongodb.client.MongoCollection<E> getCollection()
      Returns:
      the associated collection
    • getMetadataCollections

      protected abstract MetadataCollections getMetadataCollections()
      Returns:
      the associated VitamCollection
    • toStringDirect

      public String toStringDirect()
      Overrides:
      toStringDirect in class VitamDocument<E>
      Returns:
      the bypass toString
    • toStringDebug

      public String toStringDebug()
      Returns:
      the toString for Debug mode
    • getCollectionOrEmpty

      public <T> Collection<T> getCollectionOrEmpty(String name)
    • getMapOrEmpty

      public <V> Map<String,V> getMapOrEmpty(String name)
    • getSp

      public String getSp()
    • getUp

      public Collection<String> getUp()
    • getAtomicVersion

      public Integer getAtomicVersion()
    • setApproximateCreationDate

      public void setApproximateCreationDate(LocalDateTime creationDate)
    • setApproximateUpdateDate

      public void setApproximateUpdateDate(LocalDateTime lastUpdate)