Package fr.gouv.vitam.collect.internal.rest

# Class TransactionInternalResource

java.lang.Object
fr.gouv.vitam.collect.internal.rest.TransactionInternalResource

@Path("/collect-internal/v1/transactions") public class TransactionInternalResource extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransactionInternalResource(TransactionService transactionService, SipService sipService, MetadataService metadataService, BulkAtomicUpdateMetadataService bulkAtomicUpdateMetadataService)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `jakarta.ws.rs.core.Response`
  `abortTransaction(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `attachVitamOperationId(String transactionId, String operationId)`
  `jakarta.ws.rs.core.Response`
  `awaitTransactionValidation(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `bulkAtomicUpdateUnits(String transactionId, com.fasterxml.jackson.databind.JsonNode updateQueriesJson)`
  Bulk atomic update of archive units with json queries of the provided collect transaction.
  `jakarta.ws.rs.core.Response`
  `changeTransactionStatus(String transactionId, TransactionStatus transactionStatus)`
  `jakarta.ws.rs.core.Response`
  `closeTransaction(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `deleteTransactionById(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `downloadSip(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `getTransactionById(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `getTransactionsToAutomaticallyIngest()`
  `jakarta.ws.rs.core.Response`
  `reclassification(String transactionId, com.fasterxml.jackson.databind.JsonNode reclassificationRequestJson)`
  Start a reclassification workflow on collect
  `jakarta.ws.rs.core.Response`
  `reopenTransaction(String transactionId)`
  `jakarta.ws.rs.core.Response`
  `selectUnits(String transactionId, com.fasterxml.jackson.databind.JsonNode jsonQuery)`
  select Unit
  `jakarta.ws.rs.core.Response`
  `selectUnitsWithInheritedRules(String transactionId, com.fasterxml.jackson.databind.JsonNode queryDsl)`
  Select units with inherited rules
  `jakarta.ws.rs.core.Response`
  `startDeletionWorkflow(String transactionId, DeletionRequestBody deletionRequestBody)`
  Starts a deletion workflow on Collect.
  `jakarta.ws.rs.core.Response`
  `startEliminationActionWorkflow(String transactionId, EliminationRequestBody eliminationRequestBody)`
  Starts an elimination action workflow on Collect.
  `jakarta.ws.rs.core.Response`
  `updateTransaction(TransactionDto transactionDto)`
  `jakarta.ws.rs.core.Response`
  `updateUnitsWithMetadataCsv(String transactionId, InputStream metadataCsvInputStream)`
  `jakarta.ws.rs.core.Response`
  `updateUnitsWithMetadataJsonl(String transactionId, InputStream metadataJsonlInputStream)`
  `jakarta.ws.rs.core.Response`
  `uploadArchiveUnit(String transactionId, com.fasterxml.jackson.databind.JsonNode unitJsonNode)`
  `jakarta.ws.rs.core.Response`
  `uploadSipAsStreamToTransaction(String transactionId, String contentType, InputStream uploadedInputStream)`
  Upload compressed SIP as Stream on transaction, will be uncompressed in workspace-collect.
  `jakarta.ws.rs.core.Response`
  `uploadTransactionZip(String transactionId, InputStream inputStreamObject, String encoding, String attachementId)`

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

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

- ## Constructor Details

  - ### TransactionInternalResource

    public TransactionInternalResource(TransactionService transactionService, SipService sipService, MetadataService metadataService, BulkAtomicUpdateMetadataService bulkAtomicUpdateMetadataService)

- ## Method Details

  - ### getTransactionsToAutomaticallyIngest

    @GET @Path("/withAutomaticIngest") @Produces("application/json") public jakarta.ws.rs.core.Response getTransactionsToAutomaticallyIngest() throws CollectInternalException
    Throws:
      `CollectInternalException`

  - ### getTransactionById

    @Path("/{transactionId}") @GET @Produces("application/json") public jakarta.ws.rs.core.Response getTransactionById(@PathParam("transactionId") String transactionId)

  - ### updateTransaction

    @PUT @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response updateTransaction(TransactionDto transactionDto)

  - ### deleteTransactionById

    @Path("/{transactionId}") @DELETE @Produces("application/json") public jakarta.ws.rs.core.Response deleteTransactionById(@PathParam("transactionId") String transactionId)

  - ### uploadArchiveUnit

    @Path("/{transactionId}/units") @POST @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response uploadArchiveUnit(@PathParam("transactionId") String transactionId, com.fasterxml.jackson.databind.JsonNode unitJsonNode)

  - ### selectUnits

    @Path("/{transactionId}/units") @GET @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response selectUnits(@PathParam("transactionId") String transactionId, com.fasterxml.jackson.databind.JsonNode jsonQuery)
    select Unit
    Parameters:
      `jsonQuery` - as String { $query : query}

  - ### closeTransaction

    @Path("/{transactionId}/close") @POST @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response closeTransaction(@PathParam("transactionId") String transactionId)

  - ### abortTransaction

    @Path("/{transactionId}/abort") @PUT @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response abortTransaction(@PathParam("transactionId") String transactionId)

  - ### reopenTransaction

    @Path("/{transactionId}/reopen") @PUT @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response reopenTransaction(@PathParam("transactionId") String transactionId)

  - ### awaitTransactionValidation

    @Path("/{transactionId}/awaitTransactionValidation") @POST @Produces("application/json") public jakarta.ws.rs.core.Response awaitTransactionValidation(@PathParam("transactionId") String transactionId)

  - ### downloadSip

    @Path("/{transactionId}/downloadSIP") @GET @Produces("application/octet-stream") public jakarta.ws.rs.core.Response downloadSip(@PathParam("transactionId") String transactionId)

  - ### updateUnitsWithMetadataCsv

    @Path("/{transactionId}/units/metadata/csv") @PUT @Consumes("text/csv") @Produces("application/json") public jakarta.ws.rs.core.Response updateUnitsWithMetadataCsv(@PathParam("transactionId") String transactionId, InputStream metadataCsvInputStream)

  - ### updateUnitsWithMetadataJsonl

    @Path("/{transactionId}/units/metadata/jsonl") @PUT @Consumes("application/octet-stream") @Produces("application/json") public jakarta.ws.rs.core.Response updateUnitsWithMetadataJsonl(@PathParam("transactionId") String transactionId, InputStream metadataJsonlInputStream)

  - ### uploadTransactionZip

    @Path("/{transactionId}/upload") @POST @Consumes("application/zip") @Produces("application/json") public jakarta.ws.rs.core.Response uploadTransactionZip(@PathParam("transactionId") String transactionId, InputStream inputStreamObject, @HeaderParam("X-Encoding") @Nullable String encoding, @HeaderParam("X-Attachement-Id") @Nullable String attachementId)

  - ### changeTransactionStatus

    @Path("/{transactionId}/status/{transactionStatus}") @PUT @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response changeTransactionStatus(@PathParam("transactionId") String transactionId, @PathParam("transactionStatus") TransactionStatus transactionStatus)

  - ### attachVitamOperationId

    @Path("/{transactionId}/operation-id/{operationId}") @PUT @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response attachVitamOperationId(@PathParam("transactionId") String transactionId, @PathParam("operationId") String operationId)

  - ### selectUnitsWithInheritedRules

    @GET @Path("/{transactionId}/unitsWithInheritedRules") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response selectUnitsWithInheritedRules(@PathParam("transactionId") String transactionId, com.fasterxml.jackson.databind.JsonNode queryDsl)
    Select units with inherited rules
    Parameters:
      `transactionId` - as transaction Id
      `queryDsl` - as JsonNode
    Returns:
      an archive unit result list with inherited rules

  - ### bulkAtomicUpdateUnits

    @POST @Path("/{transactionId}/units/bulk") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response bulkAtomicUpdateUnits(@PathParam("transactionId") String transactionId, com.fasterxml.jackson.databind.JsonNode updateQueriesJson)
    Bulk atomic update of archive units with json queries of the provided collect transaction.
    Units are update in blocking mode (might take a few moments to proceed before returning). Please ensure proper request size / timeout is configured.
    Parameters:
      `updateQueriesJson` - the bulk update queries (null not allowed)
    Returns:
      HTTP 202 when request is accepted, 400 on BAD REQUEST, 500 on internal server error

  - ### reclassification

    @POST @Path("/{transactionId}/reclassification") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response reclassification(@PathParam("transactionId") String transactionId, com.fasterxml.jackson.databind.JsonNode reclassificationRequestJson)
    Start a reclassification workflow on collect
    Parameters:
      `transactionId` - as transaction Id
      `reclassificationRequestJson` - as JsonNode
    Returns:
      an archive unit result list with inherited rules

  - ### startEliminationActionWorkflow

    @POST @Path("/{transactionId}/elimination/action") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response startEliminationActionWorkflow(@PathParam("transactionId") String transactionId, EliminationRequestBody eliminationRequestBody)
    Starts an elimination action workflow on Collect.

  - ### startDeletionWorkflow

    @POST @Path("/{transactionId}/deletion/action") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response startDeletionWorkflow(@PathParam("transactionId") String transactionId, DeletionRequestBody deletionRequestBody)
    Starts a deletion workflow on Collect.

  - ### uploadSipAsStreamToTransaction

    @POST @Path("/{transactionId}/uploadSip") @Consumes({"application/octet-stream","application/zip","application/x-gzip","application/gzip","application/x-tar","application/x-bzip2"}) public jakarta.ws.rs.core.Response uploadSipAsStreamToTransaction(@PathParam("transactionId") String transactionId, @HeaderParam("Content-Type") String contentType, InputStream uploadedInputStream)
    Upload compressed SIP as Stream on transaction, will be uncompressed in workspace-collect.
    Parameters:
      `contentType` - the header Content-Type (zip, tar, ...)
      `uploadedInputStream` - the stream to upload
    Returns:
      Response with operation ID