Class VitamDocument<E>
java.lang.Object
org.bson.Document
fr.gouv.vitam.common.database.server.mongodb.VitamDocument<E>
- Type Parameters:
E
- Class used to implement the Document
- All Implemented Interfaces:
Serializable
,Map<String,
,Object> org.bson.conversions.Bson
- Direct Known Subclasses:
AccessContract
,AccessionRegisterDetail
,AccessionRegisterSummary
,AccessionRegisterSymbolic
,Agencies
,ArchiveUnitProfile
,Context
,FileFormat
,FileRules
,Griffin
,IngestContract
,LogbookLifeCycle
,LogbookOperation
,ManagementContract
,MetadataDocument
,MetadataSnapshot
,Ontology
,PreservationScenario
,Profile
,Schema
,SecurityProfile
,VitamSequence
public abstract class VitamDocument<E>
extends org.bson.Document
Vitam Document MongoDb abstract
- See Also:
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]
Filter ES outstatic final String
ID of each line: different for each sub typestatic final String
Current Vitam Versionstatic final String
Scorestatic final String
Current Seda Versionstatic final String
TenantIdstatic final String
Version of the document: Incremented for each main updates (excluding computed fields)Fields inherited from interface org.bson.conversions.Bson
DEFAULT_CODEC_REGISTRY
-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructorVitamDocument
(com.fasterxml.jackson.databind.JsonNode content) Constructor from JsonVitamDocument
(String content) Constructor from JsonVitamDocument
(org.bson.Document content) Constructor from Document -
Method Summary
Modifier and TypeMethodDescriptionprotected VitamDocument<E>
checkId()
check if Id is validgetConcernedDiffLines
(List<String> diff) Retrieve only + and - lines on diff (for logbook lifecycle) regexp = line started by + or - with at least one space after and any charactergetId()
getOriginalDiffLines
(String diff) final Integer
getUnifiedDiff
(String original, String revised) Get unified difffinal Integer
abstract VitamDocument<E>
newInstance
(com.fasterxml.jackson.databind.JsonNode content) Make a new instance of the document with the given jsontoString()
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
-
ID
ID of each line: different for each sub type- See Also:
-
VERSION
Version of the document: Incremented for each main updates (excluding computed fields)- See Also:
-
TENANT_ID
TenantId- See Also:
-
SCORE
Score- See Also:
-
SEDAVERSION
Current Seda Version- See Also:
-
IMPLEMENTATIONVERSION
Current Vitam Version- See Also:
-
ES_FILTER_OUT
Filter ES out
-
-
Constructor Details
-
VitamDocument
public VitamDocument()Empty constructor -
VitamDocument
Constructor from Json- Parameters:
content
- String- Throws:
IllegalArgumentException
- if Id is not a GUID
-
VitamDocument
public VitamDocument(com.fasterxml.jackson.databind.JsonNode content) Constructor from Json- Parameters:
content
- as JsonNode- Throws:
IllegalArgumentException
- if Id is not a GUID
-
VitamDocument
public VitamDocument(org.bson.Document content) Constructor from Document- Parameters:
content
- Document- Throws:
IllegalArgumentException
- if Id is not a GUID
-
-
Method Details
-
newInstance
Make a new instance of the document with the given json- Parameters:
content
- document structure as json- Returns:
- new document with the json as content
-
checkId
check if Id is valid- Returns:
- this
- Throws:
IllegalArgumentException
- if Id is not a GUID
-
getId
- Returns:
- the ID
-
getTenantId
- Returns:
- the TenantId
-
getVersion
- Returns:
- the version
-
toStringDirect
- Returns:
- the bypass toString
-
toString
- Overrides:
toString
in classorg.bson.Document
-
getUnifiedDiff
Get unified diff- Parameters:
original
- the original valuerevised
- the revisited value- Returns:
- unified diff (each list entry is a diff line)
-
getConcernedDiffLines
Retrieve only + and - lines on diff (for logbook lifecycle) regexp = line started by + or - with at least one space after and any character- Parameters:
diff
- the unified diff- Returns:
- + and - lines for logbook lifecycle
-
getOriginalDiffLines
-