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:
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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
APPROXIMATE_CREATION_DATE
Approximate creation date of Unit / Object Groupstatic java.lang.String
APPROXIMATE_UPDATE_DATE
Approximate update date of Unit / Object Groupstatic 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 Groupstatic java.lang.String
MANAGEMENT_CONTRACT_ID
Management contract Idstatic 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 unitstatic java.lang.String
ORIGINATING_AGENCY
ORIGINATING_AGENCy : Principal originating agency for unitstatic 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 parentsstatic java.lang.String
UP
Parents link (Units or ObjectGroup to parent Units)-
Fields inherited from class fr.gouv.vitam.common.database.server.mongodb.VitamDocument
ES_FILTER_OUT, ID, IMPLEMENTATIONVERSION, SCORE, SEDAVERSION, TENANT_ID, VERSION
-
-
Constructor Summary
Constructors Constructor Description MetadataDocument()
Empty constructorMetadataDocument(com.fasterxml.jackson.databind.JsonNode content)
Constructor from JsonMetadataDocument(java.lang.String content)
Constructor from Json as textMetadataDocument(org.bson.Document content)
Constructor from Document
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MetadataDocument<E>
checkId()
Create a new IDjava.lang.Integer
getAtomicVersion()
protected abstract com.mongodb.client.MongoCollection<E>
getCollection()
<T> java.util.Collection<T>
getCollectionOrEmpty(java.lang.String name)
java.lang.String
getId()
<V> java.util.Map<java.lang.String,V>
getMapOrEmpty(java.lang.String name)
protected abstract MetadataCollections
getMetadataCollections()
java.lang.String
getSp()
java.util.Collection<java.lang.String>
getUp()
void
setApproximateCreationDate(java.time.LocalDateTime creationDate)
void
setApproximateUpdateDate(java.time.LocalDateTime lastUpdate)
java.lang.String
toStringDebug()
java.lang.String
toStringDirect()
-
Methods inherited from class fr.gouv.vitam.common.database.server.mongodb.VitamDocument
getConcernedDiffLines, getOriginalDiffLines, getTenantId, getUnifiedDiff, getVersion, newInstance, toString
-
Methods inherited from class org.bson.Document
append, clear, containsKey, containsValue, entrySet, equals, get, get, get, getBoolean, getBoolean, getDate, getDouble, getEmbedded, getEmbedded, getInteger, getInteger, getList, getList, getLong, getObjectId, getString, hashCode, isEmpty, keySet, parse, parse, put, putAll, remove, size, toBsonDocument, toJson, toJson, toJson, toJson, values
-
-
-
-
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
-
MANAGEMENT_CONTRACT_ID
public static final java.lang.String MANAGEMENT_CONTRACT_ID
Management contract Id- 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
-
UNITUPS
public static final java.lang.String UNITUPS
All unit parents- 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
-
APPROXIMATE_CREATION_DATE
public static final java.lang.String APPROXIMATE_CREATION_DATE
Approximate creation date of Unit / Object Group- See Also:
- Constant Field Values
-
APPROXIMATE_UPDATE_DATE
public static final java.lang.String APPROXIMATE_UPDATE_DATE
Approximate update 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
-
checkId
public MetadataDocument<E> checkId()
Create a new ID- Overrides:
checkId
in classVitamDocument<E>
- Returns:
- this MetadataDocument
-
getId
public final java.lang.String getId()
- Overrides:
getId
in classVitamDocument<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 classVitamDocument<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()
-
setApproximateCreationDate
public void setApproximateCreationDate(java.time.LocalDateTime creationDate)
-
setApproximateUpdateDate
public void setApproximateUpdateDate(java.time.LocalDateTime lastUpdate)
-
-