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 TypeMethodDescriptionjavax.ws.rs.core.Response
bulkGetObjects
(String containerName, List<String> objectURIs) void
Check the status from the servicevoid
checkStatus
(javax.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 certificatevoid
close()
Close the underneath http clientvoid
compress
(String containerName, CompressInformation compressInformation) computeObjectDigest
(String containerName, String objectName, DigestType algo) final void
consumeAnyEntityAndClose
(javax.ws.rs.core.Response response) Helper when an error occurs on client usage side to consume response howevervoid
createContainer
(String containerName) void
createFolder
(String containerName, String folderName) void
deleteContainer
(String containerName, boolean deleteRecursive) void
deleteFolder
(String containerName, String folderName) void
deleteObject
(String containerName, String objectName) javax.ws.rs.client.Client
javax.ws.rs.client.Client
getFilesWithParamsFromFolder
(String containerName, String folderName) com.fasterxml.jackson.databind.JsonNode
getListUriDigitalObjectFromFolder
(String containerName, String folderName) javax.ws.rs.core.Response
javax.ws.rs.core.Response
Get the resource path of the server.Get the service URLboolean
isExistingContainer
(String containerName) boolean
isExistingFolder
(String containerName, String folderName) boolean
isExistingObject
(String containerName, String objectName) javax.ws.rs.core.Response
make
(VitamRequestBuilder request) javax.ws.rs.core.Response
makeSpecifyingUrl
(VitamRequestBuilder request) void
purgeOldFilesInContainer
(String containerName, TimeToLive timeToLive) void
putAtomicObject
(String containerName, String objectName, InputStream stream, long size) void
putObject
(String containerName, String objectName, InputStream stream) void
static void
staticConsumeAnyEntityAndClose
(javax.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.toString()
void
uncompressObject
(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 javax.ws.rs.core.Response getObject(String containerName, String objectName) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
getObject
public javax.ws.rs.core.Response getObject(String containerName, String objectName, long offset, Long maxChunkSize) throws ContentAddressableStorageNotFoundException, ContentAddressableStorageServerException -
bulkGetObjects
public javax.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<List<URI>> getListUriDigitalObjectFromFolder(String containerName, String folderName) throws ContentAddressableStorageServerException -
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 -
purgeOldFilesInContainer
public void purgeOldFilesInContainer(String containerName, TimeToLive timeToLive) throws ContentAddressableStorageServerException -
staticConsumeAnyEntityAndClose
public static void staticConsumeAnyEntityAndClose(javax.ws.rs.core.Response response) This method consume everything (in particular InputStream) and close the response.- Parameters:
response
-
-
consumeAnyEntityAndClose
public final void consumeAnyEntityAndClose(javax.ws.rs.core.Response response) Description copied from interface:MockOrRestClient
Helper when an error occurs on client usage side to consume response however- Specified by:
consumeAnyEntityAndClose
in interfaceMockOrRestClient
-
checkStatus
Description copied from interface:MockOrRestClient
Check the status from the service- Specified by:
checkStatus
in interfaceMockOrRestClient
- Throws:
VitamApplicationServerException
- if the Server is unavailable
-
checkStatus
public void checkStatus(javax.ws.rs.core.MultivaluedHashMap<String, Object> headers) throws VitamApplicationServerExceptionDescription copied from interface:MockOrRestClient
Check the status from the service used to passe "X-SSL-CLIENT-CERT" header that contain a pem certificate- Specified by:
checkStatus
in interfaceMockOrRestClient
- Throws:
VitamApplicationServerException
- if the Server is unavailable
-
getResourcePath
Description copied from interface:MockOrRestClient
Get the resource path of the server.- Specified by:
getResourcePath
in interfaceMockOrRestClient
- Returns:
- the resource path as string
-
getServiceUrl
Description copied from interface:MockOrRestClient
Get the service URL- Specified by:
getServiceUrl
in interfaceMockOrRestClient
- Returns:
- the service URL
-
close
public void close()Description copied from interface:MockOrRestClient
Close the underneath http client- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceMockOrRestClient
- Specified by:
close
in interfaceVitamAutoCloseable
-
toString
-
makeSpecifyingUrl
public javax.ws.rs.core.Response makeSpecifyingUrl(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
VitamClientInternalException
-
make
public javax.ws.rs.core.Response make(VitamRequestBuilder request) throws VitamClientInternalException - Throws:
VitamClientInternalException
-
getClientFactory
-
getClient
public javax.ws.rs.client.Client getClient() -
getChunkedClient
public javax.ws.rs.client.Client getChunkedClient()
-