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.ResponsebulkGetObjects(String containerName, List<String> objectURIs) voidCheck the status from the servicevoidcheckStatus(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 certificatevoidclose()Close the underneath http clientvoidcompress(String containerName, CompressInformation compressInformation) computeObjectDigest(String containerName, String objectName, DigestType algo) final voidconsumeAnyEntityAndClose(javax.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) javax.ws.rs.client.Clientjavax.ws.rs.client.ClientgetFilesWithParamsFromFolder(String containerName, String folderName) com.fasterxml.jackson.databind.JsonNodegetListUriDigitalObjectFromFolder(String containerName, String folderName) javax.ws.rs.core.Responsejavax.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) javax.ws.rs.core.Responsemake(VitamRequestBuilder request) javax.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(javax.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 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:MockOrRestClientHelper when an error occurs on client usage side to consume response however- Specified by:
consumeAnyEntityAndClosein interfaceMockOrRestClient
-
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(javax.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- 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 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()
-