FileTransferThreadMessage.h
1 
11 #ifndef WRENCH_FILETRANSFERTHREADMESSAGE_H
12 #define WRENCH_FILETRANSFERTHREADMESSAGE_H
13 
14 
15 #include <memory>
16 
17 #include <wrench/services/ServiceMessage.h>
18 #include <wrench/workflow/execution_events/FailureCause.h>
19 #include <wrench/services/file_registry/FileRegistryService.h>
20 #include <wrench/simulation/SimulationTimestampTypes.h>
21 #include <wrench/simulation/Simulation.h>
22 #include <wrench/simulation/SimulationOutput.h>
23 #include "wrench/services/storage/storage_helpers/FileTransferThread.h"
24 
25 namespace wrench {
26 
27  /***********************/
29  /***********************/
30 
35  protected:
41  FileTransferThreadMessage(std::string name, double payload) :
42  ServiceMessage("FileTransferThreadMessage::" + name, payload) {}
43  };
44 
45 
50  public:
67  FileTransferThreadNotificationMessage(std::shared_ptr<FileTransferThread> file_transfer_thread,
68  WorkflowFile *file,
69  std::string src_mailbox,
70  std::shared_ptr<FileLocation> src_location,
71  std::string dst_mailbox,
72  std::shared_ptr<FileLocation> dst_location,
73  std::string answer_mailbox_if_read,
74  std::string answer_mailbox_if_write,
75  std::string answer_mailbox_if_copy,
76  bool success, std::shared_ptr<FailureCause> failure_cause,
77  SimulationTimestampFileCopyStart *start_time_stamp) :
78  FileTransferThreadMessage("FileTransferThreadNotificationMessage", 0),
79  file_transfer_thread(file_transfer_thread),
80  file(file),
81  src_mailbox(src_mailbox), src_location(src_location),
82  dst_mailbox(dst_mailbox), dst_location(dst_location),
83  answer_mailbox_if_read(answer_mailbox_if_read),
84  answer_mailbox_if_write(answer_mailbox_if_write),
85  answer_mailbox_if_copy(answer_mailbox_if_copy),
86  success(success),
87  failure_cause(failure_cause), start_time_stamp(start_time_stamp) {}
88 
90  std::shared_ptr<FileTransferThread> file_transfer_thread;
93 
95  std::string src_mailbox;
97  std::shared_ptr<FileLocation> src_location;
98 
100  std::string dst_mailbox;
102  std::shared_ptr<FileLocation> dst_location;
103 
111  bool success;
113  std::shared_ptr<FailureCause> failure_cause;
116  };
117 
118 
119  /***********************/
121  /***********************/
122 
123 };
124 
125 
126 #endif //WRENCH_FILETRANSFERTHREADMESSAGE_H
std::shared_ptr< FailureCause > failure_cause
The failure cause is case of a failure.
Definition: FileTransferThreadMessage.h:113
Top-level class for messages received/sent by a DataCommunicationThread.
Definition: FileTransferThreadMessage.h:34
WorkflowFile * file
File that was being communicated.
Definition: FileTransferThreadMessage.h:92
double payload
The message size in bytes.
Definition: SimulationMessage.h:39
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::string name
The message name.
Definition: SimulationMessage.h:37
std::string answer_mailbox_if_copy
If this was a file copy, the mailbox to which an answer should be send.
Definition: FileTransferThreadMessage.h:109
std::shared_ptr< FileLocation > dst_location
Destination location (or nullptr if source wasn&#39;t a location)
Definition: FileTransferThreadMessage.h:102
A message sent to by a FileTransferThread to report on success/failure of the transfer.
Definition: FileTransferThreadMessage.h:49
SimulationTimestampFileCopyStart * start_time_stamp
A start time stamp.
Definition: FileTransferThreadMessage.h:115
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
FileTransferThreadNotificationMessage(std::shared_ptr< FileTransferThread > file_transfer_thread, WorkflowFile *file, std::string src_mailbox, std::shared_ptr< FileLocation > src_location, std::string dst_mailbox, std::shared_ptr< FileLocation > dst_location, std::string answer_mailbox_if_read, std::string answer_mailbox_if_write, std::string answer_mailbox_if_copy, bool success, std::shared_ptr< FailureCause > failure_cause, SimulationTimestampFileCopyStart *start_time_stamp)
Constructor.
Definition: FileTransferThreadMessage.h:67
std::string src_mailbox
Source mailbox (or "" if source wasn&#39;t a mailbox)
Definition: FileTransferThreadMessage.h:95
A simulation timestamp class for file copy start times.
Definition: SimulationTimestampTypes.h:186
std::string dst_mailbox
Destination mailbox (or "" if destination wasn&#39;t a mailbox)
Definition: FileTransferThreadMessage.h:100
std::string answer_mailbox_if_read
If this was a file read, the mailbox to which an answer should be send.
Definition: FileTransferThreadMessage.h:105
std::shared_ptr< FileTransferThread > file_transfer_thread
File transfer thread that sent this message.
Definition: FileTransferThreadMessage.h:90
FileTransferThreadMessage(std::string name, double payload)
Constructor.
Definition: FileTransferThreadMessage.h:41
std::shared_ptr< FileLocation > src_location
Source location (or nullptr if source wasn&#39;t a location)
Definition: FileTransferThreadMessage.h:97
bool success
Whether the transfer succeeded or not.
Definition: FileTransferThreadMessage.h:111
Definition: Alarm.cpp:19
std::string answer_mailbox_if_write
If this was a file write, the mailbox to which an answer should be send.
Definition: FileTransferThreadMessage.h:107