Class FakeStreamHandlerAbstract
java.lang.Object
io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract<AccessorObject,AccessorObject>
io.clonecloudstore.accessor.server.commons.AbstractObjectStreamHandler
io.clonecloudstore.test.accessor.common.FakeStreamHandlerAbstract
-
Field Summary
Fields inherited from class io.clonecloudstore.accessor.server.commons.AbstractObjectStreamHandler
checked, clientId, driverApi, external, filesystemHandler, filter, isListing, serviceFields inherited from class io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract
countDownLatch, exceptionAtomicReference, resultProxy -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckPullAble(AccessorObject object, io.vertx.core.MultiMap headers) The implementation must check using business object that get inputStream request (server sending InputStream as result) is valid according to the businessIn from te Rest API and the headers.protected voidcheckPushAble(AccessorObject object, 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 booleancheckRemotePullable(AccessorObject object, io.vertx.core.MultiMap headers, String clientId) Could be overridden to take into account remote checkprotected AccessorObjectgetAnswerPushInputStream(AccessorObject object, String finalHash, long size) Returns a BusinessOut in case of POST (receiving InputStream on server side).getHeaderError(AccessorObject object, int status) Return headers for error message.protected InputStreamgetPullInputStream(AccessorObject object) Returns the InputStream required for GET (server is sending the InputStream back to the client).protected InputStreamgetRemotePullInputStream(AccessorObject object, String clientId) Could be overridden to use remote accessprotected booleaninternalCheckPullable(AccessorObject object) protected voidInitialize information from Headersprotected abstract booleanisPublic()protected voidMethod to override for post setupprotected voidremoteCreation(AccessorObject objectOut, String clientId) Could be overridden to take into account remote creationMethods inherited from class io.clonecloudstore.accessor.server.commons.AbstractObjectStreamHandler
getHeaderPullInputStream, getHeaderPushInputStream, pullListMethods inherited from class io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract
checkDigestToCompute, checkEndOfPush, clear, doGetInputStream, endPush, getBusinessIn, getCloser, getInputStreamLength, getOpId, getOriginalHash, getRequest, getServerStreamHandlerResponseException, getVertx, isAlreadyCompressed, isExternal, isKeepAlive, isKeepInputStreamCompressed, isResponseCompressed, isUpload, preparePull, pull, sendError, sendError, setKeepInputStreamCompressed, setResponseCompressed, setResultFromRemote, setup, shallCompress, shallDecompress, throwTrappedException, upload
-
Constructor Details
-
FakeStreamHandlerAbstract
protected FakeStreamHandlerAbstract()
-
-
Method Details
-
postSetup
protected void postSetup()Description copied from class:StreamHandlerAbstractMethod to override for post setup- Overrides:
postSetupin classAbstractObjectStreamHandler
-
isPublic
protected abstract boolean isPublic() -
internalInitBeforeAction
protected void internalInitBeforeAction()Initialize information from Headers -
checkPushAble
Description copied from class:StreamHandlerAbstractCheck 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.- Overrides:
checkPushAblein classAbstractObjectStreamHandler
-
remoteCreation
Could be overridden to take into account remote creation -
getAnswerPushInputStream
protected AccessorObject getAnswerPushInputStream(AccessorObject object, String finalHash, long size) Description copied from class:StreamHandlerAbstractReturns 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)- Overrides:
getAnswerPushInputStreamin classAbstractObjectStreamHandler- Parameters:
object- 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)
-
checkRemotePullable
protected boolean checkRemotePullable(AccessorObject object, io.vertx.core.MultiMap headers, String clientId) Could be overridden to take into account remote check -
checkPullAble
Description copied from class:StreamHandlerAbstractThe implementation must check using business object that get inputStream request (server sending InputStream as result) is valid according to the businessIn from te Rest API and the headers. (example: ObjectStorage check of existence of object)- Specified by:
checkPullAblein classStreamHandlerAbstract<AccessorObject,AccessorObject> - Returns:
- True if the read action is valid for this businessIn object and headers
-
internalCheckPullable
-
getRemotePullInputStream
Could be overridden to use remote access -
getPullInputStream
Description copied from class:StreamHandlerAbstractReturns 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:
getPullInputStreamin classStreamHandlerAbstract<AccessorObject,AccessorObject> - Parameters:
object- businessIn as passed in constructor
-
getHeaderError
Description copied from class:StreamHandlerAbstractReturn headers for error message. (example: get headers in case of error as Object name, Bucket name...)- Specified by:
getHeaderErrorin classStreamHandlerAbstract<AccessorObject,AccessorObject>
-