Provides a context for generating the response to a StatusDataset request. More...
#include <ndn-cxx/mgmt/status-dataset-context.hpp>
Public Member Functions | |
void | append (const Block &block) |
Appends a Block to the response. More... | |
void | end () |
Finalizes the response successfully after appending zero or more blocks. More... | |
const Name & | getPrefix () const |
Returns the prefix of Data packets, with version component but without segment component. More... | |
void | reject (const ControlResponse &resp=ControlResponse().setCode(400)) |
Rejects the request. More... | |
StatusDatasetContext & | setPrefix (const Name &prefix) |
Changes the prefix of the response Data packets. More... | |
Friends | |
class | Dispatcher |
Provides a context for generating the response to a StatusDataset request.
Definition at line 34 of file status-dataset-context.hpp.
void ndn::mgmt::StatusDatasetContext::append | ( | const Block & | block | ) |
Appends a Block to the response.
Definition at line 63 of file status-dataset-context.cpp.
void ndn::mgmt::StatusDatasetContext::end | ( | ) |
Finalizes the response successfully after appending zero or more blocks.
std::logic_error | reject() has already been invoked |
Definition at line 90 of file status-dataset-context.cpp.
|
inline |
Returns the prefix of Data packets, with version component but without segment component.
Definition at line 41 of file status-dataset-context.hpp.
void ndn::mgmt::StatusDatasetContext::reject | ( | const ControlResponse & | resp = ControlResponse().setCode(400) | ) |
Rejects the request.
resp | Content of producer-generated NACK |
This should be invoked when the incoming Interest is malformed. A producer-generated NACK will be returned to the requester.
Definition at line 103 of file status-dataset-context.cpp.
StatusDatasetContext & ndn::mgmt::StatusDatasetContext::setPrefix | ( | const Name & | prefix | ) |
Changes the prefix of the response Data packets.
prefix | the prefix; it must start with the Interest Name, may contain a version component, but must not contain a segment component |
StatusDatasetHandler may change the prefix of Data packets with this method, before sending any response.
The version component is optional, and will be generated from the current timestamp if omitted.
std::invalid_argument | prefix does not satisfy the requirements |
std::logic_error | append(), end(), or reject() has already been invoked |
Definition at line 40 of file status-dataset-context.cpp.
|
friend |
Definition at line 95 of file status-dataset-context.hpp.