Class MetadataDocument<E>

  • Type Parameters:
    E - Class associated with this Document
    All Implemented Interfaces:
    java.io.Serializable, java.util.Map<java.lang.String,​java.lang.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:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface java.util.Map

        java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ATOMIC_VERSION
      Internal version of the document: Incremented for each update (including computed fields)
      static java.lang.String GRAPH_LAST_PERSISTED_DATE
      Last persisted date of Unit / Object Group
      static java.lang.String NBCHILD
      Number of copies or
      Number of Immediate child (Unit)
      static java.lang.String OG
      ObjectGroup link (Unit to ObjectGroup)
      static java.lang.String OPI
      Initial Operation (both Unit and ObjectGroup)
      static java.lang.String OPS
      Array of operations (both Unit and ObjectGroup)
      static java.lang.String ORIGINATING_AGENCIES
      ORIGINATING_AGENCIES : list of all originating agencies for unit
      static java.lang.String ORIGINATING_AGENCY
      ORIGINATING_AGENCy : Principal originating agency for unit
      static java.lang.String QUALIFIERS
      Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
      static java.lang.String TYPE
      Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
      static java.lang.String UNITUPS
      All unit parents
      static java.lang.String UP
      Parents link (Units or ObjectGroup to parent Units)
    • Constructor Summary

      Constructors 
      Constructor Description
      MetadataDocument()
      Empty constructor
      MetadataDocument​(com.fasterxml.jackson.databind.JsonNode content)
      Constructor from Json
      MetadataDocument​(java.lang.String content)
      Constructor from Json as text
      MetadataDocument​(org.bson.Document content)
      Constructor from Document
    • Field Detail

      • ATOMIC_VERSION

        public static final java.lang.String ATOMIC_VERSION
        Internal version of the document: Incremented for each update (including computed fields)
        See Also:
        Constant Field Values
      • QUALIFIERS

        public static final java.lang.String QUALIFIERS
        Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
        See Also:
        Constant Field Values
      • NBCHILD

        public static final java.lang.String NBCHILD
        Number of copies or
        Number of Immediate child (Unit)
        See Also:
        Constant Field Values
      • TYPE

        public static final java.lang.String TYPE
        Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
        See Also:
        Constant Field Values
      • UP

        public static final java.lang.String UP
        Parents link (Units or ObjectGroup to parent Units)
        See Also:
        Constant Field Values
      • OG

        public static final java.lang.String OG
        ObjectGroup link (Unit to ObjectGroup)
        See Also:
        Constant Field Values
      • OPS

        public static final java.lang.String OPS
        Array of operations (both Unit and ObjectGroup)
        See Also:
        Constant Field Values
      • OPI

        public static final java.lang.String OPI
        Initial Operation (both Unit and ObjectGroup)
        See Also:
        Constant Field Values
      • ORIGINATING_AGENCY

        public static final java.lang.String ORIGINATING_AGENCY
        ORIGINATING_AGENCy : Principal originating agency for unit
        See Also:
        Constant Field Values
      • ORIGINATING_AGENCIES

        public static final java.lang.String ORIGINATING_AGENCIES
        ORIGINATING_AGENCIES : list of all originating agencies for unit
        See Also:
        Constant Field Values
      • GRAPH_LAST_PERSISTED_DATE

        public static final java.lang.String GRAPH_LAST_PERSISTED_DATE
        Last persisted date of Unit / Object Group
        See Also:
        Constant Field Values
    • Constructor Detail

      • 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​(java.lang.String content)
        Constructor from Json as text
        Parameters:
        content - in String format for building MetadataDocument
    • Method Detail

      • getId

        public final java.lang.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 java.lang.String toStringDirect()
        Overrides:
        toStringDirect in class VitamDocument<E>
        Returns:
        the bypass toString
      • toStringDebug

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

        public <T> java.util.Collection<T> getCollectionOrEmpty​(java.lang.String name)
      • getMapOrEmpty

        public <V> java.util.Map<java.lang.String,​V> getMapOrEmpty​(java.lang.String name)
      • getSp

        public java.lang.String getSp()
      • getUp

        public java.util.Collection<java.lang.String> getUp()
      • getAtomicVersion

        public java.lang.Integer getAtomicVersion()