Interface ChunkedPacketSender
- All Superinterfaces:
ChunkedPacketProvider
- All Known Implementing Classes:
DefaultFileChunkPacketSender
A sender of chunked data in any form. It is responsible to transfer all data chunks to the target network component
of the transfer.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder for a chunked packet sender, holding all general options. -
Method Summary
Modifier and TypeMethodDescriptionGet a new builder for a packet sender which allows to transfer a single but huge file, e.g.Get the splitter of each packet which is sent through the network.source()Get the source of data to stream and transfer through the network.@NonNull eu.cloudnetservice.common.concurrent.Task<TransferStatus>Transfers the data from the data source to all targets of this sender.Methods inherited from interface eu.cloudnetservice.driver.network.chunk.ChunkedPacketProvider
sessionInformation, transferStatus
-
Method Details
-
forFileTransfer
Get a new builder for a packet sender which allows to transfer a single but huge file, e.g. a zip folder in chunks through the network.- Returns:
- a builder for file based chunked packet transfer.
-
source
Get the source of data to stream and transfer through the network. The stream gets closed automatically when the transfer succeeded.- Returns:
- the source of data to stream and transfer.
-
packetSplitter
Get the splitter of each packet which is sent through the network. The splitter is responsible to send the packet to the network component(s) which this sender is targeting. It's for example used to allow transfer of a single chunk packet to multiple network components by multiplying it.- Returns:
- the packet splitter.
-
transferChunkedData
Transfers the data from the data source to all targets of this sender. The returned future is completed when:- The transfer completed successfully.
- The transfer failed for any reason. The returned task will be completed holding the reason exception.
- Returns:
- a future completed when the transfer finishes.
-