11 #ifndef WRENCH_STORAGESERVICEMESSAGE_H
12 #define WRENCH_STORAGESERVICEMESSAGE_H
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>
33 class StorageServiceMessage :
public ServiceMessage {
35 StorageServiceMessage(std::string name,
double payload);
42 class StorageServiceFreeSpaceRequestMessage :
public StorageServiceMessage {
44 StorageServiceFreeSpaceRequestMessage(std::string answer_mailbox,
double payload);
47 std::string answer_mailbox;
53 class StorageServiceFreeSpaceAnswerMessage :
public StorageServiceMessage {
55 StorageServiceFreeSpaceAnswerMessage(std::map<std::string, double> free_space,
double payload);
58 std::map<std::string, double> free_space;
64 class StorageServiceFileLookupRequestMessage :
public StorageServiceMessage {
66 StorageServiceFileLookupRequestMessage(std::string answer_mailbox, WorkflowFile *file,
67 std::shared_ptr<FileLocation> location,
double payload);
70 std::string answer_mailbox;
74 std::shared_ptr<FileLocation> location;
80 class StorageServiceFileLookupAnswerMessage :
public StorageServiceMessage {
82 StorageServiceFileLookupAnswerMessage(WorkflowFile *file,
bool file_is_available,
double payload);
87 bool file_is_available;
93 class StorageServiceFileDeleteRequestMessage :
public StorageServiceMessage {
95 StorageServiceFileDeleteRequestMessage(std::string answer_mailbox,
97 std::shared_ptr<FileLocation> location,
101 std::string answer_mailbox;
105 std::shared_ptr<FileLocation> location;
111 class StorageServiceFileDeleteAnswerMessage :
public StorageServiceMessage {
113 StorageServiceFileDeleteAnswerMessage(WorkflowFile *file,
114 std::shared_ptr<StorageService> storage_service,
116 std::shared_ptr<FailureCause> failure_cause,
122 std::shared_ptr<StorageService> storage_service;
126 std::shared_ptr<FailureCause> failure_cause;
132 class StorageServiceFileCopyRequestMessage :
public StorageServiceMessage {
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,
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;
155 class StorageServiceFileCopyAnswerMessage :
public StorageServiceMessage {
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,
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;
178 std::shared_ptr<FailureCause> failure_cause;
187 class StorageServiceFileWriteRequestMessage :
public StorageServiceMessage {
189 StorageServiceFileWriteRequestMessage(std::string answer_mailbox,
191 std::shared_ptr<FileLocation> location,
192 unsigned long buffer_size,
196 std::string answer_mailbox;
200 std::shared_ptr<FileLocation> location;
202 unsigned long buffer_size;
208 class StorageServiceFileWriteAnswerMessage :
public StorageServiceMessage {
210 StorageServiceFileWriteAnswerMessage(WorkflowFile *file,
211 std::shared_ptr<FileLocation> location,
213 std::shared_ptr<FailureCause> failure_cause,
214 std::string data_write_mailbox_name,
220 std::shared_ptr<FileLocation> location;
224 std::string data_write_mailbox_name;
226 std::shared_ptr<FailureCause> failure_cause;
232 class StorageServiceFileReadRequestMessage :
public StorageServiceMessage {
234 StorageServiceFileReadRequestMessage(std::string answer_mailbox,
235 std::string mailbox_to_receive_the_file_content,
237 std::shared_ptr<FileLocation> location,
238 unsigned long buffer_size,
242 std::string answer_mailbox;
244 std::string mailbox_to_receive_the_file_content;
248 std::shared_ptr<FileLocation> location;
250 unsigned long buffer_size;
256 class StorageServiceFileReadAnswerMessage :
public StorageServiceMessage {
258 StorageServiceFileReadAnswerMessage(WorkflowFile *file,
259 std::shared_ptr<FileLocation> location,
261 std::shared_ptr<FailureCause> failure_cause,
267 std::shared_ptr<FileLocation> location;
271 std::shared_ptr<FailureCause> failure_cause;
277 class StorageServiceFileContentChunkMessage :
public StorageServiceMessage {
279 explicit StorageServiceFileContentChunkMessage(WorkflowFile *file,
280 unsigned long chunk_size,
bool last_chunk);
292 class StorageServiceAckMessage :
public StorageServiceMessage {
294 StorageServiceAckMessage() : StorageServiceMessage(
"ACK",0) {}
305 #endif //WRENCH_STORAGESERVICEMESSAGE_H