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
The default Vitam Type object to be stored in the database (MongoDb/ElasticSearch mode)
- See Also:
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Approximate creation date of Unit / Object Groupstatic final String
Approximate update date of Unit / Object Groupstatic final String
Internal version of the document: Incremented for each update (including computed fields)static final String
static final String
Last persisted date of Unit / Object Groupstatic final String
Management contract Idstatic final String
Number of copies or
Number of Immediate child (Unit)static final String
ObjectGroup link (Unit to ObjectGroup)static final String
Initial Operation (both Unit and ObjectGroup)static final String
Array of operations (both Unit and ObjectGroup)static final String
ORIGINATING_AGENCIES : list of all originating agencies for unitstatic final String
ORIGINATING_AGENCy : Principal originating agency for unitstatic final String
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)static final String
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)static final String
All unit parentsstatic final String
Parents link (Units or ObjectGroup to parent Units)static final String
Fields inherited from class fr.gouv.vitam.common.database.server.mongodb.VitamDocument
ES_FILTER_OUT, ID, IMPLEMENTATIONVERSION, SCORE, SEDAVERSION, TENANT_ID, VERSION
Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY
-
Constructor Summary
ConstructorDescriptionEmpty constructorMetadataDocument
(com.fasterxml.jackson.databind.JsonNode content) Constructor from JsonMetadataDocument
(String content) Constructor from Json as textMetadataDocument
(org.bson.Document content) Constructor from Document -
Method Summary
Modifier and TypeMethodDescriptioncheckId()
Create a new IDprotected abstract com.mongodb.client.MongoCollection<E>
<T> Collection<T>
getCollectionOrEmpty
(String name) final String
getId()
getMapOrEmpty
(String name) protected abstract MetadataCollections
getSp()
getUp()
void
setApproximateCreationDate
(LocalDateTime creationDate) void
setApproximateUpdateDate
(LocalDateTime lastUpdate) 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
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bson.conversions.Bson
toBsonDocument
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
ATOMIC_VERSION
Internal version of the document: Incremented for each update (including computed fields)- See Also:
-
QUALIFIERS
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)- See Also:
-
NBCHILD
Number of copies or
Number of Immediate child (Unit)- See Also:
-
MANAGEMENT_CONTRACT_ID
Management contract Id- See Also:
-
TYPE
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)- See Also:
-
UP
Parents link (Units or ObjectGroup to parent Units)- See Also:
-
OG
ObjectGroup link (Unit to ObjectGroup)- See Also:
-
OPS
Array of operations (both Unit and ObjectGroup)- See Also:
-
OPI
Initial Operation (both Unit and ObjectGroup)- See Also:
-
ORIGINATING_AGENCY
ORIGINATING_AGENCy : Principal originating agency for unit- See Also:
-
ORIGINATING_AGENCIES
ORIGINATING_AGENCIES : list of all originating agencies for unit- See Also:
-
UNITUPS
All unit parents- See Also:
-
GRAPH_LAST_PERSISTED_DATE
Last persisted date of Unit / Object Group- See Also:
-
APPROXIMATE_CREATION_DATE
Approximate creation date of Unit / Object Group- See Also:
-
APPROXIMATE_UPDATE_DATE
Approximate update date of Unit / Object Group- See Also:
-
BATCH_ID
- See Also:
-
UPLOAD_PATH
- See Also:
-
-
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
Constructor from Json as text- Parameters:
content
- in String format for building MetadataDocument
-
-
Method Details
-
checkId
Create a new ID- Overrides:
checkId
in classVitamDocument<E>
- Returns:
- this MetadataDocument
-
getId
- Overrides:
getId
in classVitamDocument<E>
- Returns:
- the ID
-
getCollection
- Returns:
- the associated collection
-
getMetadataCollections
- Returns:
- the associated VitamCollection
-
toStringDirect
- Overrides:
toStringDirect
in classVitamDocument<E>
- Returns:
- the bypass toString
-
toStringDebug
- Returns:
- the toString for Debug mode
-
getCollectionOrEmpty
-
getMapOrEmpty
-
getSp
-
getUp
-
getAtomicVersion
-
setApproximateCreationDate
-
setApproximateUpdateDate
-