Class DbRequestHelper
- java.lang.Object
-
- fr.gouv.vitam.common.database.server.DbRequestHelper
-
public class DbRequestHelper extends java.lang.Object
DbRequest Helper common for Single and Multiple
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CONSISTENCY_ERROR_THE_DOCUMENT_GUID_S_IN_ES_IS_NOT_IN_MONGO_DB_ANYMORE_TENANT_S_REQUEST_ID_S
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isDuplicateKeyError(java.lang.Exception e)
Helper to detect if document already exists so update needed instead of insertstatic <T extends VitamDocument<?>>
com.mongodb.client.MongoCursor<T>selectMongoDbExecuteThroughFakeMongoCursor(VitamCollection<T> collection, RequestParserSingle parser, java.util.List<java.lang.String> list, java.util.List<java.lang.Float> scores)
Private method for select using MongoDb from Elasticsearch result
-
-
-
Field Detail
-
CONSISTENCY_ERROR_THE_DOCUMENT_GUID_S_IN_ES_IS_NOT_IN_MONGO_DB_ANYMORE_TENANT_S_REQUEST_ID_S
public static final java.lang.String CONSISTENCY_ERROR_THE_DOCUMENT_GUID_S_IN_ES_IS_NOT_IN_MONGO_DB_ANYMORE_TENANT_S_REQUEST_ID_S
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDuplicateKeyError
public static boolean isDuplicateKeyError(java.lang.Exception e)
Helper to detect if document already exists so update needed instead of insert- Returns:
- true if an insert that should be an Update, else False
-
selectMongoDbExecuteThroughFakeMongoCursor
public static <T extends VitamDocument<?>> com.mongodb.client.MongoCursor<T> selectMongoDbExecuteThroughFakeMongoCursor(VitamCollection<T> collection, RequestParserSingle parser, java.util.List<java.lang.String> list, java.util.List<java.lang.Float> scores) throws InvalidParseOperationException, VitamDBException
Private method for select using MongoDb from Elasticsearch result- Parameters:
collection
-parser
-list
- list of Idsscores
- can be null, containing scores- Returns:
- MongoCursor of VitamDocument
- Throws:
InvalidParseOperationException
- when query is not correctInvalidCreateOperationException
VitamDBException
-
-