Class FakeStreamHandlerAbstract<I,O>
java.lang.Object
io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract<I,O>
io.clonecloudstore.test.server.service.FakeStreamHandlerAbstract<I,O>
-
Field Summary
Fields inherited from class io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract
countDownLatch, exceptionAtomicReference, resultProxy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkPushAble
(I apiBusinessIn, MultipleActionsInputStream inputStream) Check if the request for POST is valid, and if so, adapt the given MultipleActionsInputStream that will be used to consume the original InputStream.protected O
getAnswerPushInputStream
(I apiBusinessIn, String finalHash, long size) Returns a BusinessOut in case of POST (receiving InputStream on server side).protected abstract O
getBusinessOutForPushAnswer
(I apiBusinessIn, String finalHash, long size) protected abstract long
getLengthFromBusinessIn
(I businessIn) protected InputStream
getPullInputStream
(I apiBusinessIn) Returns the InputStream required for GET (server is sending the InputStream back to the client).Methods inherited from class io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract
checkDigestToCompute, checkEndOfPush, checkPullAble, clear, doGetInputStream, endPush, getBusinessIn, getCloser, getHeaderError, getHeaderPullInputStream, getHeaderPushInputStream, getInputStreamLength, getOpId, getOriginalHash, getRequest, getServerStreamHandlerResponseException, getVertx, isAlreadyCompressed, isExternal, isKeepAlive, isKeepInputStreamCompressed, isResponseCompressed, isUpload, postSetup, preparePull, pull, pullList, sendError, sendError, setKeepInputStreamCompressed, setResponseCompressed, setResultFromRemote, setup, shallCompress, shallDecompress, throwTrappedException, upload
-
Constructor Details
-
FakeStreamHandlerAbstract
public FakeStreamHandlerAbstract()
-
-
Method Details
-
checkPushAble
protected void checkPushAble(I apiBusinessIn, MultipleActionsInputStream inputStream) throws CcsClientGenericException, CcsServerGenericException Description copied from class:StreamHandlerAbstract
Check if the request for POST is valid, and if so, adapt the given MultipleActionsInputStream that will be used to consume the original InputStream. The implementation shall use the business logic to check the validity for this InputStream reception (from client to server) and, if valid, use the MultipleActionsInputStream, either as is or as a standard InputStream. (example: check through Object Storage that object does not exist yet, and if so add the consumption of the stream for the Object Storage object creation). Note that the stream might be kept compressed if keepInputStreamCompressed was specified at construction.- Specified by:
checkPushAble
in classStreamHandlerAbstract<I,
O> - Throws:
CcsClientGenericException
CcsServerGenericException
-
getBusinessOutForPushAnswer
-
getAnswerPushInputStream
protected O getAnswerPushInputStream(I apiBusinessIn, String finalHash, long size) throws CcsClientGenericException, CcsServerGenericException Description copied from class:StreamHandlerAbstract
Returns a BusinessOut in case of POST (receiving InputStream on server side). The implementation shall use the business logic to get the right BusinessOut object to return. (example: getting the StorageObject object, including the computed or given Hash)- Specified by:
getAnswerPushInputStream
in classStreamHandlerAbstract<I,
O> - Parameters:
apiBusinessIn
- businessIn as passed in constructorfinalHash
- the final Hash if computed on the fly, or the original given onesize
- the real size read (from received stream, could be compressed size if decompression is off at construction)- Throws:
CcsClientGenericException
CcsServerGenericException
-
getLengthFromBusinessIn
-
getPullInputStream
protected InputStream getPullInputStream(I apiBusinessIn) throws CcsClientGenericException, CcsServerGenericException Description copied from class:StreamHandlerAbstract
Returns the InputStream required for GET (server is sending the InputStream back to the client). The implementation shall use the business logic and controls to get the InputStream to return. (example: getting the Object Storage object stream)- Specified by:
getPullInputStream
in classStreamHandlerAbstract<I,
O> - Parameters:
apiBusinessIn
- businessIn as passed in constructor- Throws:
CcsClientGenericException
CcsServerGenericException
-