Package fr.gouv.vitam.ihmdemo.core
Class UserInterfaceTransactionManager
- java.lang.Object
-
- fr.gouv.vitam.ihmdemo.core.UserInterfaceTransactionManager
-
public class UserInterfaceTransactionManager extends java.lang.Object
Manage all the transactions received form the User Interface : a gateway to VITAM intern
-
-
Constructor Summary
Constructors Constructor Description UserInterfaceTransactionManager()
UserInterfaceTransactionManager(AccessExternalClientFactory accessExternalClientFactory, AdminExternalClientFactory adminExternalClientFactory, AccessExternalClientV2Factory accessExternalClientV2Factory, DslQueryHelper dslQueryHelper)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestResponse<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, java.lang.String exportId, VitamContext context, boolean isTransfer)
Download DIP or Transfer SIPRequestResponse
evidenceAudit(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 exportedRequestResponse
exportProbativeValue(ProbativeValueRequest request, VitamContext context)
Launch an probative value export for the requestcom.fasterxml.jackson.databind.JsonNode
extractInformationFromTimestamp(java.lang.String timestamp)
Extract information from timestampRequestResponse<com.fasterxml.jackson.databind.JsonNode>
findAccessionRegisterDetail(java.lang.String originatingAgency, java.lang.String options, VitamContext context)
RequestResponse<AccessionRegisterSummaryModel>
findAccessionRegisterSummary(java.lang.String options, VitamContext context)
RequestResponse<AccessionRegisterSymbolicModel>
findAccessionRegisterSymbolic(java.lang.String options, VitamContext context)
java.lang.String
getAppSessionId()
Returns session id for the authenticated user.RequestResponse<com.fasterxml.jackson.databind.JsonNode>
getArchiveUnitDetails(com.fasterxml.jackson.databind.JsonNode preparedDslQuery, java.lang.String unitId, VitamContext context)
Gets archive unit detailsjava.lang.String
getContractId(javax.servlet.http.HttpServletRequest request)
static UserInterfaceTransactionManager
getInstance()
boolean
getObjectAsInputStream(javax.ws.rs.container.AsyncResponse asyncResponse, java.lang.String unitId, java.lang.String usage, int version, java.lang.String filename, VitamContext context, java.util.List<javax.ws.rs.core.MediaType> allowedMediaTypes)
Retrieve an Object data as an input streamjava.lang.String
getPersonalCertificate(javax.servlet.http.HttpServletRequest request)
java.lang.Integer
getTenantId(javax.servlet.http.HttpServletRequest request)
VitamContext
getVitamContext(java.lang.Integer tenantId, java.lang.String contractId, java.lang.String personalCert)
VitamContext
getVitamContext(java.lang.Integer tenantId, java.lang.String contractId, javax.servlet.http.HttpServletRequest request)
VitamContext
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, java.lang.String objectId, VitamContext context)
Retrieve an ObjectGroup as Json data based on the provided ObjectGroup idRequestResponse<LogbookLifecycle>
selectObjectGroupLifeCycleById(java.lang.String objectGroupLifeCycleId, VitamContext context)
RequestResponse<LogbookOperation>
selectOperation(com.fasterxml.jackson.databind.JsonNode query, VitamContext context)
RequestResponse<LogbookOperation>
selectOperationbyId(java.lang.String operationId, VitamContext context)
RequestResponse<LogbookLifecycle>
selectUnitLifeCycleById(java.lang.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, java.lang.String unitId, VitamContext context)
Update units result
-
-
-
Constructor Detail
-
UserInterfaceTransactionManager
public UserInterfaceTransactionManager()
-
UserInterfaceTransactionManager
public UserInterfaceTransactionManager(AccessExternalClientFactory accessExternalClientFactory, AdminExternalClientFactory adminExternalClientFactory, AccessExternalClientV2Factory accessExternalClientV2Factory, DslQueryHelper dslQueryHelper)
-
-
Method Detail
-
getInstance
public static UserInterfaceTransactionManager 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, java.lang.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, java.lang.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, java.lang.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, java.lang.String unitId, java.lang.String usage, int version, java.lang.String filename, VitamContext context, java.util.List<javax.ws.rs.core.MediaType> allowedMediaTypes) throws java.io.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:
java.io.UnsupportedEncodingException
- if unsupported encoding error for input file contentVitamClientException
- if the client encountered an exception
-
selectUnitLifeCycleById
public RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(java.lang.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(java.lang.String operationId, VitamContext context) throws VitamClientException
- Parameters:
operationId
- the operation idcontext
- Vitamcontext- Returns:
- logbook operation result
- Throws:
VitamClientException
-
selectObjectGroupLifeCycleById
public RequestResponse<LogbookLifecycle> selectObjectGroupLifeCycleById(java.lang.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(java.lang.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(java.lang.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(java.lang.String originatingAgency, java.lang.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(java.lang.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, java.lang.String exportId, VitamContext context, boolean isTransfer) throws java.io.UnsupportedEncodingException, VitamClientException
Download DIP or Transfer SIP- Parameters:
asyncResponse
- AsyncResponseexportId
- exportIdcontext
- vitam context- Returns:
- Throws:
java.io.UnsupportedEncodingException
VitamClientException
-
getVitamContext
public VitamContext getVitamContext(javax.servlet.http.HttpServletRequest request)
-
getVitamContext
public VitamContext getVitamContext(java.lang.Integer tenantId, java.lang.String contractId, java.lang.String personalCert)
-
getVitamContext
public VitamContext getVitamContext(java.lang.Integer tenantId, java.lang.String contractId, javax.servlet.http.HttpServletRequest request)
-
getPersonalCertificate
public java.lang.String getPersonalCertificate(javax.servlet.http.HttpServletRequest request)
-
getContractId
public java.lang.String getContractId(javax.servlet.http.HttpServletRequest request)
-
getTenantId
public java.lang.Integer getTenantId(javax.servlet.http.HttpServletRequest request)
-
getAppSessionId
public java.lang.String 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
-
-