@Test @RunWithCustomExecutor public void should_return_ok_when__request_item_no_offset() { assertThatCode(() -> reconstructionResource.reconstructCollection(null)) .isInstanceOf(IllegalArgumentException.class); }
@Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) public Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) { ParametersChecker.checkParameter(RECONSTRUCTION_JSON_MANDATORY_PARAMETERS_MSG, reconstructionItems); List<ReconstructionResponseItem> responses = new ArrayList<>(); if (!reconstructionItems.isEmpty()) { LOGGER.debug(String .format("Starting reconstruction Vitam service with the json parameters : (%s)", reconstructionItems)); reconstructionItems.forEach(item -> { LOGGER.debug(String.format( "Starting reconstruction for the collection {%s} on the tenant (%s) with (%s) elements", item.getCollection(), item.getTenant(), item.getLimit())); try { responses.add(reconstructionService.reconstruct(item)); } catch (IllegalArgumentException e) { LOGGER.error(RECONSTRUCTION_EXCEPTION_MSG, e); responses.add(new ReconstructionResponseItem(item, StatusCode.KO)); } }); } return Response.ok().entity(responses).build(); }
MetadataManagementResource { @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) public Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) { ParametersChecker.checkParameter(RECONSTRUCTION_JSON_MANDATORY_PARAMETERS_MSG, reconstructionItems); List<ReconstructionResponseItem> responses = new ArrayList<>(); if (!reconstructionItems.isEmpty()) { LOGGER.debug(String .format("Starting reconstruction Vitam service with the json parameters : (%s)", reconstructionItems)); reconstructionItems.forEach(item -> { LOGGER.debug(String.format( "Starting reconstruction for the collection {%s} on the tenant (%s) with (%s) elements", item.getCollection(), item.getTenant(), item.getLimit())); try { responses.add(reconstructionService.reconstruct(item)); } catch (IllegalArgumentException e) { LOGGER.error(RECONSTRUCTION_EXCEPTION_MSG, e); responses.add(new ReconstructionResponseItem(item, StatusCode.KO)); } }); } return Response.ok().entity(responses).build(); } }
MetadataManagementResource { @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) public Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) { ParametersChecker.checkParameter(RECONSTRUCTION_JSON_MANDATORY_PARAMETERS_MSG, reconstructionItems); List<ReconstructionResponseItem> responses = new ArrayList<>(); if (!reconstructionItems.isEmpty()) { LOGGER.debug(String .format("Starting reconstruction Vitam service with the json parameters : (%s)", reconstructionItems)); reconstructionItems.forEach(item -> { LOGGER.debug(String.format( "Starting reconstruction for the collection {%s} on the tenant (%s) with (%s) elements", item.getCollection(), item.getTenant(), item.getLimit())); try { responses.add(reconstructionService.reconstruct(item)); } catch (IllegalArgumentException e) { LOGGER.error(RECONSTRUCTION_EXCEPTION_MSG, e); responses.add(new ReconstructionResponseItem(item, StatusCode.KO)); } }); } return Response.ok().entity(responses).build(); } @VisibleForTesting  MetadataManagementResource(VitamRepositoryProvider vitamRepositoryProvider,
        OffsetRepository offsetRepository, MetaDataImpl metadata, MetaDataConfiguration configuration); @VisibleForTesting  MetadataManagementResource(
        ReconstructionService reconstructionService,
        StoreGraphService storeGraphService,
        GraphComputeService graphComputeService,
        ReclassificationDistributionService reclassificationDistributionService,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory,
        WorkspaceClientFactory workspaceClientFactory,
        MetaDataConfiguration configuration,
        ExportsPurgeService exportsPurgeService); }
MetadataManagementResource { @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) public Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) { ParametersChecker.checkParameter(RECONSTRUCTION_JSON_MANDATORY_PARAMETERS_MSG, reconstructionItems); List<ReconstructionResponseItem> responses = new ArrayList<>(); if (!reconstructionItems.isEmpty()) { LOGGER.debug(String .format("Starting reconstruction Vitam service with the json parameters : (%s)", reconstructionItems)); reconstructionItems.forEach(item -> { LOGGER.debug(String.format( "Starting reconstruction for the collection {%s} on the tenant (%s) with (%s) elements", item.getCollection(), item.getTenant(), item.getLimit())); try { responses.add(reconstructionService.reconstruct(item)); } catch (IllegalArgumentException e) { LOGGER.error(RECONSTRUCTION_EXCEPTION_MSG, e); responses.add(new ReconstructionResponseItem(item, StatusCode.KO)); } }); } return Response.ok().entity(responses).build(); } @VisibleForTesting  MetadataManagementResource(VitamRepositoryProvider vitamRepositoryProvider,
        OffsetRepository offsetRepository, MetaDataImpl metadata, MetaDataConfiguration configuration); @VisibleForTesting  MetadataManagementResource(
        ReconstructionService reconstructionService,
        StoreGraphService storeGraphService,
        GraphComputeService graphComputeService,
        ReclassificationDistributionService reclassificationDistributionService,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory,
        WorkspaceClientFactory workspaceClientFactory,
        MetaDataConfiguration configuration,
        ExportsPurgeService exportsPurgeService); @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems); @Path(STORE_GRAPH_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response storeGraph(); @Path(STORE_GRAPH_PROGRESS_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response storeGraphInProgress(); @Path(COMPUTE_GRAPH_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response computeGraphByDSL(@HeaderParam(GlobalDataRest.X_TENANT_ID) Integer xTenantId, JsonNode queryDsl); @Path(COMPUTE_GRAPH_PROGRESS_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response computeGraphByDSLInProgress(); @Path(COMPUTE_GRAPH_URI + "/{collection:" + UNIT + "|" + OBJECTGROUP + "|" + UNIT_OBJECTGROUP + "}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response computeGraph(@PathParam("collection") GraphComputeAction action, Set<String> documentsId); @Path(EXPORT_RECLASSIFICATION_CHILD_NODES) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response exportReclassificationChildNodes(ReclassificationChildNodeExportRequest request); @Path(PURGE_GRAPH_ONLY_DOCUMENTS_URI + "/{collection:" + UNIT + "|" + OBJECTGROUP + "|" + UNIT_OBJECTGROUP + "}") @DELETE @Produces(MediaType.APPLICATION_JSON) Response purgeReconstructedDocumentsWithGraphOnlyData(@PathParam("collection") GraphComputeAction action); @Path(COMPUTED_INHERITED_RULES_OBSOLETE_URI) @POST @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response processObsoleteComputedInheritedRules(); @Path(PURGE_EXPIRED_DIP_FILES_URI) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response purgeExpiredDipFiles(); @Path(PURGE_EXPIRED_TRANSFER_SIP_FILES_URI) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response purgeExpiredTransfersSIPFiles(); @Path(MIGRATION_PURGE_EXPIRED_FROM_OFFERS) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response migrationPurgeDipFilesFromOffers(); }
MetadataManagementResource { @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) public Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems) { ParametersChecker.checkParameter(RECONSTRUCTION_JSON_MANDATORY_PARAMETERS_MSG, reconstructionItems); List<ReconstructionResponseItem> responses = new ArrayList<>(); if (!reconstructionItems.isEmpty()) { LOGGER.debug(String .format("Starting reconstruction Vitam service with the json parameters : (%s)", reconstructionItems)); reconstructionItems.forEach(item -> { LOGGER.debug(String.format( "Starting reconstruction for the collection {%s} on the tenant (%s) with (%s) elements", item.getCollection(), item.getTenant(), item.getLimit())); try { responses.add(reconstructionService.reconstruct(item)); } catch (IllegalArgumentException e) { LOGGER.error(RECONSTRUCTION_EXCEPTION_MSG, e); responses.add(new ReconstructionResponseItem(item, StatusCode.KO)); } }); } return Response.ok().entity(responses).build(); } @VisibleForTesting  MetadataManagementResource(VitamRepositoryProvider vitamRepositoryProvider,
        OffsetRepository offsetRepository, MetaDataImpl metadata, MetaDataConfiguration configuration); @VisibleForTesting  MetadataManagementResource(
        ReconstructionService reconstructionService,
        StoreGraphService storeGraphService,
        GraphComputeService graphComputeService,
        ReclassificationDistributionService reclassificationDistributionService,
        ProcessingManagementClientFactory processingManagementClientFactory,
        LogbookOperationsClientFactory logbookOperationsClientFactory,
        WorkspaceClientFactory workspaceClientFactory,
        MetaDataConfiguration configuration,
        ExportsPurgeService exportsPurgeService); @Path(RECONSTRUCTION_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response reconstructCollection(List<ReconstructionRequestItem> reconstructionItems); @Path(STORE_GRAPH_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response storeGraph(); @Path(STORE_GRAPH_PROGRESS_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response storeGraphInProgress(); @Path(COMPUTE_GRAPH_URI) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response computeGraphByDSL(@HeaderParam(GlobalDataRest.X_TENANT_ID) Integer xTenantId, JsonNode queryDsl); @Path(COMPUTE_GRAPH_PROGRESS_URI) @GET @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response computeGraphByDSLInProgress(); @Path(COMPUTE_GRAPH_URI + "/{collection:" + UNIT + "|" + OBJECTGROUP + "|" + UNIT_OBJECTGROUP + "}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response computeGraph(@PathParam("collection") GraphComputeAction action, Set<String> documentsId); @Path(EXPORT_RECLASSIFICATION_CHILD_NODES) @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response exportReclassificationChildNodes(ReclassificationChildNodeExportRequest request); @Path(PURGE_GRAPH_ONLY_DOCUMENTS_URI + "/{collection:" + UNIT + "|" + OBJECTGROUP + "|" + UNIT_OBJECTGROUP + "}") @DELETE @Produces(MediaType.APPLICATION_JSON) Response purgeReconstructedDocumentsWithGraphOnlyData(@PathParam("collection") GraphComputeAction action); @Path(COMPUTED_INHERITED_RULES_OBSOLETE_URI) @POST @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response processObsoleteComputedInheritedRules(); @Path(PURGE_EXPIRED_DIP_FILES_URI) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response purgeExpiredDipFiles(); @Path(PURGE_EXPIRED_TRANSFER_SIP_FILES_URI) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response purgeExpiredTransfersSIPFiles(); @Path(MIGRATION_PURGE_EXPIRED_FROM_OFFERS) @DELETE @Produces(MediaType.APPLICATION_JSON) @VitamAuthentication(authentLevel = AuthenticationLevel.BASIC_AUTHENT) Response migrationPurgeDipFilesFromOffers(); static final String OBJECTGROUP; static final String UNIT; }