@Test public void getOfferLogs() { OfferLogRequest offerLogRequest = new OfferLogRequest(2L, 10, Order.DESC); given() .header(VitamHttpHeader.TENANT_ID.getName(), TENANT_ID) .header(VitamHttpHeader.STRATEGY_ID.getName(), STRATEGY_ID) .contentType(ContentType.JSON) .accept(MediaType.APPLICATION_JSON) .body(offerLogRequest) .when().get("/" + DataCategory.OBJECT.name() + LOGS) .then().statusCode(Status.OK.getStatusCode()); offerLogRequest = new OfferLogRequest(null, 1, Order.DESC); given() .header(VitamHttpHeader.TENANT_ID.getName(), TENANT_ID) .header(VitamHttpHeader.STRATEGY_ID.getName(), STRATEGY_ID) .contentType(ContentType.JSON) .accept(MediaType.APPLICATION_JSON) .body(offerLogRequest) .when().get("/" + DataCategory.OBJECT.name() + LOGS) .then().statusCode(Status.OK.getStatusCode()); given() .header(VitamHttpHeader.TENANT_ID.getName(), TENANT_ID_A_E) .header(VitamHttpHeader.STRATEGY_ID.getName(), STRATEGY_ID) .contentType(ContentType.JSON) .accept(MediaType.APPLICATION_JSON) .body(offerLogRequest) .when().get("/" + DataCategory.OBJECT.name() + LOGS) .then().statusCode(Status.INTERNAL_SERVER_ERROR.getStatusCode()); given() .header(VitamHttpHeader.TENANT_ID.getName(), TENANT_ID) .header(VitamHttpHeader.STRATEGY_ID.getName(), "") .contentType(ContentType.JSON) .accept(MediaType.APPLICATION_JSON) .body(offerLogRequest) .when().get("/" + DataCategory.OBJECT.name() + LOGS) .then().statusCode(Status.PRECONDITION_FAILED.getStatusCode()); }
@Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response getOfferLogs(@Context HttpHeaders headers, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) { VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID); if (vitamCode != null) { return buildErrorResponse(vitamCode); } try { String strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0); RequestResponse<OfferLog> jsonNodeRequestResponse = distribution.getOfferLogs(strategyId, type, offerLogRequest.getOffset(), offerLogRequest.getLimit(), offerLogRequest.getOrder()); return jsonNodeRequestResponse.toResponse(); } catch (IllegalArgumentException exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_BAD_REQUEST, null).toResponse(); } catch (Exception exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR, null).toResponse(); } }
StorageResource extends ApplicationStatusResource implements VitamAutoCloseable { @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response getOfferLogs(@Context HttpHeaders headers, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) { VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID); if (vitamCode != null) { return buildErrorResponse(vitamCode); } try { String strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0); RequestResponse<OfferLog> jsonNodeRequestResponse = distribution.getOfferLogs(strategyId, type, offerLogRequest.getOffset(), offerLogRequest.getLimit(), offerLogRequest.getOrder()); return jsonNodeRequestResponse.toResponse(); } catch (IllegalArgumentException exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_BAD_REQUEST, null).toResponse(); } catch (Exception exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR, null).toResponse(); } } }
StorageResource extends ApplicationStatusResource implements VitamAutoCloseable { @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response getOfferLogs(@Context HttpHeaders headers, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) { VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID); if (vitamCode != null) { return buildErrorResponse(vitamCode); } try { String strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0); RequestResponse<OfferLog> jsonNodeRequestResponse = distribution.getOfferLogs(strategyId, type, offerLogRequest.getOffset(), offerLogRequest.getLimit(), offerLogRequest.getOrder()); return jsonNodeRequestResponse.toResponse(); } catch (IllegalArgumentException exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_BAD_REQUEST, null).toResponse(); } catch (Exception exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR, null).toResponse(); } } StorageResource(StorageConfiguration configuration); @VisibleForTesting  StorageResource(StorageDistribution storageDistribution, TimestampGenerator timestampGenerator); }
StorageResource extends ApplicationStatusResource implements VitamAutoCloseable { @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response getOfferLogs(@Context HttpHeaders headers, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) { VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID); if (vitamCode != null) { return buildErrorResponse(vitamCode); } try { String strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0); RequestResponse<OfferLog> jsonNodeRequestResponse = distribution.getOfferLogs(strategyId, type, offerLogRequest.getOffset(), offerLogRequest.getLimit(), offerLogRequest.getOrder()); return jsonNodeRequestResponse.toResponse(); } catch (IllegalArgumentException exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_BAD_REQUEST, null).toResponse(); } catch (Exception exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR, null).toResponse(); } } StorageResource(StorageConfiguration configuration); @VisibleForTesting  StorageResource(StorageDistribution storageDistribution, TimestampGenerator timestampGenerator); @Path("/copy/{id_object}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response copy(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path("/create/{id_operation}") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) Response create(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_operation") String operationId, InputStream inputStream); @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getStorageInformation(@Context HttpHeaders headers); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGEACCESSLOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response listObjects(@Context HttpHeaders headers, @PathParam("type") DataCategory type); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getOfferLogs(@Context HttpHeaders headers,
        @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest); @Path("/info/{type}/{id_object}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getInformation(@Context HttpHeaders headers,
        @PathParam("type") String typeStr, @PathParam("id_object") String objectId); @Path("/batch_info/{type}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getBatchObjectInformation(@Context HttpHeaders headers, @PathParam("type") String typeStr,
        List<String> objectIds); @Path("/objects/{id_object}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getObject(@Context HttpHeaders headers, @PathParam("id_object") String objectId,
        AccessLogInfoModel logInfo); @Path("/backup/{backupfile}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getBackupFile(@Context HttpHeaders headers, @PathParam("backupfile") String backupfile); @Path("/objects/{id_object}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_object") String objectId, ObjectDescription createObjectDescription); @Path("/backupoperations/{id_operation}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createOrUpdateBackupOperation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_operation") String operationId, ObjectDescription createObjectDescription); @Path("/storageaccesslog/{storageaccesslogfile}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getAccessLogFile(@Context HttpHeaders headers,
        @PathParam("storageaccesslogfile") String storageAccessLogFile); @Path("/offers") @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getOffers(@HeaderParam(GlobalDataRest.X_STRATEGY_ID) String strategyId); @Path("/backupoperations/{id_operation}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getBackupOperation(@Context HttpHeaders headers, @PathParam("id_operation") String operationId); @Path("/delete/{id_object}") @DELETE @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response deleteObject(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/{id_object}") @HEAD @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response checkObject(@Context HttpHeaders headers, @PathParam("type") DataCategory type,
        @PathParam("id_object") String objectId); @Path("/logbooks/{id_logbook}") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getLogbookStream(@Context HttpHeaders headers, @PathParam("id_logbook") String objectId); @Path("/logbooks/{id_logbook}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createLogbook(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_logbook") String logbookId, ObjectDescription createObjectDescription); @Path("/units/{id_md}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getUnit(@Context HttpHeaders headers, @PathParam("id_md") String unitId); @Path("/units/{id_md}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createUnitMetadata(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_md") String metadataId, ObjectDescription createObjectDescription); @Path("/objectgroups/{id_md}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getObjectGroup(@Context HttpHeaders headers, @PathParam("id_md") String metadataId); @Path("/objectgroups/{id_md}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectGroup(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_md") String metadataId, ObjectDescription createObjectDescription); @POST @Path("/archivaltransferreply/{id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response storeArchivalTransferReply(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers, @PathParam("id") String id, ObjectDescription description); @POST @Path("/tmp/{id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response storeTemporaryFile(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id") String id, ObjectDescription description); @Path("/tmp/{file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getTemporaryFile(@Context HttpHeaders headers,
        @PathParam("file_name") String file_name); @Path("/reports/{id_report}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createReportOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_report") String reportId, ObjectDescription createObjectDescription); @Path("/reports/{id_report}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getReport(@Context HttpHeaders headers, @PathParam("id_report") String objectId); @Path("/distributionreports/{id_report}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getDistributionReport(@Context HttpHeaders headers, @PathParam("id_report") String objectId); @Path("/manifests/{id_manifest}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createManifestOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_manifest") String manifestId, ObjectDescription createObjectDescription); @Path("/manifests/{id_manifest}") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getManifest(@Context HttpHeaders headers, @PathParam("id_manifest") String objectId); @POST @Path("/storage/backup/accesslog") @Produces(MediaType.APPLICATION_JSON) Response backupStorageAccessLog(@Context HttpHeaders headers); @POST @Path("/storage/backup") @Produces(MediaType.APPLICATION_JSON) Response backupStorageLog(@Context HttpHeaders headers); @POST @Path("/storage/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityStorageLogbook(@Context HttpHeaders headers); @Path("/storagelog/{storagelogname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageLog(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storagelogname") String storageLogname, ObjectDescription createObjectDescription); @Path("/storageaccesslog/{storageaccesslogname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageAccessLog(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storageaccesslogname") String storageAccessLogName, ObjectDescription createObjectDescription); @Path("/storagetraceability/{storagetraceabilityname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageTraceability(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storagetraceabilityname") String storagetraceabilityname,
        ObjectDescription createObjectDescription); @Path("/storagetraceability/{storagetraceability_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response downloadStorageTraceability(@Context HttpHeaders headers,
        @PathParam("storagetraceability_name") String filename); @Path("/backup/{backupfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createBackupFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("backupfile") String backupfile, ObjectDescription createObjectDescription); @Path("/rules/{rulefile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createRuleFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("rulefile") String ruleFile, ObjectDescription createObjectDescription); @Path("/rules/{id_object}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getRuleFile(@Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path("/unitgraph/{graph_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createUnitGraphFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name, ObjectDescription createObjectDescription); @Path("/unitgraph/{graph_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getUnitGraphFile(@Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name); @Path("/objectgroupgraph/{graph_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectGroupGraphFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name, ObjectDescription createObjectDescription); @Path("/objectgroupgraph/{graph_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getObjectGroupGraphFile(@Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name); @Path("/agencies/{agencyfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response creatAgencyfileFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("agencyfile") String agencyfile, ObjectDescription createObjectDescription); @Path("/profiles/{profile_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createProfileOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("profile_file_name") String profileFileName, ObjectDescription createObjectDescription); @Path("/profiles/{profile_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response downloadProfile(@Context HttpHeaders headers,
        @PathParam("profile_file_name") String profileFileName); @Path("/distributionreports/{distributionreportfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createDistributionReportFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("distributionreportfile") String distributionreportfile, ObjectDescription createObjectDescription); @Path("/accessionregistersdetail/{fileName}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createAccessionRegisterDetail(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("fileName") String fileName, ObjectDescription createObjectDescription); @Path("/accessionregistersdetail/{fileName}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getAccessionRegisterDetail(@Context HttpHeaders headers, @PathParam("fileName") String fileName); @Path("/accessionregisterssymbolic/{fileName}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createAccessionRegisterSymbolic(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("fileName") String fileName, ObjectDescription createObjectDescription); @Path("/accessionregisterssymbolic/{fileName}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getAccessionRegisterSymbolic(@Context HttpHeaders headers, @PathParam("fileName") String fileName); @Path("/bulk/{folder}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response bulkCreateFromWorkspace(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("folder") String folder, BulkObjectStoreRequest bulkObjectStoreRequest); @Path("/strategies") @GET @Produces(MediaType.APPLICATION_JSON) Response getStrategies(); @Override void close(); }
StorageResource extends ApplicationStatusResource implements VitamAutoCloseable { @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) public Response getOfferLogs(@Context HttpHeaders headers, @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest) { VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID); if (vitamCode != null) { return buildErrorResponse(vitamCode); } try { String strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0); RequestResponse<OfferLog> jsonNodeRequestResponse = distribution.getOfferLogs(strategyId, type, offerLogRequest.getOffset(), offerLogRequest.getLimit(), offerLogRequest.getOrder()); return jsonNodeRequestResponse.toResponse(); } catch (IllegalArgumentException exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_BAD_REQUEST, null).toResponse(); } catch (Exception exc) { LOGGER.error(exc); return VitamCodeHelper.toVitamError(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR, null).toResponse(); } } StorageResource(StorageConfiguration configuration); @VisibleForTesting  StorageResource(StorageDistribution storageDistribution, TimestampGenerator timestampGenerator); @Path("/copy/{id_object}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response copy(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path("/create/{id_operation}") @POST @Consumes(MediaType.APPLICATION_OCTET_STREAM) @Produces(MediaType.APPLICATION_JSON) Response create(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_operation") String operationId, InputStream inputStream); @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getStorageInformation(@Context HttpHeaders headers); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGEACCESSLOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response listObjects(@Context HttpHeaders headers, @PathParam("type") DataCategory type); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/logs") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getOfferLogs(@Context HttpHeaders headers,
        @PathParam("type") DataCategory type, OfferLogRequest offerLogRequest); @Path("/info/{type}/{id_object}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getInformation(@Context HttpHeaders headers,
        @PathParam("type") String typeStr, @PathParam("id_object") String objectId); @Path("/batch_info/{type}") @GET @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response getBatchObjectInformation(@Context HttpHeaders headers, @PathParam("type") String typeStr,
        List<String> objectIds); @Path("/objects/{id_object}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getObject(@Context HttpHeaders headers, @PathParam("id_object") String objectId,
        AccessLogInfoModel logInfo); @Path("/backup/{backupfile}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getBackupFile(@Context HttpHeaders headers, @PathParam("backupfile") String backupfile); @Path("/objects/{id_object}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_object") String objectId, ObjectDescription createObjectDescription); @Path("/backupoperations/{id_operation}") @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createOrUpdateBackupOperation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_operation") String operationId, ObjectDescription createObjectDescription); @Path("/storageaccesslog/{storageaccesslogfile}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getAccessLogFile(@Context HttpHeaders headers,
        @PathParam("storageaccesslogfile") String storageAccessLogFile); @Path("/offers") @GET @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response getOffers(@HeaderParam(GlobalDataRest.X_STRATEGY_ID) String strategyId); @Path("/backupoperations/{id_operation}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getBackupOperation(@Context HttpHeaders headers, @PathParam("id_operation") String operationId); @Path("/delete/{id_object}") @DELETE @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response deleteObject(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path( "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" + "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}/{id_object}") @HEAD @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response checkObject(@Context HttpHeaders headers, @PathParam("type") DataCategory type,
        @PathParam("id_object") String objectId); @Path("/logbooks/{id_logbook}") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getLogbookStream(@Context HttpHeaders headers, @PathParam("id_logbook") String objectId); @Path("/logbooks/{id_logbook}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createLogbook(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_logbook") String logbookId, ObjectDescription createObjectDescription); @Path("/units/{id_md}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getUnit(@Context HttpHeaders headers, @PathParam("id_md") String unitId); @Path("/units/{id_md}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createUnitMetadata(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_md") String metadataId, ObjectDescription createObjectDescription); @Path("/objectgroups/{id_md}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getObjectGroup(@Context HttpHeaders headers, @PathParam("id_md") String metadataId); @Path("/objectgroups/{id_md}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectGroup(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id_md") String metadataId, ObjectDescription createObjectDescription); @POST @Path("/archivaltransferreply/{id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response storeArchivalTransferReply(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers, @PathParam("id") String id, ObjectDescription description); @POST @Path("/tmp/{id}") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response storeTemporaryFile(@Context HttpServletRequest httpServletRequest, @Context HttpHeaders headers,
        @PathParam("id") String id, ObjectDescription description); @Path("/tmp/{file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getTemporaryFile(@Context HttpHeaders headers,
        @PathParam("file_name") String file_name); @Path("/reports/{id_report}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createReportOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_report") String reportId, ObjectDescription createObjectDescription); @Path("/reports/{id_report}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getReport(@Context HttpHeaders headers, @PathParam("id_report") String objectId); @Path("/distributionreports/{id_report}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getDistributionReport(@Context HttpHeaders headers, @PathParam("id_report") String objectId); @Path("/manifests/{id_manifest}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createManifestOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("id_manifest") String manifestId, ObjectDescription createObjectDescription); @Path("/manifests/{id_manifest}") @GET @Produces(MediaType.APPLICATION_OCTET_STREAM) Response getManifest(@Context HttpHeaders headers, @PathParam("id_manifest") String objectId); @POST @Path("/storage/backup/accesslog") @Produces(MediaType.APPLICATION_JSON) Response backupStorageAccessLog(@Context HttpHeaders headers); @POST @Path("/storage/backup") @Produces(MediaType.APPLICATION_JSON) Response backupStorageLog(@Context HttpHeaders headers); @POST @Path("/storage/traceability") @Produces(MediaType.APPLICATION_JSON) Response traceabilityStorageLogbook(@Context HttpHeaders headers); @Path("/storagelog/{storagelogname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageLog(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storagelogname") String storageLogname, ObjectDescription createObjectDescription); @Path("/storageaccesslog/{storageaccesslogname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageAccessLog(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storageaccesslogname") String storageAccessLogName, ObjectDescription createObjectDescription); @Path("/storagetraceability/{storagetraceabilityname}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createStorageTraceability(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("storagetraceabilityname") String storagetraceabilityname,
        ObjectDescription createObjectDescription); @Path("/storagetraceability/{storagetraceability_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response downloadStorageTraceability(@Context HttpHeaders headers,
        @PathParam("storagetraceability_name") String filename); @Path("/backup/{backupfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createBackupFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("backupfile") String backupfile, ObjectDescription createObjectDescription); @Path("/rules/{rulefile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createRuleFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("rulefile") String ruleFile, ObjectDescription createObjectDescription); @Path("/rules/{id_object}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getRuleFile(@Context HttpHeaders headers,
        @PathParam("id_object") String objectId); @Path("/unitgraph/{graph_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createUnitGraphFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name, ObjectDescription createObjectDescription); @Path("/unitgraph/{graph_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getUnitGraphFile(@Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name); @Path("/objectgroupgraph/{graph_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createObjectGroupGraphFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name, ObjectDescription createObjectDescription); @Path("/objectgroupgraph/{graph_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM}) Response getObjectGroupGraphFile(@Context HttpHeaders headers,
        @PathParam("graph_file_name") String graph_file_name); @Path("/agencies/{agencyfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response creatAgencyfileFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("agencyfile") String agencyfile, ObjectDescription createObjectDescription); @Path("/profiles/{profile_file_name}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createProfileOrGetInformation(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("profile_file_name") String profileFileName, ObjectDescription createObjectDescription); @Path("/profiles/{profile_file_name}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response downloadProfile(@Context HttpHeaders headers,
        @PathParam("profile_file_name") String profileFileName); @Path("/distributionreports/{distributionreportfile}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createDistributionReportFile(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("distributionreportfile") String distributionreportfile, ObjectDescription createObjectDescription); @Path("/accessionregistersdetail/{fileName}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createAccessionRegisterDetail(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("fileName") String fileName, ObjectDescription createObjectDescription); @Path("/accessionregistersdetail/{fileName}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getAccessionRegisterDetail(@Context HttpHeaders headers, @PathParam("fileName") String fileName); @Path("/accessionregisterssymbolic/{fileName}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response createAccessionRegisterSymbolic(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("fileName") String fileName, ObjectDescription createObjectDescription); @Path("/accessionregisterssymbolic/{fileName}") @GET @Produces({MediaType.APPLICATION_OCTET_STREAM, CommonMediaType.ZIP}) Response getAccessionRegisterSymbolic(@Context HttpHeaders headers, @PathParam("fileName") String fileName); @Path("/bulk/{folder}") @POST @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) Response bulkCreateFromWorkspace(@Context HttpServletRequest httpServletRequest,
        @Context HttpHeaders headers,
        @PathParam("folder") String folder, BulkObjectStoreRequest bulkObjectStoreRequest); @Path("/strategies") @GET @Produces(MediaType.APPLICATION_JSON) Response getStrategies(); @Override void close();  }