StorageServiceMessage.h
1 
11 #ifndef WRENCH_STORAGESERVICEMESSAGE_H
12 #define WRENCH_STORAGESERVICEMESSAGE_H
13 
14 
15 #include <memory>
16 
17 #include <wrench/services/ServiceMessage.h>
18 #include <wrench/workflow/failure_causes/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 
24 namespace wrench {
25 
26  /***********************/
28  /***********************/
29 
34  protected:
35  StorageServiceMessage(std::string name, double payload);
36  };
37 
38 
43  public:
45 
47  std::string answer_mailbox;
48  };
49 
54  public:
55  StorageServiceFreeSpaceAnswerMessage(std::map<std::string, double> free_space, double payload);
56 
58  std::map<std::string, double> free_space;
59  };
60 
65  public:
67  std::shared_ptr<FileLocation> location, double payload);
68 
70  std::string answer_mailbox;
74  std::shared_ptr<FileLocation> location;
75  };
76 
81  public:
83 
88  };
89 
94  public:
97  std::shared_ptr<FileLocation> location,
98  double payload);
99 
101  std::string answer_mailbox;
105  std::shared_ptr<FileLocation> location;
106  };
107 
112  public:
114  std::shared_ptr<StorageService> storage_service,
115  bool success,
116  std::shared_ptr<FailureCause> failure_cause,
117  double payload);
118 
122  std::shared_ptr<StorageService> storage_service;
124  bool success;
126  std::shared_ptr<FailureCause> failure_cause;
127  };
128 
133  public:
135  std::shared_ptr<FileLocation> src,
136  std::shared_ptr<FileLocation> dst,
137  std::shared_ptr<FileRegistryService> file_registry_service,
138  double payload);
139 
141  std::string answer_mailbox;
145  std::shared_ptr<FileLocation> src;
147  std::shared_ptr<FileLocation> dst;
149  std::shared_ptr<FileRegistryService> file_registry_service;
150  };
151 
156  public:
158  std::shared_ptr<FileLocation> src,
159  std::shared_ptr<FileLocation> dst,
160  std::shared_ptr<FileRegistryService> file_registry_service,
162  bool success, std::shared_ptr<FailureCause> cause,
163  double payload);
164 
168  std::shared_ptr<FileLocation> src;
170  std::shared_ptr<FileLocation> dst;
172  std::shared_ptr<FileRegistryService> file_registry_service;
176  bool success;
178  std::shared_ptr<FailureCause> failure_cause;
179 
180  };
181 
182 
183 
188  public:
191  std::shared_ptr<FileLocation> location,
192  unsigned long buffer_size,
193  double payload);
194 
196  std::string answer_mailbox;
200  std::shared_ptr<FileLocation> location;
202  unsigned long buffer_size;
203  };
204 
209  public:
211  std::shared_ptr<FileLocation> location,
212  bool success,
213  std::shared_ptr<FailureCause> failure_cause,
214  std::string data_write_mailbox_name,
215  double payload);
216 
220  std::shared_ptr<FileLocation> location;
222  bool success;
226  std::shared_ptr<FailureCause> failure_cause;
227  };
228 
233  public:
237  std::shared_ptr<FileLocation> location,
238  unsigned long buffer_size,
239  double payload);
240 
242  std::string answer_mailbox;
248  std::shared_ptr<FileLocation> location;
250  unsigned long buffer_size;
251  };
252 
257  public:
259  std::shared_ptr<FileLocation> location,
260  bool success,
261  std::shared_ptr<FailureCause> failure_cause,
262  double payload);
263 
267  std::shared_ptr<FileLocation> location;
269  bool success;
271  std::shared_ptr<FailureCause> failure_cause;
272  };
273 
278  public:
280  unsigned long chunk_size, bool last_chunk);
281 
286  };
287 
288 
293  public:
295  };
296 
297 
298  /***********************/
300  /***********************/
301 
302 };
303 
304 
305 #endif //WRENCH_STORAGESERVICEMESSAGE_H
std::shared_ptr< FileLocation > location
The location from which to read the file.
Definition: StorageServiceMessage.h:248
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:126
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:168
bool success
Whether the copy was successful.
Definition: StorageServiceMessage.h:176
std::shared_ptr< FileLocation > src
The source location.
Definition: StorageServiceMessage.h:145
WorkflowFile * file
The file that was read.
Definition: StorageServiceMessage.h:265
StorageServiceFileLookupRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::shared_ptr< FileLocation > location, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:78
A message sent by a StorageService in answer to a free space enquiry.
Definition: StorageServiceMessage.h:53
std::string name
The message name.
Definition: SimulationMessage.h:37
A message sent by a StorageService in answer to a file lookup request.
Definition: StorageServiceMessage.h:80
A message sent to a StorageService to write a file.
Definition: StorageServiceMessage.h:187
StorageServiceFileDeleteAnswerMessage(WorkflowFile *file, std::shared_ptr< StorageService > storage_service, bool success, std::shared_ptr< FailureCause > failure_cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:150
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, if any, or nullptr.
Definition: StorageServiceMessage.h:226
StorageServiceMessage(std::string name, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:27
StorageServiceFreeSpaceRequestMessage(std::string answer_mailbox, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:39
std::map< std::string, double > free_space
The amount of free space in bytes for each mount point, in a map.
Definition: StorageServiceMessage.h:58
WorkflowFile * file
The file to delete.
Definition: StorageServiceMessage.h:103
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:70
Top-level class for messages received/sent by a StorageService.
Definition: StorageServiceMessage.h:33
std::shared_ptr< FileRegistryService > file_registry_service
The file registry service to update, or none if nullptr.
Definition: StorageServiceMessage.h:149
A message sent to a StorageService to enquire about its free space.
Definition: StorageServiceMessage.h:42
WorkflowFile * file
The file to lookup.
Definition: StorageServiceMessage.h:72
StorageServiceFileWriteAnswerMessage(WorkflowFile *file, std::shared_ptr< FileLocation > location, bool success, std::shared_ptr< FailureCause > failure_cause, std::string data_write_mailbox_name, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:283
Top-level class for messages received/sent by a Service.
Definition: ServiceMessage.h:27
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr on success.
Definition: StorageServiceMessage.h:271
bool last_chunk
Whether this is the last file chunk.
Definition: StorageServiceMessage.h:285
std::shared_ptr< StorageService > storage_service
The storage service on which the deletion happened (or not)
Definition: StorageServiceMessage.h:122
A message sent by a StorageService in answer to a file read request.
Definition: StorageServiceMessage.h:256
A message sent to a StorageService to copy a file from another StorageService.
Definition: StorageServiceMessage.h:132
std::string mailbox_to_receive_the_file_content
The mailbox to which the file content should be sent.
Definition: StorageServiceMessage.h:244
std::shared_ptr< FailureCause > failure_cause
The cause of the failure, or nullptr if success.
Definition: StorageServiceMessage.h:178
Definition: Alarm.cpp:20
A message sent by a StorageService in answer to a file copy request.
Definition: StorageServiceMessage.h:155
unsigned long buffer_size
The requested buffer size.
Definition: StorageServiceMessage.h:250
StorageServiceFileWriteRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::shared_ptr< FileLocation > location, unsigned long buffer_size, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:253
std::string answer_mailbox
The mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:242
A message sent/received by a StorageService that has a file size as a payload.
Definition: StorageServiceMessage.h:277
unsigned long buffer_size
The buffer size to use.
Definition: StorageServiceMessage.h:202
WorkflowFile * file
The file was was copied, or not.
Definition: StorageServiceMessage.h:166
StorageServiceFreeSpaceAnswerMessage(std::map< std::string, double > free_space, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:56
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:141
A message sent by a StorageService as an ack.
Definition: StorageServiceMessage.h:292
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:170
WorkflowFile * file
The workflow file that should be written.
Definition: StorageServiceMessage.h:218
WorkflowFile * file
The file that was deleted (or not)
Definition: StorageServiceMessage.h:120
double payload
The message size in bytes.
Definition: SimulationMessage.h:39
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:196
StorageServiceFileLookupAnswerMessage(WorkflowFile *file, bool file_is_available, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:101
std::shared_ptr< FileLocation > location
The location at which the file should be written.
Definition: StorageServiceMessage.h:220
bool success
Whether the write operation request was accepted or not.
Definition: StorageServiceMessage.h:222
bool success
Whether the deletion was successful.
Definition: StorageServiceMessage.h:124
A message sent to a StorageService to lookup a file.
Definition: StorageServiceMessage.h:64
A message sent by a StorageService in answer to a file deletion request.
Definition: StorageServiceMessage.h:111
A message sent by a StorageService in answer to a file write request.
Definition: StorageServiceMessage.h:208
StorageServiceFileContentChunkMessage(WorkflowFile *file, unsigned long chunk_size, bool last_chunk)
Constructor.
Definition: StorageServiceMessage.cpp:370
std::shared_ptr< FileLocation > location
The location where the file will be deleted.
Definition: StorageServiceMessage.h:105
StorageServiceFileDeleteRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::shared_ptr< FileLocation > location, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:124
bool file_registry_service_updated
Whether a file registry service has been updated or not.
Definition: StorageServiceMessage.h:174
A message sent to a StorageService to delete a file.
Definition: StorageServiceMessage.h:93
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:101
WorkflowFile * file
The file.
Definition: StorageServiceMessage.h:283
std::shared_ptr< FileLocation > location
The location to write the file to.
Definition: StorageServiceMessage.h:200
WorkflowFile * file
The file to read.
Definition: StorageServiceMessage.h:246
std::shared_ptr< FileLocation > location
The file location (hopefully)
Definition: StorageServiceMessage.h:74
WorkflowFile * file
The file to copy.
Definition: StorageServiceMessage.h:143
std::shared_ptr< FileLocation > location
The location of the file.
Definition: StorageServiceMessage.h:267
A message sent to a StorageService to read a file.
Definition: StorageServiceMessage.h:232
StorageServiceFileCopyAnswerMessage(WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst, std::shared_ptr< FileRegistryService > file_registry_service, bool file_registry_service_updated, bool success, std::shared_ptr< FailureCause > cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:217
StorageServiceFileCopyRequestMessage(std::string answer_mailbox, WorkflowFile *file, std::shared_ptr< FileLocation > src, std::shared_ptr< FileLocation > dst, std::shared_ptr< FileRegistryService > file_registry_service, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:180
A data file used/produced by a WorkflowTask in a Workflow.
Definition: WorkflowFile.h:26
std::shared_ptr< FileRegistryService > file_registry_service
The file registry service that the user had requested be updated, or nullptr if none.
Definition: StorageServiceMessage.h:172
bool file_is_available
Whether the file was found.
Definition: StorageServiceMessage.h:87
StorageServiceFileReadRequestMessage(std::string answer_mailbox, std::string mailbox_to_receive_the_file_content, WorkflowFile *file, std::shared_ptr< FileLocation > location, unsigned long buffer_size, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:316
std::shared_ptr< FileLocation > dst
The destination location.
Definition: StorageServiceMessage.h:147
StorageServiceFileReadAnswerMessage(WorkflowFile *file, std::shared_ptr< FileLocation > location, bool success, std::shared_ptr< FailureCause > failure_cause, double payload)
Constructor.
Definition: StorageServiceMessage.cpp:346
std::string data_write_mailbox_name
The mailbox on which to send the file.
Definition: StorageServiceMessage.h:224
bool success
Whether the read operation was successful or not.
Definition: StorageServiceMessage.h:269
std::string answer_mailbox
Mailbox to which the answer message should be sent.
Definition: StorageServiceMessage.h:47
WorkflowFile * file
The file to write.
Definition: StorageServiceMessage.h:198
WorkflowFile * file
The file that was looked up.
Definition: StorageServiceMessage.h:85