Class ContextServiceImpl
- java.lang.Object
-
- fr.gouv.vitam.functional.administration.core.context.ContextServiceImpl
-
- All Implemented Interfaces:
VitamAutoCloseable,ContextService,java.lang.AutoCloseable
public class ContextServiceImpl extends java.lang.Object implements ContextService
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTEXTS_BACKUP_EVENT
-
Constructor Summary
Constructors Constructor Description ContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService)ConstructorContextServiceImpl(MongoDbAccessAdminImpl mongoAccess, VitamCounterService vitamCounterService, ContractService<IngestContractModel> ingestContract, ContractService<AccessContractModel> accessContract, SecurityProfileService securityProfileService, FunctionalBackupService functionalBackupService)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()RequestResponse<ContextModel>createContexts(java.util.List<ContextModel> contextModelList)Create a list of contextsRequestResponse<ContextModel>deleteContext(java.lang.String contextId, boolean forceDelete)Delete a contextDbRequestResultfindContexts(com.fasterxml.jackson.databind.JsonNode queryDsl)Search for contextsContextModelfindOneContextById(java.lang.String id)Find a context by its idbooleansecurityProfileIsUsedInContexts(java.lang.String securityProfileId)voidsetSecurityProfileService(SecurityProfileService securityProfileService)RequestResponse<ContextModel>updateContext(java.lang.String id, com.fasterxml.jackson.databind.JsonNode queryDsl)Update a context
-
-
-
Field Detail
-
CONTEXTS_BACKUP_EVENT
public static final java.lang.String CONTEXTS_BACKUP_EVENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
createContexts
public RequestResponse<ContextModel> createContexts(java.util.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(java.lang.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(java.lang.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(java.lang.String securityProfileId) throws InvalidCreateOperationException, ReferentialException, InvalidParseOperationException- Specified by:
securityProfileIsUsedInContextsin interfaceContextService- Throws:
InvalidCreateOperationExceptionReferentialExceptionInvalidParseOperationException
-
updateContext
public RequestResponse<ContextModel> updateContext(java.lang.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 interfacejava.lang.AutoCloseable- Specified by:
closein interfaceVitamAutoCloseable
-
setSecurityProfileService
public void setSecurityProfileService(SecurityProfileService securityProfileService)
- Specified by:
setSecurityProfileServicein interfaceContextService
-
-