WRENCH  1.10
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
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 
33  class StorageServiceMessage : public ServiceMessage {
34  protected:
35  StorageServiceMessage(std::string name, double payload);
36  };
37 
38 
42  class StorageServiceFreeSpaceRequestMessage : public StorageServiceMessage {
43  public:
44  StorageServiceFreeSpaceRequestMessage(std::string answer_mailbox, double payload);
45 
47  std::string answer_mailbox;
48  };
49 
53  class StorageServiceFreeSpaceAnswerMessage : public StorageServiceMessage {
54  public:
55  StorageServiceFreeSpaceAnswerMessage(std::map<std::string, double> free_space, double payload);
56 
58  std::map<std::string, double> free_space;
59  };
60 
64  class StorageServiceFileLookupRequestMessage : public StorageServiceMessage {
65  public:
66  StorageServiceFileLookupRequestMessage(std::string answer_mailbox, WorkflowFile *file,
67  std::shared_ptr<FileLocation> location, double payload);
68 
70  std::string answer_mailbox;
72  WorkflowFile *file;
74  std::shared_ptr<FileLocation> location;
75  };
76 
80  class StorageServiceFileLookupAnswerMessage : public StorageServiceMessage {
81  public:
82  StorageServiceFileLookupAnswerMessage(WorkflowFile *file, bool file_is_available, double payload);
83 
85  WorkflowFile *file;
87  bool file_is_available;
88  };
89 
93  class StorageServiceFileDeleteRequestMessage : public StorageServiceMessage {
94  public:
95  StorageServiceFileDeleteRequestMessage(std::string answer_mailbox,
96  WorkflowFile *file,
97  std::shared_ptr<FileLocation> location,
98  double payload);
99 
101  std::string answer_mailbox;
103  WorkflowFile *file;
105  std::shared_ptr<FileLocation> location;
106  };
107 
111  class StorageServiceFileDeleteAnswerMessage : public StorageServiceMessage {
112  public:
113  StorageServiceFileDeleteAnswerMessage(WorkflowFile *file,
114  std::shared_ptr<StorageService> storage_service,
115  bool success,
116  std::shared_ptr<FailureCause> failure_cause,
117  double payload);
118 
120  WorkflowFile *file;
122  std::shared_ptr<StorageService> storage_service;
124  bool success;
126  std::shared_ptr<FailureCause> failure_cause;
127  };
128 
132  class StorageServiceFileCopyRequestMessage : public StorageServiceMessage {
133  public:
134  StorageServiceFileCopyRequestMessage(std::string answer_mailbox, WorkflowFile *file,
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;
143  WorkflowFile *file;
145  std::shared_ptr<FileLocation> src;
147  std::shared_ptr<FileLocation> dst;
149  std::shared_ptr<FileRegistryService> file_registry_service;
150  };
151 
155  class StorageServiceFileCopyAnswerMessage : public StorageServiceMessage {
156  public:
157  StorageServiceFileCopyAnswerMessage(WorkflowFile *file,
158  std::shared_ptr<FileLocation> src,
159  std::shared_ptr<FileLocation> dst,
160  std::shared_ptr<FileRegistryService> file_registry_service,
161  bool file_registry_service_updated,
162  bool success, std::shared_ptr<FailureCause> cause,
163  double payload);
164 
166  WorkflowFile *file;
168  std::shared_ptr<FileLocation> src;
170  std::shared_ptr<FileLocation> dst;
172  std::shared_ptr<FileRegistryService> file_registry_service;
174  bool file_registry_service_updated;
176  bool success;
178  std::shared_ptr<FailureCause> failure_cause;
179 
180  };
181 
182 
183 
187  class StorageServiceFileWriteRequestMessage : public StorageServiceMessage {
188  public:
189  StorageServiceFileWriteRequestMessage(std::string answer_mailbox,
190  WorkflowFile *file,
191  std::shared_ptr<FileLocation> location,
192  unsigned long buffer_size,
193  double payload);
194 
196  std::string answer_mailbox;
198  WorkflowFile *file;
200  std::shared_ptr<FileLocation> location;
202  unsigned long buffer_size;
203  };
204 
208  class StorageServiceFileWriteAnswerMessage : public StorageServiceMessage {
209  public:
210  StorageServiceFileWriteAnswerMessage(WorkflowFile *file,
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 
218  WorkflowFile *file;
220  std::shared_ptr<FileLocation> location;
222  bool success;
224  std::string data_write_mailbox_name;
226  std::shared_ptr<FailureCause> failure_cause;
227  };
228 
232  class StorageServiceFileReadRequestMessage : public StorageServiceMessage {
233  public:
234  StorageServiceFileReadRequestMessage(std::string answer_mailbox,
235  std::string mailbox_to_receive_the_file_content,
236  WorkflowFile *file,
237  std::shared_ptr<FileLocation> location,
238  unsigned long buffer_size,
239  double payload);
240 
242  std::string answer_mailbox;
244  std::string mailbox_to_receive_the_file_content;
246  WorkflowFile *file;
248  std::shared_ptr<FileLocation> location;
250  unsigned long buffer_size;
251  };
252 
256  class StorageServiceFileReadAnswerMessage : public StorageServiceMessage {
257  public:
258  StorageServiceFileReadAnswerMessage(WorkflowFile *file,
259  std::shared_ptr<FileLocation> location,
260  bool success,
261  std::shared_ptr<FailureCause> failure_cause,
262  double payload);
263 
265  WorkflowFile *file;
267  std::shared_ptr<FileLocation> location;
269  bool success;
271  std::shared_ptr<FailureCause> failure_cause;
272  };
273 
277  class StorageServiceFileContentChunkMessage : public StorageServiceMessage {
278  public:
279  explicit StorageServiceFileContentChunkMessage(WorkflowFile *file,
280  unsigned long chunk_size, bool last_chunk);
281 
283  WorkflowFile *file;
285  bool last_chunk;
286  };
287 
288 
292  class StorageServiceAckMessage : public StorageServiceMessage {
293  public:
294  StorageServiceAckMessage() : StorageServiceMessage("ACK",0) {}
295  };
296 
297 
298  /***********************/
300  /***********************/
301 
302 };
303 
304 
305 #endif //WRENCH_STORAGESERVICEMESSAGE_H
wrench
Definition: Alarm.cpp:20