Kanzi Connect  3.9.8
Kanzi Connect C++ API
kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass > Class Template Reference

Manages file transfers which can be split into one or more portions to avoid sending large files at once. More...

#include <file_transfer_manager.hpp>

Public Member Functions

bool cancelTransfer (const string &uri, shared_ptr< SessionClass > session)
 Cancel transferring a file to specific receiver. More...
 
 FileTransferManager ()
 ctor Usage of the ctor requires setting the WorkQueueInterface later on before using the class More...
 
 FileTransferManager (WorkQueueInterface *workDispatcher)
 Constructor. More...
 
void initiateTransfer (const string &uri, vector< char > &buffer, unsigned int handle, shared_ptr< SessionClass > session, unsigned int blockSize, unsigned int timeout_ms)
 Start transferring the given buffer. More...
 
void progressFileTransfer (const unsigned int handle)
 Send the next chunk from the buffer This should be repeatedly called until the transfer has finished. More...
 
void setWorkDispatcher (WorkQueueInterface *workDispatcher)
 Set the work dispatcher. More...
 
 ~FileTransferManager ()
 dtor More...
 

Detailed Description

template<typename TransferEntryClass, typename SessionClass>
class kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >

Manages file transfers which can be split into one or more portions to avoid sending large files at once.

Template Parameters
TransferEntryClassclass which implements the file transfer logic for a single file to one receiver
SessionClassThe concrete class which implements the actual output

Constructor & Destructor Documentation

◆ FileTransferManager() [1/2]

template<typename TransferEntryClass , typename SessionClass >
kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::FileTransferManager ( )
inline

ctor Usage of the ctor requires setting the WorkQueueInterface later on before using the class

◆ FileTransferManager() [2/2]

template<typename TransferEntryClass , typename SessionClass >
kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::FileTransferManager ( WorkQueueInterface workDispatcher)
inlineexplicit

Constructor.

Parameters
workDispatcherThe instance which manages the execution of work items in asynchronous manner

◆ ~FileTransferManager()

template<typename TransferEntryClass , typename SessionClass >
kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::~FileTransferManager ( )
inline

dtor

Member Function Documentation

◆ cancelTransfer()

template<typename TransferEntryClass , typename SessionClass>
bool kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::cancelTransfer ( const string &  uri,
shared_ptr< SessionClass >  session 
)
inline

Cancel transferring a file to specific receiver.

Parameters
uriIdentifies the file
sessionIdentifies the receiver
Returns
True if there was a match and an entry was canceled

◆ initiateTransfer()

template<typename TransferEntryClass , typename SessionClass>
void kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::initiateTransfer ( const string &  uri,
vector< char > &  buffer,
unsigned int  handle,
shared_ptr< SessionClass >  session,
unsigned int  blockSize,
unsigned int  timeout_ms 
)
inline

Start transferring the given buffer.

Parameters
uriThe identifier of the file network-wide
bufferThe contents to transfer
handleIdentifies the transfer between sender and receiver
sessionImplements the actual output
blockSizeIn what size chunks to transfer the buffer
timeout_msTell the receiver how long to wait for transfer to finish

◆ progressFileTransfer()

template<typename TransferEntryClass , typename SessionClass >
void kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::progressFileTransfer ( const unsigned int  handle)
inline

Send the next chunk from the buffer This should be repeatedly called until the transfer has finished.

Parameters
handleIdentifies the transfer to progress

◆ setWorkDispatcher()

template<typename TransferEntryClass , typename SessionClass >
void kanzi::connect::fileservice::FileTransferManager< TransferEntryClass, SessionClass >::setWorkDispatcher ( WorkQueueInterface workDispatcher)
inline

Set the work dispatcher.

Parameters
workDispatcherThe instance which manages the execution of work items in asynchronous manner

The documentation for this class was generated from the following file: