Package fr.gouv.vitam.workspace.client
Class WorkspaceClient
java.lang.Object
fr.gouv.vitam.common.client.DefaultClient
fr.gouv.vitam.workspace.client.WorkspaceClient
- All Implemented Interfaces:
BasicClient,MockOrRestClient,VitamAutoCloseable,AutoCloseable
-
Field Summary
Fields inherited from interface fr.gouv.vitam.common.client.BasicClient
STATUS_URL -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsebulkGetObjects(String containerName, List<String> objectURIs) voidbulkMove(String containerName, BulkMoveRequest bulkMoveRequest) Moves multiple objects from source paths to destination paths within the same containervoidCheck the status from the servicevoidcheckStatus(jakarta.ws.rs.core.MultivaluedHashMap<String, Object> headers) Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificatevoidclose()Close the underneath http clientvoidcompress(String containerName, CompressInformation compressInformation) computeObjectDigest(String containerName, String objectName, DigestType algo) final voidconsumeAnyEntityAndClose(jakarta.ws.rs.core.Response response) Helper when an error occurs on client usage side to consume response howevervoidcreateContainer(String containerName) voidcreateFolder(String containerName, String folderName) voiddeleteContainer(String containerName, boolean deleteRecursive) voiddeleteFolder(String containerName, String folderName) voiddeleteObject(String containerName, String objectName) jakarta.ws.rs.client.Clientjakarta.ws.rs.client.ClientgetFilesWithParamsFromFolder(String containerName, String folderName) com.fasterxml.jackson.databind.JsonNodegetListUriDigitalObjectFromFolder(String containerName, String folderName) getListUriDigitalObjectFromFolder(String containerName, String folderName, int limit) Get list of URI digital object from folder with result set limitjakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponseGet the resource path of the server.Get the service URLbooleanisExistingContainer(String containerName) booleanisExistingFolder(String containerName, String folderName) booleanisExistingObject(String containerName, String objectName) jakarta.ws.rs.core.Responsemake(VitamRequestBuilder request) jakarta.ws.rs.core.ResponsemakeSpecifyingUrl(VitamRequestBuilder request) voidpurgeOldFilesInContainer(String containerName, TimeToLive timeToLive) voidputAtomicObject(String containerName, String objectName, InputStream stream, long size) voidputObject(String containerName, String objectName, InputStream stream) voidstatic voidstaticConsumeAnyEntityAndClose(jakarta.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.toString()voiduncompressObject(String containerName, String folderName, String archiveType, InputStream inputStreamObject)
-
Method Details
-
getFreespacePercent
- Throws:
VitamClientException
-
createContainer
-
deleteContainer
public void deleteContainer(String containerName, boolean deleteRecursive) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
isExistingContainer
public boolean isExistingContainer(String containerName) throws ContentAddressableStorageServerException -
createFolder
public void createFolder(String containerName, String folderName) throws ContentAddressableStorageAlreadyExistException, ContentAddressableStorageServerException -
deleteFolder
public void deleteFolder(String containerName, String folderName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
isExistingFolder
public boolean isExistingFolder(String containerName, String folderName) throws ContentAddressableStorageServerException -
putObject
public void putObject(String containerName, String objectName, InputStream stream) throws ContentAddressableStorageServerException -
putObject
public void putObject(String containerName, String objectName, Object object) throws ContentAddressableStorageServerException -
putAtomicObject
public void putAtomicObject(String containerName, String objectName, InputStream stream, long size) throws ContentAddressableStorageServerException -
getObject
public jakarta.ws.rs.core.Response getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
getObject
public jakarta.ws.rs.core.Response getObject(String containerName, String objectName, long offset, Long maxChunkSize) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
bulkGetObjects
public jakarta.ws.rs.core.Response bulkGetObjects(String containerName, List<String> objectURIs) throws ContentAddressableStorageServerException, ContentAddressableStorageNotFoundException -
deleteObject
public void deleteObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
isExistingObject
public boolean isExistingObject(String containerName, String objectName) throws ContentAddressableStorageServerException -
getListUriDigitalObjectFromFolder
public RequestResponse<URI> getListUriDigitalObjectFromFolder(String containerName, String folderName) throws ContentAddressableStorageServerException -
getListUriDigitalObjectFromFolder
public RequestResponse<URI> getListUriDigitalObjectFromFolder(String containerName, String folderName, int limit) throws ContentAddressableStorageServerException Get list of URI digital object from folder with result set limit- Parameters:
containerName- container namefolderName- folder namelimit- the maximum number of URIs to return in one batch- Returns:
- RequestResponse containing list of URI
- Throws:
ContentAddressableStorageServerException- if error occurs
-
getFilesWithParamsFromFolder
public RequestResponse<Map<String,FileParams>> getFilesWithParamsFromFolder(String containerName, String folderName) throws ContentAddressableStorageServerException -
compress
public void compress(String containerName, CompressInformation compressInformation) throws ContentAddressableStorageServerException -
uncompressObject
public void uncompressObject(String containerName, String folderName, String archiveType, InputStream inputStreamObject) throws ContentAddressableStorageException -
computeObjectDigest
public String computeObjectDigest(String containerName, String objectName, DigestType algo) throws ContentAddressableStorageException -
bulkMove
public void bulkMove(String containerName, BulkMoveRequest bulkMoveRequest) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException Moves multiple objects from source paths to destination paths within the same container- Parameters:
containerName- container where the objects residebulkMoveRequest- list of source/destination paths relative to the container- Throws:
ContentAddressableStorageNotFoundException- Thrown when the container or any source object cannot be locatedContentAddressableStorageServerException- Thrown when move action failed due to some other failure
-
purgeOldFilesInContainer
public void purgeOldFilesInContainer(String containerName, TimeToLive timeToLive) throws ContentAddressableStorageServerException -
staticConsumeAnyEntityAndClose
public static void staticConsumeAnyEntityAndClose(jakarta.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.- Parameters:
response-
-
consumeAnyEntityAndClose
public final void consumeAnyEntityAndClose(jakarta.ws.rs.core.Response response) Description copied from interface:MockOrRestClientHelper when an error occurs on client usage side to consume response however- Specified by:
consumeAnyEntityAndClosein interfaceMockOrRestClient- Parameters:
response-
-
checkStatus
Description copied from interface:MockOrRestClientCheck the status from the service- Specified by:
checkStatusin interfaceMockOrRestClient- Throws:
VitamApplicationServerException- if the Server is unavailable
-
checkStatus
public void checkStatus(jakarta.ws.rs.core.MultivaluedHashMap<String, Object> headers) throws VitamApplicationServerExceptionDescription copied from interface:MockOrRestClientCheck the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate- Specified by:
checkStatusin interfaceMockOrRestClient- Parameters:
headers-- Throws:
VitamApplicationServerException- if the Server is unavailable
-
getResourcePath
Description copied from interface:MockOrRestClientGet the resource path of the server.- Specified by:
getResourcePathin interfaceMockOrRestClient- Returns:
- the resource path as string
-
getServiceUrl
Description copied from interface:MockOrRestClientGet the service URL- Specified by:
getServiceUrlin interfaceMockOrRestClient- Returns:
- the service URL
-
close
public void close()Description copied from interface:MockOrRestClientClose the underneath http client- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceMockOrRestClient- Specified by:
closein interfaceVitamAutoCloseable
-
toString
-
makeSpecifyingUrl
public jakarta.ws.rs.core.Response makeSpecifyingUrl(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
VitamClientInternalException
-
make
public jakarta.ws.rs.core.Response make(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
VitamClientInternalException
-
getClientFactory
-
getClient
public jakarta.ws.rs.client.Client getClient() -
getChunkedClient
public jakarta.ws.rs.client.Client getChunkedClient()
-