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, service
Fields inherited from class io.clonecloudstore.common.quarkus.server.service.StreamHandlerAbstract
countDownLatch, exceptionAtomicReference, resultProxy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkPullAble
(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 void
checkPushAble
(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 boolean
checkRemotePullable
(AccessorObject object, io.vertx.core.MultiMap headers, String clientId) Could be overridden to take into account remote checkprotected AccessorObject
getAnswerPushInputStream
(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 InputStream
getPullInputStream
(AccessorObject object) Returns the InputStream required for GET (server is sending the InputStream back to the client).protected InputStream
getRemotePullInputStream
(AccessorObject object, String clientId) Could be overridden to use remote accessprotected boolean
internalCheckPullable
(AccessorObject object) protected void
Initialize information from Headersprotected abstract boolean
isPublic()
protected void
Method to override for post setupprotected void
remoteCreation
(AccessorObject objectOut, String clientId) Could be overridden to take into account remote creationMethods inherited from class io.clonecloudstore.accessor.server.commons.AbstractObjectStreamHandler
getHeaderPullInputStream, getHeaderPushInputStream, pullList
Methods 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
-
Method Details
-
postSetup
protected void postSetup()Description copied from class:StreamHandlerAbstract
Method to override for post setup- Overrides:
postSetup
in classAbstractObjectStreamHandler
-
isPublic
protected abstract boolean isPublic() -
internalInitBeforeAction
protected void internalInitBeforeAction()Initialize information from Headers -
checkPushAble
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.- Overrides:
checkPushAble
in 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: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)- Overrides:
getAnswerPushInputStream
in 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:StreamHandlerAbstract
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. (example: ObjectStorage check of existence of object)- Specified by:
checkPullAble
in 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: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<AccessorObject,
AccessorObject> - Parameters:
object
- businessIn as passed in constructor
-
getHeaderError
Description copied from class:StreamHandlerAbstract
Return headers for error message. (example: get headers in case of error as Object name, Bucket name...)- Specified by:
getHeaderError
in classStreamHandlerAbstract<AccessorObject,
AccessorObject>
-