Class AccessorObjectApiClient
java.lang.Object
io.clonecloudstore.common.quarkus.client.SimpleClientAbstract<AccessorObjectApi>
io.clonecloudstore.common.quarkus.client.ClientAbstract<AccessorObject,AccessorObject,AccessorObjectApi>
io.clonecloudstore.accessor.client.AccessorObjectApiClient
- All Implemented Interfaces:
Closeable,AutoCloseable
public class AccessorObjectApiClient
extends ClientAbstract<AccessorObject,AccessorObject,AccessorObjectApi>
Client for Accessor Object
-
Field Summary
Fields inherited from class io.clonecloudstore.common.quarkus.client.ClientAbstract
CONTEXT_RECEIVE, CONTEXT_SENDINGFields inherited from class io.clonecloudstore.common.quarkus.client.SimpleClientAbstract
exceptionMapper, MDC_COMPRESSED_CONTENT, MDC_COMPRESSED_RESPONSE, MDC_QUERY_HEADERS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor used by the Factory -
Method Summary
Modifier and TypeMethodDescriptioncheckObjectOrDirectory(String bucketName, String pathDirectoryOrObject, String clientId) Check if object or directory existcreateObject(AccessorObject accessorObject, String clientId, InputStream body) createObject(AccessorObject accessorObject, String clientId, InputStream body, boolean compressed) booleandeleteObject(String bucketName, String objectName, String clientId) protected AccessorObjectgetApiBusinessOutFromResponseForCreate(jakarta.ws.rs.core.Response response) getHeadersFor(AccessorObject businessIn, int context) Note: Compression is only between client and server, result InputStream is uncompressedgetObjectInfo(String bucketName, String objectName, String clientId) listObjects(String bucketName, String clientId, AccessorFilter filter) Returns an Iterator containing AccessorObjectsMethods inherited from class io.clonecloudstore.common.quarkus.client.ClientAbstract
getFactory, getInputStreamBusinessOutFromUni, getResultFromPostInputStreamUni, prepareInputStreamToReceive, prepareInputStreamToSendMethods inherited from class io.clonecloudstore.common.quarkus.client.SimpleClientAbstract
acceptCompression, bodyCompressed, close, getCompressionStatusFromHeaders, getDtoFromHeaders, getHeadersMap, getMdcOpId, getOpId, getService, getUri, isAcceptCompression, isBodyCompressed, reopen, resetMdcOpId, resetQueryContext, setCompressionStatusFromHeaders, setDtoFromHeaders, setHeadersMap, setMdcOpId, setOpId
-
Constructor Details
-
AccessorObjectApiClient
Constructor used by the Factory
-
-
Method Details
-
checkObjectOrDirectory
public StorageType checkObjectOrDirectory(String bucketName, String pathDirectoryOrObject, String clientId) throws CcsWithStatusException Check if object or directory exist- Parameters:
pathDirectoryOrObject- may contain only directory, not full path (as prefix)- Returns:
- the associated StorageType
- Throws:
CcsWithStatusException
-
getObjectInfo
public AccessorObject getObjectInfo(String bucketName, String objectName, String clientId) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
getObject
public InputStreamBusinessOut<AccessorObject> getObject(String bucketName, String objectName, String clientId) throws CcsWithStatusException - Returns:
- both InputStream and Object DTO
- Throws:
CcsWithStatusException
-
getObject
public InputStreamBusinessOut<AccessorObject> getObject(String bucketName, String objectName, String clientId, boolean compressed) throws CcsWithStatusException Note: Compression is only between client and server, result InputStream is uncompressed- Returns:
- both InputStream and Object DTO
- Throws:
CcsWithStatusException
-
listObjects
public Iterator<AccessorObject> listObjects(String bucketName, String clientId, AccessorFilter filter) throws CcsWithStatusException Returns an Iterator containing AccessorObjects- Throws:
CcsWithStatusException
-
createObject
public AccessorObject createObject(AccessorObject accessorObject, String clientId, InputStream body) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
createObject
public AccessorObject createObject(AccessorObject accessorObject, String clientId, InputStream body, boolean compressed) throws CcsWithStatusException - Returns:
- the associated DTO
- Throws:
CcsWithStatusException
-
deleteObject
public boolean deleteObject(String bucketName, String objectName, String clientId) throws CcsWithStatusException - Returns:
- True if deleted (or already deleted), else False or an exception
- Throws:
CcsWithStatusException
-
getApiBusinessOutFromResponseForCreate
protected AccessorObject getApiBusinessOutFromResponseForCreate(jakarta.ws.rs.core.Response response) - Specified by:
getApiBusinessOutFromResponseForCreatein classClientAbstract<AccessorObject,AccessorObject, AccessorObjectApi> - Returns:
- the BusinessOut from the response content and/or headers for Create Operation
-
getHeadersFor
- Specified by:
getHeadersForin classClientAbstract<AccessorObject,AccessorObject, AccessorObjectApi> - Parameters:
context- 1 for sending InputStream, -1 for receiving InputStream, or anything else- Returns:
- the headers map
-