Class ContextServiceImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.context.ContextServiceImpl
- All Implemented Interfaces:
VitamAutoCloseable,ContextService,AutoCloseable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) ConstructorContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, ContractService<IngestContractModel> ingestContract, ContractService<AccessContractModel> accessContract, SecurityProfileService securityProfileService, FunctionalBackupService functionalBackupService) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()createContexts(List<ContextModel> contextModelList) Create a list of contextsdeleteContext(String contextId, boolean forceDelete) Delete a contextfindContexts(com.fasterxml.jackson.databind.JsonNode queryDsl) Search for contextsFind a context by its idbooleansecurityProfileIsUsedInContexts(String securityProfileId) voidsetSecurityProfileService(SecurityProfileService securityProfileService) updateContext(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) Update a context
-
Field Details
-
CONTEXTS_BACKUP_EVENT
- See Also:
-
-
Constructor Details
-
ContextServiceImpl
public ContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) Constructor- Parameters:
mongoAccess- MongoDB client
-
ContextServiceImpl
public ContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, ContractService<IngestContractModel> ingestContract, ContractService<AccessContractModel> accessContract, SecurityProfileService securityProfileService, FunctionalBackupService functionalBackupService) Constructor- Parameters:
mongoAccess- MongoDB client
-
-
Method Details
-
createContexts
public RequestResponse<ContextModel> createContexts(List<ContextModel> contextModelList) throws VitamException Description copied from interface:ContextServiceCreate a list of contexts- Specified by:
createContextsin interfaceContextService- Parameters:
contextModelList- the context list to be created- Returns:
- a response as a RequestResponse
Object - Throws:
VitamException- thrown if operation could not be done
-
findContexts
public DbRequestResult findContexts(com.fasterxml.jackson.databind.JsonNode queryDsl) throws ReferentialException Description copied from interface:ContextServiceSearch for contexts- Specified by:
findContextsin interfaceContextService- Parameters:
queryDsl- the query to be used for the search- Returns:
- the list of contexts as a DbRequestResult
- Throws:
ReferentialException- thrown if the query could not be executed
-
findOneContextById
public ContextModel findOneContextById(String id) throws ReferentialException, InvalidParseOperationException Description copied from interface:ContextServiceFind a context by its id- Specified by:
findOneContextByIdin interfaceContextService- Parameters:
id- the id of the context- Returns:
- the context as a ContextModel
- Throws:
ReferentialException- thrown if the context could not be foundInvalidParseOperationException- thrown if the query is incorrect
-
deleteContext
public RequestResponse<ContextModel> deleteContext(String contextId, boolean forceDelete) throws VitamException Description copied from interface:ContextServiceDelete a context- Specified by:
deleteContextin interfaceContextService- Parameters:
contextId- the id of the context- Returns:
- a response as a RequestResponse
object - Throws:
VitamException- thrown if operation could not be done
-
securityProfileIsUsedInContexts
public boolean securityProfileIsUsedInContexts(String securityProfileId) throws InvalidCreateOperationException, ReferentialException, InvalidParseOperationException - Specified by:
securityProfileIsUsedInContextsin interfaceContextService- Throws:
InvalidCreateOperationExceptionReferentialExceptionInvalidParseOperationException
-
updateContext
public RequestResponse<ContextModel> updateContext(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException Description copied from interface:ContextServiceUpdate a context- Specified by:
updateContextin interfaceContextService- Parameters:
id- the id of the contextqueryDsl- the update command as a query- Returns:
- a response as a RequestResponse
object - Throws:
VitamException- thrown if operation could not be done
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-
setSecurityProfileService
- Specified by:
setSecurityProfileServicein interfaceContextService
-