@Test(expected = IllegalArgumentException.class) public void getGetObjectGUIDIllegalArgumentException() throws Exception { final StorageObjectRequest request = new StorageObjectRequest(tenant, DataCategory.OBJECT.getFolder(), null); try (Connection connection = driver.connect(offer.getId())) { connection.getObject(request); } }
@Override public StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, request); ParametersChecker.checkParameter(GUID_IS_A_MANDATORY_PARAMETER, request.getGuid()); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, request.getTenantId()); ParametersChecker.checkParameter(FOLDER_IS_A_MANDATORY_PARAMETER, request.getType()); ParametersChecker.checkParameter(FOLDER_IS_NOT_VALID, DataCategory.getByFolder(request.getType())); VitamRequestBuilder requestbuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(request.getType()) + "/" + request.getGuid()) .withHeader(GlobalDataRest.X_TENANT_ID, request.getTenantId()) .withOctetAccept(); Response response = null; try { response = make(requestbuilder); checkStorageException(response); return new StorageGetResult(request.getTenantId(), request.getType(), request.getGuid(), response); } catch (final VitamClientInternalException e) { throw new StorageDriverException(getDriverName(), true, e); } finally { if (response != null && response.getStatus() != Status.OK.getStatusCode()) { consumeAnyEntityAndClose(response); } } }
ConnectionImpl extends AbstractConnection { @Override public StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, request); ParametersChecker.checkParameter(GUID_IS_A_MANDATORY_PARAMETER, request.getGuid()); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, request.getTenantId()); ParametersChecker.checkParameter(FOLDER_IS_A_MANDATORY_PARAMETER, request.getType()); ParametersChecker.checkParameter(FOLDER_IS_NOT_VALID, DataCategory.getByFolder(request.getType())); VitamRequestBuilder requestbuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(request.getType()) + "/" + request.getGuid()) .withHeader(GlobalDataRest.X_TENANT_ID, request.getTenantId()) .withOctetAccept(); Response response = null; try { response = make(requestbuilder); checkStorageException(response); return new StorageGetResult(request.getTenantId(), request.getType(), request.getGuid(), response); } catch (final VitamClientInternalException e) { throw new StorageDriverException(getDriverName(), true, e); } finally { if (response != null && response.getStatus() != Status.OK.getStatusCode()) { consumeAnyEntityAndClose(response); } } } }
ConnectionImpl extends AbstractConnection { @Override public StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, request); ParametersChecker.checkParameter(GUID_IS_A_MANDATORY_PARAMETER, request.getGuid()); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, request.getTenantId()); ParametersChecker.checkParameter(FOLDER_IS_A_MANDATORY_PARAMETER, request.getType()); ParametersChecker.checkParameter(FOLDER_IS_NOT_VALID, DataCategory.getByFolder(request.getType())); VitamRequestBuilder requestbuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(request.getType()) + "/" + request.getGuid()) .withHeader(GlobalDataRest.X_TENANT_ID, request.getTenantId()) .withOctetAccept(); Response response = null; try { response = make(requestbuilder); checkStorageException(response); return new StorageGetResult(request.getTenantId(), request.getType(), request.getGuid(), response); } catch (final VitamClientInternalException e) { throw new StorageDriverException(getDriverName(), true, e); } finally { if (response != null && response.getStatus() != Status.OK.getStatusCode()) { consumeAnyEntityAndClose(response); } } } ConnectionImpl(String driverName, VitamClientFactoryInterface<? extends AbstractConnection> factory); }
ConnectionImpl extends AbstractConnection { @Override public StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, request); ParametersChecker.checkParameter(GUID_IS_A_MANDATORY_PARAMETER, request.getGuid()); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, request.getTenantId()); ParametersChecker.checkParameter(FOLDER_IS_A_MANDATORY_PARAMETER, request.getType()); ParametersChecker.checkParameter(FOLDER_IS_NOT_VALID, DataCategory.getByFolder(request.getType())); VitamRequestBuilder requestbuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(request.getType()) + "/" + request.getGuid()) .withHeader(GlobalDataRest.X_TENANT_ID, request.getTenantId()) .withOctetAccept(); Response response = null; try { response = make(requestbuilder); checkStorageException(response); return new StorageGetResult(request.getTenantId(), request.getType(), request.getGuid(), response); } catch (final VitamClientInternalException e) { throw new StorageDriverException(getDriverName(), true, e); } finally { if (response != null && response.getStatus() != Status.OK.getStatusCode()) { consumeAnyEntityAndClose(response); } } } 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 StorageGetResult getObject(StorageObjectRequest request) throws StorageDriverException { ParametersChecker.checkParameter(REQUEST_IS_A_MANDATORY_PARAMETER, request); ParametersChecker.checkParameter(GUID_IS_A_MANDATORY_PARAMETER, request.getGuid()); ParametersChecker.checkParameter(TENANT_IS_A_MANDATORY_PARAMETER, request.getTenantId()); ParametersChecker.checkParameter(FOLDER_IS_A_MANDATORY_PARAMETER, request.getType()); ParametersChecker.checkParameter(FOLDER_IS_NOT_VALID, DataCategory.getByFolder(request.getType())); VitamRequestBuilder requestbuilder = get() .withPath(OBJECTS_PATH + "/" + DataCategory.getByFolder(request.getType()) + "/" + request.getGuid()) .withHeader(GlobalDataRest.X_TENANT_ID, request.getTenantId()) .withOctetAccept(); Response response = null; try { response = make(requestbuilder); checkStorageException(response); return new StorageGetResult(request.getTenantId(), request.getType(), request.getGuid(), response); } catch (final VitamClientInternalException e) { throw new StorageDriverException(getDriverName(), true, e); } finally { if (response != null && response.getStatus() != Status.OK.getStatusCode()) { consumeAnyEntityAndClose(response); } } } 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);  }