Interface Destination
- All Known Subinterfaces:
FileDestination
- All Known Implementing Classes:
DestinationFilter,DestinationFromByteSource,DestinationFromFile,DestinationFromFileCreation,DestinationFromSwitch
public interface Destination
Every destination must be usable as a supplier for input streams.
Concretely, a destination can represent any of the following things:
(a) an anonymous source of input streams
(b) a file that already exists
(c) a file that can be generated on request
(d) a file under generation and will thus exist is the future
(e) a prior filter (for which no output type was yet requested)
In a later version we may consider replacing file with 'store' and 'reference'
i.e. a reference to a store that will hold the data in the future
But then again, this might be too much abstraction - the implication is, that
we would need to specify conversions between different kind of stores:
"ifNeedsSomeSpecificTypeOfStoreAsInput then provide a policy for converting the input data"
Then again, we just require the stores to be file-like, so we never have to deal with specifics
of different store.
- Author:
- raven
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCancel the creation of a destination's byte source.Get a description of the creation status.io.reactivex.rxjava3.core.Single<DestinationFromFile>materialize(Supplier<Path> preferredPathCallback) Materialize the destination to a given file.io.reactivex.rxjava3.core.Single<InputStreamSupplier>This method requests a supplier for inputstreams.transferTo(FilterEngine engine)
-
Method Details
-
prepareStream
io.reactivex.rxjava3.core.Single<InputStreamSupplier> prepareStream()This method requests a supplier for inputstreams. For basic destinations, such as FileDestination, this process does not involve any overhead. However, if the destination represents a workflow, prepareStream may trigger a complex execution. The execution may generate a file from which streams can be obtained, or nothing gets executed at this point, and execution only occur when opening an input stream.- Returns:
-
getCreationStatus
String getCreationStatus()Get a description of the creation status.- Returns:
-
materialize
io.reactivex.rxjava3.core.Single<DestinationFromFile> materialize(Supplier<Path> preferredPathCallback) throws IOException Materialize the destination to a given file. If the destination is already a file it waits until it has been completed. For non-file destinations, the callback is invoked to obtain a preferred file name- Returns:
- Throws:
IOException
-
transferTo
-
cancelCreation
default void cancelCreation()Cancel the creation of a destination's byte source. Propagates upstream unless .wrapWithoutCancel() was called
-