Class ContextServiceImpl
java.lang.Object
fr.gouv.vitam.functional.administration.core.context.ContextServiceImpl
- All Implemented Interfaces:
VitamAutoCloseable
,ContextService
,AutoCloseable
-
Field Summary
-
Constructor Summary
ConstructorDescriptionContextServiceImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService) ConstructorContextServiceImpl
(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, ContractService<IngestContractModel> ingestContract, ContractService<AccessContractModel> accessContract, SecurityProfileService securityProfileService, FunctionalBackupService functionalBackupService) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 idboolean
securityProfileIsUsedInContexts
(String securityProfileId) void
setSecurityProfileService
(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:ContextService
Create a list of contexts- Specified by:
createContexts
in 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:ContextService
Search for contexts- Specified by:
findContexts
in 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:ContextService
Find a context by its id- Specified by:
findOneContextById
in 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:ContextService
Delete a context- Specified by:
deleteContext
in 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:
securityProfileIsUsedInContexts
in interfaceContextService
- Throws:
InvalidCreateOperationException
ReferentialException
InvalidParseOperationException
-
updateContext
public RequestResponse<ContextModel> updateContext(String id, com.fasterxml.jackson.databind.JsonNode queryDsl) throws VitamException Description copied from interface:ContextService
Update a context- Specified by:
updateContext
in 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVitamAutoCloseable
-
setSecurityProfileService
- Specified by:
setSecurityProfileService
in interfaceContextService
-