diff --git a/frontend/TestSsiRequestProc.cpp b/frontend/TestSsiRequestProc.cpp index 6e761eefa38c4528ae1f0a5b95e963545203f2bf..67f7d072eb68fb3ff97a372e45c7f26f84c27d53 100644 --- a/frontend/TestSsiRequestProc.cpp +++ b/frontend/TestSsiRequestProc.cpp @@ -7,6 +7,26 @@ // This is for specialized private methods called by RequestProc::Execute to handle actions, alerts // and metadata +template <> +void RequestProc<xrdssi::test::Request, xrdssi::test::Result>::ExecuteAction() +{ + // Output message in Json format (for debugging) + + std::cerr << "Received message:" << std::endl; + std::cerr << xrdssi::test::MessageToJsonString(request); + + // Set reply + + response.set_result_code(0); + response.mutable_response()->set_message_text("This is the reply to " + *request.mutable_message_text()); + + // Output message in Json format (for debugging) + + std::cerr << "Sending response:" << std::endl; + std::cerr << xrdssi::test::MessageToJsonString(response); +} + + template <> void RequestProc<xrdssi::test::Request, xrdssi::test::Result>::ExecuteMetadata() { diff --git a/frontend/TestSsiRequestProc.h b/frontend/TestSsiRequestProc.h index 82e3e2aef97d79702388468c0d1cb0d05ea13323..4ac4e5d242a232a8bc5c839c998ed45c2085cac8 100644 --- a/frontend/TestSsiRequestProc.h +++ b/frontend/TestSsiRequestProc.h @@ -29,9 +29,11 @@ public: virtual void Finished(XrdSsiRequest &rqstR, const XrdSsiRespInfo &rInfo, bool cancel=false) override; private: - void ExecuteAction() {} - void ExecuteAlerts() {} - void ExecuteMetadata() {} + // These methods should be specialized according to the needs of each <RequestType, ResponseType> pair + + void ExecuteAction() { std::cerr << "Called default ExecuteAction()" << std::endl; } + void ExecuteAlerts() { std::cerr << "Called default ExecuteAlerts()" << std::endl; } + void ExecuteMetadata() { std::cerr << "Called default ExecuteMetadata()" << std::endl; } RequestType request; ResponseType response; @@ -62,7 +64,7 @@ void RequestProc<RequestType, ResponseType>::Execute() throw XrdSsiException("ParseFromString() failed"); } - // Release the request buffer (optional, perhaps it is more efficient to reuse it) + // Release the request buffer (optional, perhaps it is more efficient to reuse it?) ReleaseRequestBuffer();