@Test(expected = IllegalArgumentException.class) public void getOfferLogsInvalidRequestOrder() throws Exception { StorageOfferLogRequest offerLogRequest = new StorageOfferLogRequest(tenant, DataCategory.OBJECT.getFolder(), 2L, 10, null); try (Connection connection = driver.connect(offer.getId())) { connection.getOfferLogs(offerLogRequest); } }
@Override public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getTenantId()); ParametersChecker.checkParameter(TYPE_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getType()); ParametersChecker.checkParameter(ORDER_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getOrder()); OfferLogRequest offerLogRequest = new OfferLogRequest(); offerLogRequest.setOffset(storageGetOfferLogRequest.getOffset()); offerLogRequest.setLimit(storageGetOfferLogRequest.getLimit()); offerLogRequest.setOrder(storageGetOfferLogRequest.getOrder()); VitamRequestBuilder requestBuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(storageGetOfferLogRequest.getType()) + LOGS_PATH) .withHeader(GlobalDataRest.X_TENANT_ID, storageGetOfferLogRequest.getTenantId()) .withBody(offerLogRequest) .withJson(); try (Response response = make(requestBuilder)) { return RequestResponse.parseFromResponse(response, OfferLog.class); } catch (Exception exc) { throw new StorageDriverException(getDriverName(), true, exc); } }
ConnectionImpl extends AbstractConnection { @Override public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getTenantId()); ParametersChecker.checkParameter(TYPE_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getType()); ParametersChecker.checkParameter(ORDER_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getOrder()); OfferLogRequest offerLogRequest = new OfferLogRequest(); offerLogRequest.setOffset(storageGetOfferLogRequest.getOffset()); offerLogRequest.setLimit(storageGetOfferLogRequest.getLimit()); offerLogRequest.setOrder(storageGetOfferLogRequest.getOrder()); VitamRequestBuilder requestBuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(storageGetOfferLogRequest.getType()) + LOGS_PATH) .withHeader(GlobalDataRest.X_TENANT_ID, storageGetOfferLogRequest.getTenantId()) .withBody(offerLogRequest) .withJson(); try (Response response = make(requestBuilder)) { return RequestResponse.parseFromResponse(response, OfferLog.class); } catch (Exception exc) { throw new StorageDriverException(getDriverName(), true, exc); } } }
ConnectionImpl extends AbstractConnection { @Override public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getTenantId()); ParametersChecker.checkParameter(TYPE_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getType()); ParametersChecker.checkParameter(ORDER_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getOrder()); OfferLogRequest offerLogRequest = new OfferLogRequest(); offerLogRequest.setOffset(storageGetOfferLogRequest.getOffset()); offerLogRequest.setLimit(storageGetOfferLogRequest.getLimit()); offerLogRequest.setOrder(storageGetOfferLogRequest.getOrder()); VitamRequestBuilder requestBuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(storageGetOfferLogRequest.getType()) + LOGS_PATH) .withHeader(GlobalDataRest.X_TENANT_ID, storageGetOfferLogRequest.getTenantId()) .withBody(offerLogRequest) .withJson(); try (Response response = make(requestBuilder)) { return RequestResponse.parseFromResponse(response, OfferLog.class); } catch (Exception exc) { throw new StorageDriverException(getDriverName(), true, exc); } } ConnectionImpl(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory); }
ConnectionImpl extends AbstractConnection { @Override public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getTenantId()); ParametersChecker.checkParameter(TYPE_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getType()); ParametersChecker.checkParameter(ORDER_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getOrder()); OfferLogRequest offerLogRequest = new OfferLogRequest(); offerLogRequest.setOffset(storageGetOfferLogRequest.getOffset()); offerLogRequest.setLimit(storageGetOfferLogRequest.getLimit()); offerLogRequest.setOrder(storageGetOfferLogRequest.getOrder()); VitamRequestBuilder requestBuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(storageGetOfferLogRequest.getType()) + LOGS_PATH) .withHeader(GlobalDataRest.X_TENANT_ID, storageGetOfferLogRequest.getTenantId()) .withBody(offerLogRequest) .withJson(); try (Response response = make(requestBuilder)) { return RequestResponse.parseFromResponse(response, OfferLog.class); } catch (Exception exc) { throw new StorageDriverException(getDriverName(), true, exc); } } ConnectionImpl(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory); @Override StorageCapacityResult getStorageCapacity(Integer tenantId); @Override StorageGetResult getObject(StorageObjectRequest request); @Override RequestResponse<TapeReadRequestReferentialEntity> createReadOrderRequest(StorageObjectRequest request); @Override RequestResponse<TapeReadRequestReferentialEntity> getReadOrderRequest(String readOrderRequestId, int tenant); @Override void removeReadOrderRequest(String readOrderRequestId, int tenant); @Override StoragePutResult putObject(StoragePutRequest request); @Override StorageBulkPutResult bulkPutObjects(StorageBulkPutRequest request); @Override StorageRemoveResult removeObject(StorageRemoveRequest request); @Override boolean objectExistsInOffer(StorageObjectRequest request); @Override StorageMetadataResult getMetadatas(StorageGetMetadataRequest request); @Override CloseableIterator<ObjectEntry> listObjects(StorageListRequest request); @Override RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest); }
ConnectionImpl extends AbstractConnection { @Override public RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getTenantId()); ParametersChecker.checkParameter(TYPE_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getType()); ParametersChecker.checkParameter(ORDER_IS_A_MANDATORY_PARAMETER, storageGetOfferLogRequest.getOrder()); OfferLogRequest offerLogRequest = new OfferLogRequest(); offerLogRequest.setOffset(storageGetOfferLogRequest.getOffset()); offerLogRequest.setLimit(storageGetOfferLogRequest.getLimit()); offerLogRequest.setOrder(storageGetOfferLogRequest.getOrder()); VitamRequestBuilder requestBuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(storageGetOfferLogRequest.getType()) + LOGS_PATH) .withHeader(GlobalDataRest.X_TENANT_ID, storageGetOfferLogRequest.getTenantId()) .withBody(offerLogRequest) .withJson(); try (Response response = make(requestBuilder)) { return RequestResponse.parseFromResponse(response, OfferLog.class); } catch (Exception exc) { throw new StorageDriverException(getDriverName(), true, exc); } } ConnectionImpl(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory); @Override StorageCapacityResult getStorageCapacity(Integer tenantId); @Override StorageGetResult getObject(StorageObjectRequest request); @Override RequestResponse<TapeReadRequestReferentialEntity> createReadOrderRequest(StorageObjectRequest request); @Override RequestResponse<TapeReadRequestReferentialEntity> getReadOrderRequest(String readOrderRequestId, int tenant); @Override void removeReadOrderRequest(String readOrderRequestId, int tenant); @Override StoragePutResult putObject(StoragePutRequest request); @Override StorageBulkPutResult bulkPutObjects(StorageBulkPutRequest request); @Override StorageRemoveResult removeObject(StorageRemoveRequest request); @Override boolean objectExistsInOffer(StorageObjectRequest request); @Override StorageMetadataResult getMetadatas(StorageGetMetadataRequest request); @Override CloseableIterator<ObjectEntry> listObjects(StorageListRequest request); @Override RequestResponse<OfferLog> getOfferLogs(StorageOfferLogRequest storageGetOfferLogRequest);  }