Package fr.gouv.vitam.ihmdemo.core
Class UserInterfaceTransactionManager
java.lang.Object
fr.gouv.vitam.ihmdemo.core.UserInterfaceTransactionManager
Manage all the transactions received form the User Interface : a gateway to VITAM intern
-
Constructor Summary
ConstructorDescriptionUserInterfaceTransactionManager
(AccessExternalClientFactory accessExternalClientFactory, AdminExternalClientFactory adminExternalClientFactory, AccessExternalClientV2Factory accessExternalClientV2Factory, DslQueryHelper dslQueryHelper) -
Method Summary
Modifier and TypeMethodDescriptionRequestResponse<com.fasterxml.jackson.databind.JsonNode>
checkTraceabilityOperation
(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) Starts a Verification process based on a given DSLQueryRequestResponse<com.fasterxml.jackson.databind.JsonNode>
computinheritedrules
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) computinheritedrulesRequestResponse<com.fasterxml.jackson.databind.JsonNode>
deleteComputedInheritedRules
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) deletecomputinheritedrulesboolean
downloadExports
(javax.ws.rs.container.AsyncResponse asyncResponse, String exportId, VitamContext context, boolean isTransfer) Download DIP or Transfer SIPevidenceAudit
(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) launch Evidance Audit on selected AURequestResponse<com.fasterxml.jackson.databind.JsonNode>
exportDIP
(DipRequest dipRequest, VitamContext context) generate a DIP to be exportedexportProbativeValue
(ProbativeValueRequest request, VitamContext context) Launch an probative value export for the requestcom.fasterxml.jackson.databind.JsonNode
extractInformationFromTimestamp
(String timestamp) Extract information from timestampRequestResponse<com.fasterxml.jackson.databind.JsonNode>
findAccessionRegisterDetail
(String originatingAgency, String options, VitamContext context) findAccessionRegisterSummary
(String options, VitamContext context) findAccessionRegisterSymbolic
(String options, VitamContext context) Returns session id for the authenticated user.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
getArchiveUnitDetails
(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, String unitId, VitamContext context) Gets archive unit detailsgetContractId
(javax.servlet.http.HttpServletRequest request) boolean
getObjectAsInputStream
(javax.ws.rs.container.AsyncResponse asyncResponse, String unitId, String usage, int version, String filename, VitamContext context, List<javax.ws.rs.core.MediaType> allowedMediaTypes) Retrieve an Object data as an input streamgetPersonalCertificate
(javax.servlet.http.HttpServletRequest request) getTenantId
(javax.servlet.http.HttpServletRequest request) getVitamContext
(Integer tenantId, String contractId, String personalCert) getVitamContext
(Integer tenantId, String contractId, javax.servlet.http.HttpServletRequest request) getVitamContext
(javax.servlet.http.HttpServletRequest request) RequestResponse<com.fasterxml.jackson.databind.JsonNode>
massiveRulesUpdate
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) Massive Rules updateRequestResponse<com.fasterxml.jackson.databind.JsonNode>
massiveUnitsUpdate
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) Massive AU updateRequestResponse<com.fasterxml.jackson.databind.JsonNode>
searchObjects
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) Gets search objects resultRequestResponse<com.fasterxml.jackson.databind.JsonNode>
searchUnits
(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) Gets search units resultRequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectObjectbyId
(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, String objectId, VitamContext context) Retrieve an ObjectGroup as Json data based on the provided ObjectGroup idselectObjectGroupLifeCycleById
(String objectGroupLifeCycleId, VitamContext context) selectOperation
(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) selectOperationbyId
(String operationId, VitamContext context) selectUnitLifeCycleById
(String unitLifeCycleId, VitamContext context) RequestResponse<com.fasterxml.jackson.databind.JsonNode>
selectUnitsWithInheritedRules
(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, VitamContext context) Gets archive unit details with inheritedRulesRequestResponse<com.fasterxml.jackson.databind.JsonNode>
startEliminationAction
(EliminationRequestBody parameters, VitamContext context) Start elimination actionRequestResponse<com.fasterxml.jackson.databind.JsonNode>
startEliminationAnalysis
(EliminationRequestBody parameters, VitamContext context) Start elimination analysisRequestResponse<com.fasterxml.jackson.databind.JsonNode>
transferSIP
(TransferRequest transferRequest, VitamContext context) RequestResponse<com.fasterxml.jackson.databind.JsonNode>
updateUnits
(com.fasterxml.jackson.databind.JsonNode parameters, String unitId, VitamContext context) Update units result
-
Constructor Details
-
UserInterfaceTransactionManager
public UserInterfaceTransactionManager() -
UserInterfaceTransactionManager
public UserInterfaceTransactionManager(AccessExternalClientFactory accessExternalClientFactory, AdminExternalClientFactory adminExternalClientFactory, AccessExternalClientV2Factory accessExternalClientV2Factory, DslQueryHelper dslQueryHelper)
-
-
Method Details
-
getInstance
-
searchUnits
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> searchUnits(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException Gets search units result- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
- access client exception
-
searchObjects
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> searchObjects(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException Gets search objects result- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
- access client exception
-
getArchiveUnitDetails
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> getArchiveUnitDetails(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, String unitId, VitamContext context) throws VitamClientException Gets archive unit details- Parameters:
preparedDslQuery
- search criteria as DSL queryunitId
- archive unit id to findcontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
- access client exception
-
selectUnitsWithInheritedRules
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectUnitsWithInheritedRules(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, VitamContext context) throws VitamClientException Gets archive unit details with inheritedRules- Parameters:
preparedDslQuery
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
- access client exception
-
startEliminationAnalysis
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> startEliminationAnalysis(EliminationRequestBody parameters, VitamContext context) throws VitamClientException Start elimination analysis- Parameters:
parameters
- input for elimination workflowcontext
- Vitamcontext- Returns:
- result HTTP response
- Throws:
VitamClientException
- VitamClientException
-
startEliminationAction
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> startEliminationAction(EliminationRequestBody parameters, VitamContext context) throws VitamClientException Start elimination action- Parameters:
parameters
- input for elimination workflowcontext
- Vitamcontext- Returns:
- result HTTP response
- Throws:
VitamClientException
-
massiveUnitsUpdate
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> massiveUnitsUpdate(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException Massive AU update- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
-
computinheritedrules
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> computinheritedrules(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException computinheritedrules- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
-
deleteComputedInheritedRules
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> deleteComputedInheritedRules(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException deletecomputinheritedrules- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
-
massiveRulesUpdate
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> massiveRulesUpdate(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context) throws VitamClientException Massive Rules update- Parameters:
parameters
- search criteria as DSL querycontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
-
updateUnits
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> updateUnits(com.fasterxml.jackson.databind.JsonNode parameters, String unitId, VitamContext context) throws VitamClientException Update units result- Parameters:
parameters
- search criteria as DSL queryunitId
- unitIdentifiercontext
- Vitamcontext- Returns:
- result
- Throws:
VitamClientException
-
selectObjectbyId
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> selectObjectbyId(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, String objectId, VitamContext context) throws VitamClientException Retrieve an ObjectGroup as Json data based on the provided ObjectGroup id- Parameters:
preparedDslQuery
- the query to be executedobjectId
- the Id of the ObjectGroupcontext
- Vitamcontext- Returns:
- JsonNode object including DSL queries, context and results
- Throws:
VitamClientException
- if the client encountered an exception
-
getObjectAsInputStream
public boolean getObjectAsInputStream(javax.ws.rs.container.AsyncResponse asyncResponse, String unitId, String usage, int version, String filename, VitamContext context, List<javax.ws.rs.core.MediaType> allowedMediaTypes) throws UnsupportedEncodingException, VitamClientException Retrieve an Object data as an input stream- Parameters:
asyncResponse
- the asynchronous response to be usedunitId
- the Id of the ObjectGroupusage
- the requested usageversion
- the requested version of the usagefilename
- the name od the filecontext
- VitamcontextallowedMediaTypes
-- Returns:
- boolean for test purpose (solve mock issue)
- Throws:
UnsupportedEncodingException
- if unsupported encoding error for input file contentVitamClientException
- if the client encountered an exception
-
selectUnitLifeCycleById
public RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(String unitLifeCycleId, VitamContext context) throws VitamClientException - Parameters:
unitLifeCycleId
- the unit lifecycle id to selectcontext
- Vitamcontext- Returns:
- JsonNode result
- Throws:
InvalidParseOperationException
- if json data not well-formedAccessUnauthorizedException
VitamClientException
-
selectOperation
public RequestResponse<LogbookOperation> selectOperation(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) throws VitamClientException - Parameters:
query
- the select querycontext
- Vitamcontext- Returns:
- logbook operation result
- Throws:
VitamClientException
- access client exception
-
selectOperationbyId
public RequestResponse<LogbookOperation> selectOperationbyId(String operationId, VitamContext context) throws VitamClientException - Parameters:
operationId
- the operation idcontext
- Vitamcontext- Returns:
- logbook operation result
- Throws:
VitamClientException
-
selectObjectGroupLifeCycleById
public RequestResponse<LogbookLifecycle> selectObjectGroupLifeCycleById(String objectGroupLifeCycleId, VitamContext context) throws VitamClientException - Parameters:
objectGroupLifeCycleId
- the object lifecycle id to select* @param context Vitamcontext http- Returns:
- logbook lifecycle result
- Throws:
VitamClientException
- if the request with illegal parameter
-
findAccessionRegisterSummary
public RequestResponse<AccessionRegisterSummaryModel> findAccessionRegisterSummary(String options, VitamContext context) throws VitamClientException, InvalidParseOperationException, InvalidCreateOperationException - Parameters:
options
- for creating querycontext
- Vitamcontext- Returns:
- AccessionRegisterSummaryModel result
- Throws:
VitamClientException
- if the request with illegal parameterInvalidParseOperationException
- if json data not well-formedInvalidCreateOperationException
- if error when create query
-
findAccessionRegisterSymbolic
public RequestResponse<AccessionRegisterSymbolicModel> findAccessionRegisterSymbolic(String options, VitamContext context) throws VitamClientException, InvalidParseOperationException, InvalidCreateOperationException - Parameters:
options
- for creating querycontext
- Vitamcontext- Returns:
- AccessionRegisterSummaryModel result
- Throws:
VitamClientException
- if the request with illegal parameterInvalidParseOperationException
- if json data not well-formedInvalidCreateOperationException
- if error when create query
-
findAccessionRegisterDetail
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> findAccessionRegisterDetail(String originatingAgency, String options, VitamContext context) throws InvalidParseOperationException, AccessExternalClientServerException, AccessExternalClientNotFoundException, InvalidCreateOperationException - Parameters:
originatingAgency
- the id of the originating agencyoptions
- for creating querycontext
- Vitamcontext- Returns:
- JsonNode result
- Throws:
InvalidParseOperationException
- if json data not well-formedAccessExternalClientServerException
- if access internal server errorAccessExternalClientNotFoundException
- if access external resource not foundInvalidCreateOperationException
- if error when create query
-
checkTraceabilityOperation
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> checkTraceabilityOperation(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) throws AccessExternalClientServerException, InvalidParseOperationException, AccessUnauthorizedException Starts a Verification process based on a given DSLQuery- Parameters:
query
- DSLQuery to executecontext
- Vitamcontext- Returns:
- A RequestResponse contains the created logbookOperation for verification process
- Throws:
AccessExternalClientServerException
InvalidParseOperationException
AccessUnauthorizedException
-
extractInformationFromTimestamp
public com.fasterxml.jackson.databind.JsonNode extractInformationFromTimestamp(String timestamp) throws BadRequestException Extract information from timestamp- Parameters:
timestamp
- the timestamp to be used for extraction- Returns:
- json node containing genTime and issuer certificate information
- Throws:
BadRequestException
- if the timestamp cant be extracted
-
evidenceAudit
public RequestResponse evidenceAudit(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) throws VitamClientException launch Evidance Audit on selected AU- Parameters:
query
- search criteria as DSL query to select AUcontext
- VitamContext- Returns:
- a JsonNode for dip results
- Throws:
VitamClientException
- access client exception
-
exportProbativeValue
public RequestResponse exportProbativeValue(ProbativeValueRequest request, VitamContext context) throws VitamClientException Launch an probative value export for the request- Parameters:
request
- probative value requestcontext
- VitamContext- Returns:
- a JsonNode for dip results
- Throws:
VitamClientException
- access client exception
-
exportDIP
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> exportDIP(DipRequest dipRequest, VitamContext context) throws VitamClientException generate a DIP to be exported- Parameters:
dipRequest
- search criteria as DSL querycontext
- VitamContext- Returns:
- a JsonNode for dip results
- Throws:
InvalidParseOperationException
- unable to parse queryVitamClientException
- access client exception
-
transferSIP
public RequestResponse<com.fasterxml.jackson.databind.JsonNode> transferSIP(TransferRequest transferRequest, VitamContext context) throws VitamClientException - Throws:
VitamClientException
-
downloadExports
public boolean downloadExports(javax.ws.rs.container.AsyncResponse asyncResponse, String exportId, VitamContext context, boolean isTransfer) throws UnsupportedEncodingException, VitamClientException Download DIP or Transfer SIP- Parameters:
asyncResponse
- AsyncResponseexportId
- exportIdcontext
- vitam context- Returns:
- Throws:
UnsupportedEncodingException
VitamClientException
-
getVitamContext
-
getVitamContext
-
getVitamContext
public VitamContext getVitamContext(Integer tenantId, String contractId, javax.servlet.http.HttpServletRequest request) -
getPersonalCertificate
-
getContractId
-
getTenantId
-
getAppSessionId
Returns session id for the authenticated user.The application may track each logged user by a unique session id. This session id is passed to vitam and is persisted "as is" in Vitam logbook operations. In case of audit / legal dispute, the application session id can be used for correlation with application user login logs / db.
- Returns:
- application session id
-