Class ProjectRepository
- java.lang.Object
-
- fr.gouv.vitam.collect.internal.core.repository.ProjectRepository
-
public class ProjectRepository extends java.lang.Object
repository for project entities management in mongo.
-
-
Constructor Summary
Constructors Constructor Description ProjectRepository(MongoDbAccess mongoDbAccess)
ProjectRepository(MongoDbAccess mongoDbAccess, java.lang.String collectionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createProject(ProjectModel projectModel)
create a project modelvoid
deleteProject(java.lang.String id)
delete a project modeljava.util.Optional<ProjectModel>
findProjectById(java.lang.String id)
return project according to idjava.util.List<ProjectModel>
findProjectsByTenant(java.lang.Integer tenant)
return project according to tenantjava.util.List<ProjectModel>
searchProject(java.lang.String searchValue, int tenant)
return projects according to criteriavoid
updateProject(ProjectModel projectModel)
update a project model
-
-
-
Constructor Detail
-
ProjectRepository
public ProjectRepository(MongoDbAccess mongoDbAccess, java.lang.String collectionName)
-
ProjectRepository
public ProjectRepository(MongoDbAccess mongoDbAccess)
-
-
Method Detail
-
createProject
public void createProject(ProjectModel projectModel) throws CollectInternalException
create a project model- Parameters:
projectModel
- project model to create- Throws:
CollectInternalException
- exception thrown in case of error
-
updateProject
public void updateProject(ProjectModel projectModel) throws CollectInternalException
update a project model- Parameters:
projectModel
- project model to replace- Throws:
CollectInternalException
- exception thrown in case of error
-
findProjectById
public java.util.Optional<ProjectModel> findProjectById(java.lang.String id) throws CollectInternalException
return project according to id- Parameters:
id
- project id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
findProjectsByTenant
public java.util.List<ProjectModel> findProjectsByTenant(java.lang.Integer tenant) throws CollectInternalException
return project according to tenant- Parameters:
tenant
- tenant id to find- Returns:
- Optional
- Throws:
CollectInternalException
- exception thrown in case of error
-
deleteProject
public void deleteProject(java.lang.String id)
delete a project model- Parameters:
id
- project to delete
-
searchProject
public java.util.List<ProjectModel> searchProject(java.lang.String searchValue, int tenant) throws CollectInternalException
return projects according to criteria- Parameters:
searchValue
- value Of searchtenant
- tenant- Returns:
- List
- Throws:
CollectInternalException
- exception thrown in case of error
-
-