Package fr.gouv.vitam.ihmdemo.core

# Class UserInterfaceTransactionManager

java.lang.Object
fr.gouv.vitam.ihmdemo.core.UserInterfaceTransactionManager

public class UserInterfaceTransactionManager extends 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

  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 DSLQuery
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `computinheritedrules(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  computinheritedrules
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `deleteComputedInheritedRules(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  deletecomputinheritedrules
  `boolean`
  `downloadExports(jakarta.ws.rs.container.AsyncResponse asyncResponse, String exportId, VitamContext context, boolean isTransfer)`
  Download DIP or Transfer SIP
  `RequestResponse`
  `evidenceAudit(com.fasterxml.jackson.databind.JsonNode query, VitamContext context)`
  launch Evidance Audit on selected AU
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `exportDIP(DipRequest dipRequest, VitamContext context)`
  generate a DIP to be exported
  `RequestResponse`
  `exportProbativeValue(ProbativeValueRequest request, VitamContext context)`
  Launch an probative value export for the request
  `com.fasterxml.jackson.databind.JsonNode`
  `extractInformationFromTimestamp(String timestamp)`
  Extract information from timestamp
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `findAccessionRegisterDetail(String originatingAgency, String options, VitamContext context)`
  `RequestResponse<AccessionRegisterSummaryModel>`
  `findAccessionRegisterSummary(String options, VitamContext context)`
  `RequestResponse<AccessionRegisterSymbolicModel>`
  `findAccessionRegisterSymbolic(String options, VitamContext context)`
  `String`
  `getAppSessionId()`
  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 details
  `String`
  `getContractId(jakarta.servlet.http.HttpServletRequest request)`
  `static UserInterfaceTransactionManager`
  `getInstance()`
  `boolean`
  `getObjectAsInputStream(jakarta.ws.rs.container.AsyncResponse asyncResponse, String unitId, String usage, int version, String filename, VitamContext context, List<jakarta.ws.rs.core.MediaType> allowedMediaTypes)`
  Retrieve an Object data as an input stream
  `String`
  `getPersonalCertificate(jakarta.servlet.http.HttpServletRequest request)`
  `Integer`
  `getTenantId(jakarta.servlet.http.HttpServletRequest request)`
  `VitamContext`
  `getVitamContext(jakarta.servlet.http.HttpServletRequest request)`
  `VitamContext`
  `getVitamContext(Integer tenantId, String contractId, jakarta.servlet.http.HttpServletRequest request)`
  `VitamContext`
  `getVitamContext(Integer tenantId, String contractId, String personalCert)`
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `massiveRulesUpdate(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  Massive Rules update
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `massiveUnitsUpdate(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  Massive AU update
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `searchObjects(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  Gets search objects result
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `searchUnits(com.fasterxml.jackson.databind.JsonNode parameters, VitamContext context)`
  Gets search units result
  `RequestResponse<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 id
  `RequestResponse<LogbookLifecycle>`
  `selectObjectGroupLifeCycleById(String objectGroupLifeCycleId, VitamContext context)`
  `RequestResponse<LogbookOperation>`
  `selectOperation(com.fasterxml.jackson.databind.JsonNode query, VitamContext context)`
  `RequestResponse<LogbookOperation>`
  `selectOperationbyId(String operationId, VitamContext context)`
  `RequestResponse<LogbookLifecycle>`
  `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 inheritedRules
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `startEliminationAction(EliminationRequestBody parameters, VitamContext context)`
  Start elimination action
  `RequestResponse<com.fasterxml.jackson.databind.JsonNode>`
  `startEliminationAnalysis(EliminationRequestBody parameters, VitamContext context)`
  Start elimination analysis
  `RequestResponse<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

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### UserInterfaceTransactionManager

    public UserInterfaceTransactionManager()

  - ### UserInterfaceTransactionManager

    public UserInterfaceTransactionManager(AccessExternalClientFactory accessExternalClientFactory, AdminExternalClientFactory adminExternalClientFactory, AccessExternalClientV2Factory accessExternalClientV2Factory, DslQueryHelper dslQueryHelper)

- ## Method Details

  - ### 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 query
      `context` - 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 query
      `context` - 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 query
      `unitId` - archive unit id to find
      `context` - 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 query
      `context` - 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 workflow
      `context` - 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 workflow
      `context` - 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 query
      `context` - 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 query
      `context` - 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 query
      `context` - 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 query
      `context` - 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 query
      `unitId` - unitIdentifier
      `context` - 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 executed
      `objectId` - the Id of the ObjectGroup
      `context` - Vitamcontext
    Returns:
      JsonNode object including DSL queries, context and results
    Throws:
      `VitamClientException` - if the client encountered an exception

  - ### getObjectAsInputStream

    public boolean getObjectAsInputStream(jakarta.ws.rs.container.AsyncResponse asyncResponse, String unitId, String usage, int version, String filename, VitamContext context, List<jakarta.ws.rs.core.MediaType> allowedMediaTypes) throws UnsupportedEncodingException, VitamClientException
    Retrieve an Object data as an input stream
    Parameters:
      `asyncResponse` - the asynchronous response to be used
      `unitId` - the Id of the ObjectGroup
      `usage` - the requested usage
      `version` - the requested version of the usage
      `filename` - the name od the file
      `context` - Vitamcontext
      `allowedMediaTypes` -
    Returns:
      boolean for test purpose (solve mock issue)
    Throws:
      `UnsupportedEncodingException` - if unsupported encoding error for input file content
      `VitamClientException` - if the client encountered an exception

  - ### selectUnitLifeCycleById

    public RequestResponse<LogbookLifecycle> selectUnitLifeCycleById(String unitLifeCycleId, VitamContext context) throws VitamClientException
    Parameters:
      `unitLifeCycleId` - the unit lifecycle id to select
      `context` - Vitamcontext
    Returns:
      JsonNode result
    Throws:
      `InvalidParseOperationException` - if json data not well-formed
      `AccessUnauthorizedException`
      `VitamClientException`

  - ### selectOperation

    public RequestResponse<LogbookOperation> selectOperation(com.fasterxml.jackson.databind.JsonNode query, VitamContext context) throws VitamClientException
    Parameters:
      `query` - the select query
      `context` - 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 id
      `context` - 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 query
      `context` - Vitamcontext
    Returns:
      AccessionRegisterSummaryModel result
    Throws:
      `VitamClientException` - if the request with illegal parameter
      `InvalidParseOperationException` - if json data not well-formed
      `InvalidCreateOperationException` - if error when create query

  - ### findAccessionRegisterSymbolic

    public RequestResponse<AccessionRegisterSymbolicModel> findAccessionRegisterSymbolic(String options, VitamContext context) throws VitamClientException, InvalidParseOperationException, InvalidCreateOperationException
    Parameters:
      `options` - for creating query
      `context` - Vitamcontext
    Returns:
      AccessionRegisterSummaryModel result
    Throws:
      `VitamClientException` - if the request with illegal parameter
      `InvalidParseOperationException` - if json data not well-formed
      `InvalidCreateOperationException` - 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 agency
      `options` - for creating query
      `context` - Vitamcontext
    Returns:
      JsonNode result
    Throws:
      `InvalidParseOperationException` - if json data not well-formed
      `AccessExternalClientServerException` - if access internal server error
      `AccessExternalClientNotFoundException` - if access external resource not found
      `InvalidCreateOperationException` - 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 execute
      `context` - 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 AU
      `context` - 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 request
      `context` - 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 query
      `context` - VitamContext
    Returns:
      a JsonNode for dip results
    Throws:
      `InvalidParseOperationException` - unable to parse query
      `VitamClientException` - access client exception

  - ### transferSIP

    public RequestResponse<com.fasterxml.jackson.databind.JsonNode> transferSIP(TransferRequest transferRequest, VitamContext context) throws VitamClientException
    Throws:
      `VitamClientException`

  - ### downloadExports

    public boolean downloadExports(jakarta.ws.rs.container.AsyncResponse asyncResponse, String exportId, VitamContext context, boolean isTransfer) throws UnsupportedEncodingException, VitamClientException
    Download DIP or Transfer SIP
    Parameters:
      `asyncResponse` - AsyncResponse
      `exportId` - exportId
      `context` - vitam context
    Returns:
    Throws:
      `UnsupportedEncodingException`
      `VitamClientException`

  - ### getVitamContext

    public VitamContext getVitamContext(jakarta.servlet.http.HttpServletRequest request)

  - ### getVitamContext

    public VitamContext getVitamContext(Integer tenantId, String contractId, String personalCert)

  - ### getVitamContext

    public VitamContext getVitamContext(Integer tenantId, String contractId, jakarta.servlet.http.HttpServletRequest request)

  - ### getPersonalCertificate

    public String getPersonalCertificate(jakarta.servlet.http.HttpServletRequest request)

  - ### getContractId

    public String getContractId(jakarta.servlet.http.HttpServletRequest request)

  - ### getTenantId

    public Integer getTenantId(jakarta.servlet.http.HttpServletRequest request)

  - ### getAppSessionId

    public 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