1 // =================================
  2 // Copyright (c) 2021 Seppo Laakko
  3 // Distributed under the MIT license
  4 // =================================
  5 
  6 #include <cmajor/build/MessageHandler.hpp>
  7 #include <cmajor/build/BuildServerMessage.hpp>
  8 #include <stdexcept>
  9 
 10 namespace cmajor { namespace build {
 11 
 12 MessageHandler::~MessageHandler()
 13 {
 14 }
 15 
 16 void Requester::Handle(PushProjectRequest& request)
 17 {
 18     throw std::runtime_error(Name() + ": unexpected push-project-request received, requester state=" + GetStateStr());
 19 }
 20 
 21 void Requester::Handle(PushProjectResponse& response)
 22 {
 23     throw std::runtime_error(Name() + ": unexpected push-project-response received, requester state=" + GetStateStr());
 24 }
 25 
 26 void Requester::Handle(PushProjectFileRequest& request)
 27 {
 28     throw std::runtime_error(Name() + ": unexpected push-project-file-request received, requester state=" + GetStateStr());
 29 }
 30 
 31 void Requester::Handle(PushProjectFileResponse& response)
 32 {
 33     throw std::runtime_error(Name() + ": unexpected push-project-file-response received, requester state=" + GetStateStr());
 34 }
 35 
 36 void Requester::Handle(PushProjectFileContentRequest& request)
 37 {
 38     throw std::runtime_error(Name() + ": unexpected push-project-file-content-request received, requester state=" + GetStateStr());
 39 }
 40 
 41 void Requester::Handle(PushProjectFileContentResponse& response)
 42 {
 43     throw std::runtime_error(Name() + ": unexpected push-project-file-content-response received, requester state=" + GetStateStr());
 44 }
 45 
 46 void Requester::Handle(BuildProjectRequest& request)
 47 {
 48     throw std::runtime_error(Name() + ": unexpected build-project-request receivced, requester state=" + GetStateStr());
 49 }
 50 
 51 void Requester::Handle(BuildProjectResponse& response)
 52 {
 53     throw std::runtime_error(Name() + ": unexpected build-project-response received, requester state=" + GetStateStr());
 54 }
 55 
 56 void Requester::Handle(ShowBuildMessageRequest& request)
 57 {
 58 
 59 }
 60 
 61 void Requester::Handle(ShowBuildMessageResponse& response)
 62 {
 63 
 64 }
 65 
 66 void Requester::Handle(ErrorResponse& response)
 67 {
 68     throw std::runtime_error(Name() + ": unexpected error-response[\"" + response.body.error + "\"] received, requester state=" + GetStateStr());
 69 }
 70 
 71 void Requester::Handle(CloseConnectionRequest& request)
 72 {
 73     throw std::runtime_error(Name() + ": unexpected close-connection-request received, requester state=" + GetStateStr());
 74 }
 75 
 76 void RequestHandler::Handle(PushProjectRequest& request)
 77 {
 78     throw std::runtime_error(Name() + ": unexpected push-project-request received");
 79 }
 80 
 81 void RequestHandler::Handle(PushProjectResponse& response)
 82 {
 83     throw std::runtime_error(Name() + ": unexpected push-project-response received");
 84 }
 85 
 86 void RequestHandler::Handle(PushProjectFileRequest& request)
 87 {
 88     throw std::runtime_error(Name() + ": unexpected push-project-file-request received");
 89 }
 90 
 91 void RequestHandler::Handle(PushProjectFileResponse& response)
 92 {
 93     throw std::runtime_error(Name() + ": unexpected push-project-file-response received");
 94 }
 95 
 96 void RequestHandler::Handle(PushProjectFileContentRequest& request)
 97 {
 98     throw std::runtime_error(Name() + ": unexpected push-project-file-content-request received");
 99 }
100 
101 void RequestHandler::Handle(PushProjectFileContentResponse& response)
102 {
103     throw std::runtime_error(Name() + ": unexpected push-project-file-content-response received");
104 }
105 
106 void RequestHandler::Handle(BuildProjectRequest& request)
107 {
108     throw std::runtime_error(Name() + ": unexpected build-project-request received");
109 }
110 
111 void RequestHandler::Handle(ShowBuildMessageResponse& response)
112 {
113     throw std::runtime_error(Name() + ": unexpected show-build-message-response received");
114 }
115 
116 void RequestHandler::Handle(ErrorResponse& response)
117 {
118     throw std::runtime_error(Name() + ": unexpected error-response[" + response.body.error + "] received");
119 }
120 
121 void RequestHandler::Handle(CloseConnectionRequest& request)
122 {
123     throw std::runtime_error(Name() + ": unexpected close-connection-request received");
124 }
125 
126 } } // namespace cmajor::build