Class VitamCollection<T>
- java.lang.Object
-
- fr.gouv.vitam.common.database.collections.VitamCollection<T>
-
public class VitamCollection<T> extends java.lang.Object
Vitam Collection for mongodb
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
VitamCollection(java.lang.Class<T> clasz, boolean isMultiTenant, boolean useScore, java.lang.String prefix, VitamDescriptionResolver vitamDescriptionResolver)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.lang.Boolean
containMatch()
java.lang.Class<T>
getClasz()
com.mongodb.client.MongoCollection<T>
getCollection()
ElasticsearchAccess
getEsClient()
static com.mongodb.MongoClientOptions
getMongoClientOptions()
static com.mongodb.MongoClientOptions
getMongoClientOptions(java.util.List<java.lang.Class<?>> claszList)
java.lang.String
getName()
VitamDescriptionResolver
getVitamDescriptionResolver()
void
initialize(com.mongodb.client.MongoDatabase db, boolean recreate)
Initialize the collectionvoid
initialize(ElasticsearchAccess esClient)
Initialize the ES Clientvoid
initialize(ElasticsearchAccess esClient, boolean createIndexByTenant)
Initialize the ES Clientboolean
isCreateIndexByTenant()
boolean
isMultiTenant()
boolean
isUseScore()
void
setCreateIndexByTenant(boolean createIndexByTenant)
static void
setMatch(java.lang.Boolean match)
void
setName(java.lang.String name)
-
-
-
Constructor Detail
-
VitamCollection
protected VitamCollection(java.lang.Class<T> clasz, boolean isMultiTenant, boolean useScore, java.lang.String prefix, VitamDescriptionResolver vitamDescriptionResolver)
-
-
Method Detail
-
containMatch
public static java.lang.Boolean containMatch()
- Returns:
- true if the real query contains match
-
setMatch
public static void setMatch(java.lang.Boolean match)
- Parameters:
match
- if the final query contains match
-
initialize
public void initialize(com.mongodb.client.MongoDatabase db, boolean recreate)
Initialize the collection- Parameters:
db
- mongodb databaserecreate
- boolean if recreate the database
-
initialize
public void initialize(ElasticsearchAccess esClient)
Initialize the ES Client- Parameters:
esClient
- ElasticsearchAccess ES Client
-
initialize
public void initialize(ElasticsearchAccess esClient, boolean createIndexByTenant)
Initialize the ES Client- Parameters:
esClient
- ElasticsearchAccess ES Client
-
getName
public java.lang.String getName()
- Returns:
- the name of the collection
-
setName
public void setName(java.lang.String name)
-
getCollection
public com.mongodb.client.MongoCollection<T> getCollection()
- Returns:
- the associated MongoCollection
-
getClasz
public java.lang.Class<T> getClasz()
- Returns:
- the associated class
-
getEsClient
public ElasticsearchAccess getEsClient()
- Returns:
- the esClient
-
getMongoClientOptions
public static com.mongodb.MongoClientOptions getMongoClientOptions(java.util.List<java.lang.Class<?>> claszList)
- Parameters:
claszList
- Vitam document extended class list- Returns:
- MongoClientOptions for mongoClient
-
getMongoClientOptions
public static com.mongodb.MongoClientOptions getMongoClientOptions()
-
isMultiTenant
public boolean isMultiTenant()
- Returns:
- isMultiTenant value
-
isUseScore
public boolean isUseScore()
- Returns:
- the useScore
-
isCreateIndexByTenant
public boolean isCreateIndexByTenant()
-
setCreateIndexByTenant
public void setCreateIndexByTenant(boolean createIndexByTenant)
-
getVitamDescriptionResolver
public VitamDescriptionResolver getVitamDescriptionResolver()
-
-