E
- Class associated with this Documentpublic abstract class MetadataDocument<E> extends VitamDocument<E>
Modifier and Type | Field and Description |
---|---|
static String[] |
ES_PROJECTION
Quick projection for ID and ObjectGroup Only
|
static String |
GRAPH_LAST_PERSISTED_DATE
Last persisted date of Unit / Object Group
|
static String |
NBCHILD
Number of copies or
Number of Immediate child (Unit) |
static String |
OG
ObjectGroup link (Unit to ObjectGroup)
|
static String |
OPI
Initial Operation (both Unit and ObjectGroup)
|
static String |
OPS
Array of operations (both Unit and ObjectGroup)
|
static String |
ORIGINATING_AGENCIES
ORIGINATING_AGENCIES : list of all originating agencies for unit
|
static String |
ORIGINATING_AGENCY
ORIGINATING_AGENCy : Principal originating agency for unit
|
static String |
QUALIFIERS
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
|
static String |
TYPE
Object Type (text, audio, video, document, image, ...) Unit Type (facture, paye, ...)
|
static String |
UNITUPS
All unit parents
|
static String |
UP
Parents link (Units or ObjectGroup to parent Units)
|
ES_FILTER_OUT, ID, IMPLEMENTATIONVERSION, SCORE, SEDAVERSION, TENANT_ID, VERSION
Constructor and Description |
---|
MetadataDocument()
Empty constructor
|
MetadataDocument(org.bson.Document content)
Constructor from Document
|
MetadataDocument(com.fasterxml.jackson.databind.JsonNode content)
Constructor from Json
|
MetadataDocument(String content)
Constructor from Json as text
|
Modifier and Type | Method and Description |
---|---|
MetadataDocument<E> |
checkId()
Create a new ID
|
MetadataDocument<E> |
delete()
Delete the current object
|
protected abstract com.mongodb.client.MongoCollection<E> |
getCollection() |
<T> Collection<T> |
getCollectionOrEmpty(String name) |
String |
getId() |
<V> Map<String,V> |
getMapOrEmpty(String name) |
protected abstract MetadataCollections |
getMetadataCollections() |
String |
getSp() |
Collection<String> |
getUp() |
protected MetadataDocument<E> |
insert()
Insert the document (only for new): should not be called elsewhere
|
String |
toStringDebug() |
String |
toStringDirect() |
MetadataDocument<E> |
update(org.bson.conversions.Bson update)
Update the object to the database
|
getConcernedDiffLines, getTenantId, getUnifiedDiff, getVersion, newInstance, toString
append, clear, containsKey, containsValue, entrySet, equals, get, get, getBoolean, getBoolean, getDate, getDouble, getInteger, getInteger, getLong, getObjectId, getString, hashCode, isEmpty, keySet, parse, parse, put, putAll, remove, size, toBsonDocument, toJson, toJson, toJson, toJson, values
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public static final String QUALIFIERS
public static final String NBCHILD
public static final String TYPE
public static final String UP
public static final String OG
public static final String OPS
public static final String OPI
public static final String ORIGINATING_AGENCY
public static final String ORIGINATING_AGENCIES
public static final String UNITUPS
public static final String GRAPH_LAST_PERSISTED_DATE
public static final String[] ES_PROJECTION
public MetadataDocument()
public MetadataDocument(com.fasterxml.jackson.databind.JsonNode content)
content
- in JsonNode format for building MetadataDocumentpublic MetadataDocument(org.bson.Document content)
content
- in Document format for building MetadataDocumentpublic MetadataDocument(String content)
content
- in String format for building MetadataDocumentpublic MetadataDocument<E> checkId()
checkId
in class VitamDocument<E>
public final String getId()
getId
in class VitamDocument<E>
protected abstract com.mongodb.client.MongoCollection<E> getCollection()
protected abstract MetadataCollections getMetadataCollections()
public MetadataDocument<E> update(org.bson.conversions.Bson update) throws MetaDataExecutionException
update
- data of update operationMetaDataExecutionException
- if mongo exception query or illegal argument of query for update operationprotected final MetadataDocument<E> insert() throws MetaDataExecutionException, MetaDataAlreadyExistException
MetaDataExecutionException
- if mongo exception query or illegal argument of queryMetaDataAlreadyExistException
public final MetadataDocument<E> delete() throws MetaDataExecutionException
MetadataDocument
MetaDataExecutionException
- if mongo exception delete request on collectionpublic String toStringDirect()
toStringDirect
in class VitamDocument<E>
public String toStringDebug()
public <T> Collection<T> getCollectionOrEmpty(String name)
public String getSp()
public Collection<String> getUp()
Copyright © 2018 Vitam. All rights reserved.