Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
9f23d0bf
Commit
9f23d0bf
authored
Jun 04, 2017
by
Michael Davis
Browse files
Serializes and sends response from XrdSsi server
parent
b7341d17
Changes
2
Hide whitespace changes
Inline
Side-by-side
frontend/TestSsiRequestProc.cpp
View file @
9f23d0bf
...
...
@@ -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
()
{
...
...
frontend/TestSsiRequestProc.h
View file @
9f23d0bf
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment