@Test public void testimportValidIngestContractsFileReturnCreated() throws Exception { doReturn(Status.CREATED).when(adminManagementClient).importIngestContracts(any()); File contractFile = PropertiesUtils.getResourceFile("referential_contracts_ok.json"); JsonNode json = JsonHandler.getFromFile(contractFile); given().contentType(ContentType.JSON).body(json) .header(GlobalDataRest.X_TENANT_ID, TENANT_ID) .when().post(AccessExtAPI.INGEST_CONTRACT_API) .then().statusCode(Status.CREATED.getStatusCode()); }
@Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") public Response importIngestContracts(JsonNode select) { checkParameter(JSON_SELECT_IS_MANDATORY, select); try (AdminManagementClient client = adminManagementClientFactory.getClient()) { Status status = client.importIngestContracts(getFromStringAsTypeReference(select.toString(), new TypeReference<List<IngestContractModel>>() { })); if (BAD_REQUEST.getStatusCode() == status.getStatusCode()) { return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, BAD_REQUEST.getReasonPhrase()) .toResponse(); } return Response.status(status) .entity(SUCCESSFULLY_IMPORTED) .build(); } catch (final ReferentialException e) { LOGGER.error(e); return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, e.getMessage()) .toResponse(); } catch (InvalidParseOperationException | InvalidFormatException e) { LOGGER.error(e); VitamError error = new VitamError(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getItem()) .setMessage(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()) .setState(StatusCode.KO.name()) .setCode(VitamCodeHelper.getCode(VitamCode.ACCESS_EXTERNAL_INVALID_JSON)) .setContext(ACCESS_EXTERNAL_MODULE) .setDescription(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()); return Response.status(BAD_REQUEST) .entity(error).build(); } }
AdminManagementExternalResource extends ApplicationStatusResource { @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") public Response importIngestContracts(JsonNode select) { checkParameter(JSON_SELECT_IS_MANDATORY, select); try (AdminManagementClient client = adminManagementClientFactory.getClient()) { Status status = client.importIngestContracts(getFromStringAsTypeReference(select.toString(), new TypeReference<List<IngestContractModel>>() { })); if (BAD_REQUEST.getStatusCode() == status.getStatusCode()) { return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, BAD_REQUEST.getReasonPhrase()) .toResponse(); } return Response.status(status) .entity(SUCCESSFULLY_IMPORTED) .build(); } catch (final ReferentialException e) { LOGGER.error(e); return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, e.getMessage()) .toResponse(); } catch (InvalidParseOperationException | InvalidFormatException e) { LOGGER.error(e); VitamError error = new VitamError(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getItem()) .setMessage(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()) .setState(StatusCode.KO.name()) .setCode(VitamCodeHelper.getCode(VitamCode.ACCESS_EXTERNAL_INVALID_JSON)) .setContext(ACCESS_EXTERNAL_MODULE) .setDescription(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()); return Response.status(BAD_REQUEST) .entity(error).build(); } } }
AdminManagementExternalResource extends ApplicationStatusResource { @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") public Response importIngestContracts(JsonNode select) { checkParameter(JSON_SELECT_IS_MANDATORY, select); try (AdminManagementClient client = adminManagementClientFactory.getClient()) { Status status = client.importIngestContracts(getFromStringAsTypeReference(select.toString(), new TypeReference<List<IngestContractModel>>() { })); if (BAD_REQUEST.getStatusCode() == status.getStatusCode()) { return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, BAD_REQUEST.getReasonPhrase()) .toResponse(); } return Response.status(status) .entity(SUCCESSFULLY_IMPORTED) .build(); } catch (final ReferentialException e) { LOGGER.error(e); return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, e.getMessage()) .toResponse(); } catch (InvalidParseOperationException | InvalidFormatException e) { LOGGER.error(e); VitamError error = new VitamError(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getItem()) .setMessage(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()) .setState(StatusCode.KO.name()) .setCode(VitamCodeHelper.getCode(VitamCode.ACCESS_EXTERNAL_INVALID_JSON)) .setContext(ACCESS_EXTERNAL_MODULE) .setDescription(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()); return Response.status(BAD_REQUEST) .entity(error).build(); } } AdminManagementExternalResource(SecureEndpointRegistry secureEndpointRegistry); @VisibleForTesting  AdminManagementExternalResource(
        VitamStatusService statusService,
        SecureEndpointRegistry secureEndpointRegistry,
        AdminManagementClientFactory adminManagementClientFactory,
        IngestInternalClientFactory ingestInternalClientFactory,
        AccessInternalClientFactory accessInternalClientFactory); }
AdminManagementExternalResource extends ApplicationStatusResource { @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") public Response importIngestContracts(JsonNode select) { checkParameter(JSON_SELECT_IS_MANDATORY, select); try (AdminManagementClient client = adminManagementClientFactory.getClient()) { Status status = client.importIngestContracts(getFromStringAsTypeReference(select.toString(), new TypeReference<List<IngestContractModel>>() { })); if (BAD_REQUEST.getStatusCode() == status.getStatusCode()) { return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, BAD_REQUEST.getReasonPhrase()) .toResponse(); } return Response.status(status) .entity(SUCCESSFULLY_IMPORTED) .build(); } catch (final ReferentialException e) { LOGGER.error(e); return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, e.getMessage()) .toResponse(); } catch (InvalidParseOperationException | InvalidFormatException e) { LOGGER.error(e); VitamError error = new VitamError(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getItem()) .setMessage(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()) .setState(StatusCode.KO.name()) .setCode(VitamCodeHelper.getCode(VitamCode.ACCESS_EXTERNAL_INVALID_JSON)) .setContext(ACCESS_EXTERNAL_MODULE) .setDescription(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()); return Response.status(BAD_REQUEST) .entity(error).build(); } } AdminManagementExternalResource(SecureEndpointRegistry secureEndpointRegistry); @VisibleForTesting  AdminManagementExternalResource(
        VitamStatusService statusService,
        SecureEndpointRegistry secureEndpointRegistry,
        AdminManagementClientFactory adminManagementClientFactory,
        IngestInternalClientFactory ingestInternalClientFactory,
        AccessInternalClientFactory accessInternalClientFactory); @Path("/") @OPTIONS @Produces(APPLICATION_JSON) @Unsecured() Response listResourceEndpoints(); @Path("/formatsfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "formatsfile:check", isAdminOnly = true, description = "Vérifier si le référentiel des formats que l'on souhaite importer est valide") Response checkDocument(InputStream document); @Path("/rulesfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesfile:check", description = "Vérifier si le référentiel de règles de gestions que l'on souhaite importer est valide") Response checkRules(InputStream document); @Path("/agenciesfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "agenciesfile:check", description = "Vérifier si le référentiel de services producteurs que l'on souhaite importer est valide") Response checkAgencies(InputStream document); @Path("/formats") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "formats:create", description = "Importer un référentiel des formats", isAdminOnly = true) Response importFormat(@Context HttpHeaders headers, @Context UriInfo uriInfo, InputStream document); @Path("/rules") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "rules:create", description = "Importer un référentiel des règles de gestion") Response importRulesFile(@Context HttpHeaders headers, InputStream document); @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") Response importIngestContracts(JsonNode select); @Path("/accesscontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:create:json", description = "Importer des contrats d'accès dans le référentiel") Response importAccessContracts(JsonNode contract); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API) @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:create:json", description = "Importer des contrats de gestion dans le référentiel") Response importManagementContracts(JsonNode contract); @Path("/contexts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:create:json", description = "Importer des contextes dans le référentiel", isAdminOnly = true) Response importContexts(JsonNode select); @Path("/profiles") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:create:binary", description = "Importer des profils dans le référentiel") Response createProfiles(InputStream document); @Path("/profiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:create:json", description = "Ecrire un profil dans le référentiel") Response createProfiles(JsonNode select); @Path("/archiveunitprofiles") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:create:binary", description = "Importer un ou plusieurs document types dans le référentiel") Response createArchiveUnitProfiles(InputStream document); @Path("/archiveunitprofiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:create:json", description = "Ecrire un ou plusieurs document type dans le référentiel") Response createArchiveUnitProfiles(JsonNode select); @Path("/profiles/{id:.+}") @PUT @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:update:binaire", description = "Importer un fichier xsd ou rng dans un profil") Response importProfileFile(@Context UriInfo uriInfo, @PathParam("id") String profileMetadataId,
        InputStream profileFile); @GET @Path("/profiles/{id:.+}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "profiles:id:read:binary", description = "Télecharger le fichier xsd ou rng attaché à un profil") Response downloadProfileFile(
        @PathParam("id") String fileId); @GET @Path("/traceability/{id}/datafiles") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "traceability:id:read", description = "Télécharger le logbook sécurisé attaché à une opération de sécurisation") Response downloadTraceabilityFile(
        @PathParam("id") String fileId); @Path("/formats") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "formats:read", description = "Lister le contenu du référentiel des formats") Response getFormats(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/rules") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "rules:read", description = "Lister le contenu du référentiel des règles de gestion") Response getRules(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/ingestcontracts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:read", description = "Lister le contenu du référentiel des contrats d'entrée") Response findIngestContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/accesscontracts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:read", description = "Lister le contenu du référentiel des contrats d'accès") Response findAccessContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API) @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:read", description = "Lister le contenu du référentiel des contrats de gestion") Response findManagementContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/profiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:read", description = "Lister le contenu du référentiel des profils") Response findProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/archiveunitprofiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:read", description = "Lister le contenu du référentiel des document types") Response findArchiveUnitProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/contexts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:read", description = "Lister le contenu du référentiel des contextes") Response findContexts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/agencies") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "agencies:create", description = "Importer un référentiel des services producteurs") Response importAgenciesFile(@Context HttpHeaders headers,
        InputStream document); @Path("/agencies/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "agencies:id:read", description = "Trouver un service producteur avec son identifier") Response findAgencyByID(@PathParam("id_document") String documentId); @Path("/agencies") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "agencies:read", description = "Lister le contenu du référentiel des services producteurs") Response findAgencies(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path(AccessExtAPI.ACCESSION_REGISTERS_API) @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = AccessExtAPI.ACCESSION_REGISTERS + ":read", description = "Lister le contenu du référentiel des registres des fonds") Response getAccessionRegister(@Dsl(value = SELECT_SINGLE) JsonNode select); @GET @Path("accessionregisterssymbolic") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accessionregisterssymbolic:read", description = "Get accession register symbolic") Response getAccessionRegisterSymbolic(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/formats/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "formats:id:read", description = "Lire un format donné") Response findFormatByID(@PathParam("id_document") String documentId); @Path("/rules/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "rules:id:read", description = "Lire une règle de gestion donnée") Response findRuleByID(@PathParam("id_document") String documentId); @Path("/ingestcontracts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:id:read", description = "Lire un contrat d'entrée donné") Response findIngestContractsByID(@PathParam("id_document") String documentId); @Path("/accesscontracts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:id:read", description = "Lire un contrat d'accès donné") Response findAccessContractsByID(@PathParam("id_document") String documentId); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API + "/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:id:read", description = "Lire un contrat de gestion donné") Response findManagementContractsByID(@PathParam("id_document") String documentId); @Path("/profiles/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:read:json", description = "Lire un profil donné") Response findProfilesByID(@PathParam("id_document") String documentId); @Path("/archiveunitprofiles/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:id:read:json", description = "Lire un document type donné") Response findArchiveUnitProfilesByID(@PathParam("id_document") String documentId); @Path("/contexts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "contexts:id:read", description = "Lire un contexte donné") Response findContextById(@PathParam("id_document") String documentId); @Path("/contexts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:id:update", description = "Effectuer une mise à jour sur un contexte", isAdminOnly = true) Response updateContext(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/profiles/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:update:json", description = "Effectuer une mise à jour sur un profil") Response updateProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/archiveunitprofiles/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:id:update:json", description = "Effectuer une mise à jour sur un document type") Response updateArchiveUnitProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/accesscontracts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:id:update", description = "Effectuer une mise à jour sur un contrat d'accès") Response updateAccessContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/ingestcontracts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:id:update", description = "Effectuer une mise à jour sur un contrat d'entrée") Response updateIngestContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API_UPDATE + "/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:id:update", description = "Effectuer une mise à jour sur un contrat de gestion") Response updateManagementContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @GET @Path(AccessExtAPI.ACCESSION_REGISTERS_API + "/{id_document}/" + AccessExtAPI.ACCESSION_REGISTERS_DETAIL) @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = AccessExtAPI.ACCESSION_REGISTERS + ":id:" + AccessExtAPI.ACCESSION_REGISTERS_DETAIL + ":read", description = "Lister les détails d'un registre de fonds") Response findAccessionRegisterDetail(@PathParam("id_document") String originatingAgency,
        @Dsl(value = SELECT_SINGLE) JsonNode select); @POST @Path(AccessExtAPI.TRACEABILITY_API + "checks") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "traceabilitychecks:create", description = "Tester l'intégrité d'un journal sécurisé") Response checkOperationTraceability(@Dsl(value = SELECT_SINGLE) JsonNode query); @POST @Path(AccessExtAPI.AUDITS_API) @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "audits:create", description = "Lancer un audit de l'existance des objets") Response launchAudit(AuditOptions options); @Path("/securityprofiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:create:json", isAdminOnly = true, description = "Importer des profiles de sécurité dans le référentiel") Response importSecurityProfiles(JsonNode document); @POST @Path(AccessExtAPI.EXPORT_PROBATIVE_VALUE) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "probativevalue:create", description = "Lancer un export du relevé de valeur probante") Response exportProbativeValue(ProbativeValueRequest probativeValueRequest); @Path("/securityprofiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:read", description = "Lister le contenu du référentiel des profiles de sécurité") Response findSecurityProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/securityprofiles/{identifier}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:id:read", description = "Lire un profile de sécurité donné") Response findSecurityProfileByIdentifier(@PathParam("identifier") String identifier); @Path("/securityprofiles/{identifier}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:id:update", isAdminOnly = true, description = "Effectuer une mise à jour sur un profil de sécurité") Response updateSecurityProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @GET @Path("/operations") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "operations:read", description = "Récupérer les informations sur une opération donnée") Response listOperationsDetails(@Context HttpHeaders headers, ProcessQuery query); @Path("operations/{id}") @HEAD @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:read:status", description = "Récupérer le code HTTP d'une opération donnée") Response getWorkFlowExecutionStatus(@PathParam("id") String id); @Path("operations/{id}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:read", description = "Récupérer le statut d'une opération donnée") Response getOperationProcessExecutionDetails(@PathParam("id") String id); @Path("operations/{id}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:update", description = "Changer le statut d'une opération donnée") Response updateWorkFlowStatus(@Context HttpHeaders headers, @PathParam("id") String id); @Path("operations/{id}") @DELETE @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:delete", description = "Annuler une opération donnée") Response interruptWorkFlowExecution(@PathParam("id") String id); @GET @Path("/workflows") @Produces(APPLICATION_JSON) @Secured(permission = "workflows:read", description = "Récupérer la liste des tâches des workflows") Response getWorkflowDefinitions(@Context HttpHeaders headers); @GET @Path("/rulesreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesreport:id:read", description = "Récupérer le rapport pour une opération d'import de règles de gestion") Response downloadRulesReportAsStream(@PathParam("opId") String opId); @GET @Path("/batchreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "batchreport:id:read", description = "Récupérer le rapport pour un traitement de masse (Elimination, Preservation, Audit, Mise à jour)") Response downloadBatchReportAsStream(@PathParam("opId") String opId); @GET @Path("/distributionreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "distributionreport:id:read", description = "Récupérer le rapport pour une opération de mise à jour de masse distribuée") Response downloadDistributionReportAsStream(@PathParam("opId") String opId); @GET @Path("/rulesreferential/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesreferential:id:read", description = "Récupérer le référentiel pour une opération d'import de règles de gestion") Response downloadAgenciesCsvAsStream(@PathParam("opId") String opId); @GET @Path("/agenciesreferential/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "agenciesreferential:id:read", description = "Récupérer le référentiel pour une opération d'import des service agents") Response downloadRulesCsvAsStream(@PathParam("opId") String opId); @Path("/evidenceaudit") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "evidenceaudit:check", description = "Audit de traçabilité d'unités archivistiques") Response checkEvidenceAudit(@Dsl(value = DslSchema.SELECT_MULTIPLE) JsonNode select); @Path(RECTIFICATION_AUDIT) @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "rectificationaudit:check", description = "rectification de données suite a un audit") Response rectificationAudit(String operationId); @Path("/ontologies") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:create:json", description = "Importer les ontologies dans le référentiel") Response importOntologies(@HeaderParam(GlobalDataRest.FORCE_UPDATE) boolean forceUpdate,
        JsonNode ontologies); @Path("/ontologies") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:read", description = "Lister le contenu du référentiel des ontologies") Response findOntologies(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/ontologies/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:id:read:json", description = "Lire une ontologie") Response findOntologiesByID(@PathParam("id_document") String documentId); @Path("/forcepause") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "forcepause:check", description = "Force la pause sur un type d'operation et/ou sur un tenant") Response forcePause(ProcessPause info); @Path("/removeforcepause") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "removeforcepause:check", description = "Retire la pause sur un type d'operation et/ou sur un tenant") Response removeForcePause(ProcessPause info); @POST @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "griffins:create", isAdminOnly = true, description = "Import du griffon") Response importGriffin(JsonNode griffins); @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "griffins:read", description = "Lister le contenu du référentiel des griffons") Response findGriffin(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/preservationScenario") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "preservationScenarios:read", description = "Lister le contenu du référentiel des préservation scénarios") Response findPreservationScenarios(@Dsl(value = SELECT_SINGLE) JsonNode select); @POST @Path("/preservationScenario") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "preservationScenarios:create", description = "Import des perservation scénarios") Response importPreservationScenario(JsonNode preservationScenarios); @Path("/griffin/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "griffin:read", description = "lecture d'un griffin par identifier") Response findGriffinByID(@PathParam("id_document") String documentId); @Path("/preservationScenario/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "preservationScenario:read", description = "lecture d'un scenario par identifier") Response findPreservationByID(@PathParam("id_document") String documentId); @POST @Path(AccessExtAPI.LOGBOOK_OPERATIONS) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "logbookoperations:create", description = "Créer une opération") Response createExternalOperation(LogbookOperationParameters operation); }
AdminManagementExternalResource extends ApplicationStatusResource { @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") public Response importIngestContracts(JsonNode select) { checkParameter(JSON_SELECT_IS_MANDATORY, select); try (AdminManagementClient client = adminManagementClientFactory.getClient()) { Status status = client.importIngestContracts(getFromStringAsTypeReference(select.toString(), new TypeReference<List<IngestContractModel>>() { })); if (BAD_REQUEST.getStatusCode() == status.getStatusCode()) { return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, BAD_REQUEST.getReasonPhrase()) .toResponse(); } return Response.status(status) .entity(SUCCESSFULLY_IMPORTED) .build(); } catch (final ReferentialException e) { LOGGER.error(e); return VitamCodeHelper.toVitamError(VitamCode.ADMIN_EXTERNAL_BAD_REQUEST, e.getMessage()) .toResponse(); } catch (InvalidParseOperationException | InvalidFormatException e) { LOGGER.error(e); VitamError error = new VitamError(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getItem()) .setMessage(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()) .setState(StatusCode.KO.name()) .setCode(VitamCodeHelper.getCode(VitamCode.ACCESS_EXTERNAL_INVALID_JSON)) .setContext(ACCESS_EXTERNAL_MODULE) .setDescription(VitamCode.ACCESS_EXTERNAL_INVALID_JSON.getMessage()); return Response.status(BAD_REQUEST) .entity(error).build(); } } AdminManagementExternalResource(SecureEndpointRegistry secureEndpointRegistry); @VisibleForTesting  AdminManagementExternalResource(
        VitamStatusService statusService,
        SecureEndpointRegistry secureEndpointRegistry,
        AdminManagementClientFactory adminManagementClientFactory,
        IngestInternalClientFactory ingestInternalClientFactory,
        AccessInternalClientFactory accessInternalClientFactory); @Path("/") @OPTIONS @Produces(APPLICATION_JSON) @Unsecured() Response listResourceEndpoints(); @Path("/formatsfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "formatsfile:check", isAdminOnly = true, description = "Vérifier si le référentiel des formats que l'on souhaite importer est valide") Response checkDocument(InputStream document); @Path("/rulesfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesfile:check", description = "Vérifier si le référentiel de règles de gestions que l'on souhaite importer est valide") Response checkRules(InputStream document); @Path("/agenciesfilecheck") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "agenciesfile:check", description = "Vérifier si le référentiel de services producteurs que l'on souhaite importer est valide") Response checkAgencies(InputStream document); @Path("/formats") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "formats:create", description = "Importer un référentiel des formats", isAdminOnly = true) Response importFormat(@Context HttpHeaders headers, @Context UriInfo uriInfo, InputStream document); @Path("/rules") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "rules:create", description = "Importer un référentiel des règles de gestion") Response importRulesFile(@Context HttpHeaders headers, InputStream document); @Path("/ingestcontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:create:json", description = "Importer des contrats d'entrées dans le référentiel") Response importIngestContracts(JsonNode select); @Path("/accesscontracts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:create:json", description = "Importer des contrats d'accès dans le référentiel") Response importAccessContracts(JsonNode contract); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API) @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:create:json", description = "Importer des contrats de gestion dans le référentiel") Response importManagementContracts(JsonNode contract); @Path("/contexts") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:create:json", description = "Importer des contextes dans le référentiel", isAdminOnly = true) Response importContexts(JsonNode select); @Path("/profiles") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:create:binary", description = "Importer des profils dans le référentiel") Response createProfiles(InputStream document); @Path("/profiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:create:json", description = "Ecrire un profil dans le référentiel") Response createProfiles(JsonNode select); @Path("/archiveunitprofiles") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:create:binary", description = "Importer un ou plusieurs document types dans le référentiel") Response createArchiveUnitProfiles(InputStream document); @Path("/archiveunitprofiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:create:json", description = "Ecrire un ou plusieurs document type dans le référentiel") Response createArchiveUnitProfiles(JsonNode select); @Path("/profiles/{id:.+}") @PUT @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:update:binaire", description = "Importer un fichier xsd ou rng dans un profil") Response importProfileFile(@Context UriInfo uriInfo, @PathParam("id") String profileMetadataId,
        InputStream profileFile); @GET @Path("/profiles/{id:.+}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "profiles:id:read:binary", description = "Télecharger le fichier xsd ou rng attaché à un profil") Response downloadProfileFile(
        @PathParam("id") String fileId); @GET @Path("/traceability/{id}/datafiles") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "traceability:id:read", description = "Télécharger le logbook sécurisé attaché à une opération de sécurisation") Response downloadTraceabilityFile(
        @PathParam("id") String fileId); @Path("/formats") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "formats:read", description = "Lister le contenu du référentiel des formats") Response getFormats(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/rules") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "rules:read", description = "Lister le contenu du référentiel des règles de gestion") Response getRules(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/ingestcontracts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:read", description = "Lister le contenu du référentiel des contrats d'entrée") Response findIngestContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/accesscontracts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:read", description = "Lister le contenu du référentiel des contrats d'accès") Response findAccessContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API) @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:read", description = "Lister le contenu du référentiel des contrats de gestion") Response findManagementContracts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/profiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:read", description = "Lister le contenu du référentiel des profils") Response findProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/archiveunitprofiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:read", description = "Lister le contenu du référentiel des document types") Response findArchiveUnitProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/contexts") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:read", description = "Lister le contenu du référentiel des contextes") Response findContexts(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/agencies") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(APPLICATION_JSON) @Secured(permission = "agencies:create", description = "Importer un référentiel des services producteurs") Response importAgenciesFile(@Context HttpHeaders headers,
        InputStream document); @Path("/agencies/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "agencies:id:read", description = "Trouver un service producteur avec son identifier") Response findAgencyByID(@PathParam("id_document") String documentId); @Path("/agencies") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "agencies:read", description = "Lister le contenu du référentiel des services producteurs") Response findAgencies(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path(AccessExtAPI.ACCESSION_REGISTERS_API) @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = AccessExtAPI.ACCESSION_REGISTERS + ":read", description = "Lister le contenu du référentiel des registres des fonds") Response getAccessionRegister(@Dsl(value = SELECT_SINGLE) JsonNode select); @GET @Path("accessionregisterssymbolic") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accessionregisterssymbolic:read", description = "Get accession register symbolic") Response getAccessionRegisterSymbolic(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/formats/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "formats:id:read", description = "Lire un format donné") Response findFormatByID(@PathParam("id_document") String documentId); @Path("/rules/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "rules:id:read", description = "Lire une règle de gestion donnée") Response findRuleByID(@PathParam("id_document") String documentId); @Path("/ingestcontracts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:id:read", description = "Lire un contrat d'entrée donné") Response findIngestContractsByID(@PathParam("id_document") String documentId); @Path("/accesscontracts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:id:read", description = "Lire un contrat d'accès donné") Response findAccessContractsByID(@PathParam("id_document") String documentId); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API + "/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:id:read", description = "Lire un contrat de gestion donné") Response findManagementContractsByID(@PathParam("id_document") String documentId); @Path("/profiles/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:read:json", description = "Lire un profil donné") Response findProfilesByID(@PathParam("id_document") String documentId); @Path("/archiveunitprofiles/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:id:read:json", description = "Lire un document type donné") Response findArchiveUnitProfilesByID(@PathParam("id_document") String documentId); @Path("/contexts/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "contexts:id:read", description = "Lire un contexte donné") Response findContextById(@PathParam("id_document") String documentId); @Path("/contexts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "contexts:id:update", description = "Effectuer une mise à jour sur un contexte", isAdminOnly = true) Response updateContext(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/profiles/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "profiles:id:update:json", description = "Effectuer une mise à jour sur un profil") Response updateProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/archiveunitprofiles/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "archiveunitprofiles:id:update:json", description = "Effectuer une mise à jour sur un document type") Response updateArchiveUnitProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/accesscontracts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "accesscontracts:id:update", description = "Effectuer une mise à jour sur un contrat d'accès") Response updateAccessContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path("/ingestcontracts/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ingestcontracts:id:update", description = "Effectuer une mise à jour sur un contrat d'entrée") Response updateIngestContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @Path(AccessExtAPI.MANAGEMENT_CONTRACT_API_UPDATE + "/{identifier:.+}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "managementcontracts:id:update", description = "Effectuer une mise à jour sur un contrat de gestion") Response updateManagementContract(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @GET @Path(AccessExtAPI.ACCESSION_REGISTERS_API + "/{id_document}/" + AccessExtAPI.ACCESSION_REGISTERS_DETAIL) @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = AccessExtAPI.ACCESSION_REGISTERS + ":id:" + AccessExtAPI.ACCESSION_REGISTERS_DETAIL + ":read", description = "Lister les détails d'un registre de fonds") Response findAccessionRegisterDetail(@PathParam("id_document") String originatingAgency,
        @Dsl(value = SELECT_SINGLE) JsonNode select); @POST @Path(AccessExtAPI.TRACEABILITY_API + "checks") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "traceabilitychecks:create", description = "Tester l'intégrité d'un journal sécurisé") Response checkOperationTraceability(@Dsl(value = SELECT_SINGLE) JsonNode query); @POST @Path(AccessExtAPI.AUDITS_API) @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "audits:create", description = "Lancer un audit de l'existance des objets") Response launchAudit(AuditOptions options); @Path("/securityprofiles") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:create:json", isAdminOnly = true, description = "Importer des profiles de sécurité dans le référentiel") Response importSecurityProfiles(JsonNode document); @POST @Path(AccessExtAPI.EXPORT_PROBATIVE_VALUE) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "probativevalue:create", description = "Lancer un export du relevé de valeur probante") Response exportProbativeValue(ProbativeValueRequest probativeValueRequest); @Path("/securityprofiles") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:read", description = "Lister le contenu du référentiel des profiles de sécurité") Response findSecurityProfiles(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/securityprofiles/{identifier}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:id:read", description = "Lire un profile de sécurité donné") Response findSecurityProfileByIdentifier(@PathParam("identifier") String identifier); @Path("/securityprofiles/{identifier}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "securityprofiles:id:update", isAdminOnly = true, description = "Effectuer une mise à jour sur un profil de sécurité") Response updateSecurityProfile(@PathParam("identifier") String identifier,
        @Dsl(DslSchema.UPDATE_BY_ID) JsonNode queryDsl); @GET @Path("/operations") @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "operations:read", description = "Récupérer les informations sur une opération donnée") Response listOperationsDetails(@Context HttpHeaders headers, ProcessQuery query); @Path("operations/{id}") @HEAD @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:read:status", description = "Récupérer le code HTTP d'une opération donnée") Response getWorkFlowExecutionStatus(@PathParam("id") String id); @Path("operations/{id}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:read", description = "Récupérer le statut d'une opération donnée") Response getOperationProcessExecutionDetails(@PathParam("id") String id); @Path("operations/{id}") @PUT @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:update", description = "Changer le statut d'une opération donnée") Response updateWorkFlowStatus(@Context HttpHeaders headers, @PathParam("id") String id); @Path("operations/{id}") @DELETE @Produces(APPLICATION_JSON) @Secured(permission = "operations:id:delete", description = "Annuler une opération donnée") Response interruptWorkFlowExecution(@PathParam("id") String id); @GET @Path("/workflows") @Produces(APPLICATION_JSON) @Secured(permission = "workflows:read", description = "Récupérer la liste des tâches des workflows") Response getWorkflowDefinitions(@Context HttpHeaders headers); @GET @Path("/rulesreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesreport:id:read", description = "Récupérer le rapport pour une opération d'import de règles de gestion") Response downloadRulesReportAsStream(@PathParam("opId") String opId); @GET @Path("/batchreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "batchreport:id:read", description = "Récupérer le rapport pour un traitement de masse (Elimination, Preservation, Audit, Mise à jour)") Response downloadBatchReportAsStream(@PathParam("opId") String opId); @GET @Path("/distributionreport/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "distributionreport:id:read", description = "Récupérer le rapport pour une opération de mise à jour de masse distribuée") Response downloadDistributionReportAsStream(@PathParam("opId") String opId); @GET @Path("/rulesreferential/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "rulesreferential:id:read", description = "Récupérer le référentiel pour une opération d'import de règles de gestion") Response downloadAgenciesCsvAsStream(@PathParam("opId") String opId); @GET @Path("/agenciesreferential/{opId}") @Produces(MediaType.APPLICATION_OCTET_STREAM) @Secured(permission = "agenciesreferential:id:read", description = "Récupérer le référentiel pour une opération d'import des service agents") Response downloadRulesCsvAsStream(@PathParam("opId") String opId); @Path("/evidenceaudit") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "evidenceaudit:check", description = "Audit de traçabilité d'unités archivistiques") Response checkEvidenceAudit(@Dsl(value = DslSchema.SELECT_MULTIPLE) JsonNode select); @Path(RECTIFICATION_AUDIT) @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "rectificationaudit:check", description = "rectification de données suite a un audit") Response rectificationAudit(String operationId); @Path("/ontologies") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:create:json", description = "Importer les ontologies dans le référentiel") Response importOntologies(@HeaderParam(GlobalDataRest.FORCE_UPDATE) boolean forceUpdate,
        JsonNode ontologies); @Path("/ontologies") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:read", description = "Lister le contenu du référentiel des ontologies") Response findOntologies(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/ontologies/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "ontologies:id:read:json", description = "Lire une ontologie") Response findOntologiesByID(@PathParam("id_document") String documentId); @Path("/forcepause") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "forcepause:check", description = "Force la pause sur un type d'operation et/ou sur un tenant") Response forcePause(ProcessPause info); @Path("/removeforcepause") @POST @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "removeforcepause:check", description = "Retire la pause sur un type d'operation et/ou sur un tenant") Response removeForcePause(ProcessPause info); @POST @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "griffins:create", isAdminOnly = true, description = "Import du griffon") Response importGriffin(JsonNode griffins); @GET @Path("/griffin") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "griffins:read", description = "Lister le contenu du référentiel des griffons") Response findGriffin(@Dsl(value = SELECT_SINGLE) JsonNode select); @Path("/preservationScenario") @GET @Consumes(APPLICATION_JSON) @Produces(APPLICATION_JSON) @Secured(permission = "preservationScenarios:read", description = "Lister le contenu du référentiel des préservation scénarios") Response findPreservationScenarios(@Dsl(value = SELECT_SINGLE) JsonNode select); @POST @Path("/preservationScenario") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "preservationScenarios:create", description = "Import des perservation scénarios") Response importPreservationScenario(JsonNode preservationScenarios); @Path("/griffin/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "griffin:read", description = "lecture d'un griffin par identifier") Response findGriffinByID(@PathParam("id_document") String documentId); @Path("/preservationScenario/{id_document:.+}") @GET @Produces(APPLICATION_JSON) @Secured(permission = "preservationScenario:read", description = "lecture d'un scenario par identifier") Response findPreservationByID(@PathParam("id_document") String documentId); @POST @Path(AccessExtAPI.LOGBOOK_OPERATIONS) @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Secured(permission = "logbookoperations:create", description = "Créer une opération") Response createExternalOperation(LogbookOperationParameters operation);  }