10 #ifndef WRENCH_FILETRANSFERTHREAD_H
11 #define WRENCH_FILETRANSFERTHREAD_H
14 #include <wrench/simgrid_S4U_util/S4U_Daemon.h>
15 #include <wrench/services/Service.h>
16 #include <wrench/services/storage/StorageService.h>
21 class SimulationTimestampFileCopyStart;
37 std::shared_ptr<StorageService> parent,
39 std::string src_mailbox,
40 std::shared_ptr<FileLocation> dst_location,
41 std::string answer_mailbox_if_read,
42 std::string answer_mailbox_if_write,
43 std::string answer_mailbox_if_copy,
44 unsigned long buffer_size);
47 std::shared_ptr<StorageService> parent,
49 std::shared_ptr<FileLocation> src_location,
50 std::string dst_mailbox,
51 std::string answer_mailbox_if_read,
52 std::string answer_mailbox_if_write,
53 std::string answer_mailbox_if_copy,
54 unsigned long buffer_size);
57 std::shared_ptr<StorageService> parent,
59 std::shared_ptr<FileLocation> src_location,
60 std::shared_ptr<FileLocation> dsg_location,
61 std::string answer_mailbox_if_read,
62 std::string answer_mailbox_if_write,
63 std::string answer_mailbox_if_copy,
64 unsigned long buffer_size);
67 void cleanup(
bool has_returned_from_main,
int return_value)
override;
72 std::shared_ptr<StorageService> parent;
76 std::string src_mailbox;
77 std::shared_ptr<FileLocation> src_location;
80 std::string dst_mailbox;
81 std::shared_ptr<FileLocation> dst_location;
83 std::string answer_mailbox_if_read;
84 std::string answer_mailbox_if_write;
85 std::string answer_mailbox_if_copy;
86 unsigned long buffer_size;
88 void receiveFileFromNetwork(
WorkflowFile *file, std::string mailbox, std::shared_ptr<FileLocation> location);
89 void sendLocalFileToNetwork(
WorkflowFile *file, std::shared_ptr<FileLocation> location, std::string mailbox);
90 void downloadFileFromStorageService(
WorkflowFile *file, std::shared_ptr<FileLocation> src_location, std::shared_ptr<FileLocation> dst_location);
91 void copyFileLocally(
WorkflowFile *file, std::shared_ptr<FileLocation> src_location, std::shared_ptr<FileLocation> dst_location);
100 #endif //WRENCH_FILETRANSFERTHREAD_H