ndn::mgmt::StatusDatasetContext Class Reference

Provides a context for generating the response to a StatusDataset request. More...

#include <ndn-cxx/mgmt/status-dataset-context.hpp>

+ Inheritance diagram for ndn::mgmt::StatusDatasetContext:
+ Collaboration diagram for ndn::mgmt::StatusDatasetContext:

Public Member Functions

void append (span< const uint8_t > bytes)
 Appends a sequence of bytes to the response. More...
 
void end ()
 Finalizes the response successfully after appending zero or more blocks. More...
 
const NamegetPrefix () 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...
 
StatusDatasetContextsetPrefix (const Name &prefix)
 Changes the prefix of the response Data packets. More...
 

Friends

class Dispatcher
 

Detailed Description

Provides a context for generating the response to a StatusDataset request.

Definition at line 33 of file status-dataset-context.hpp.

Member Function Documentation

◆ append()

void ndn::mgmt::StatusDatasetContext::append ( span< const uint8_t >  bytes)

Appends a sequence of bytes to the response.

Exceptions
std::logic_errorend() or reject() has already been invoked

Definition at line 62 of file status-dataset-context.cpp.

◆ end()

void ndn::mgmt::StatusDatasetContext::end ( )

Finalizes the response successfully after appending zero or more blocks.

Exceptions
std::logic_errorreject() has already been invoked

Definition at line 84 of file status-dataset-context.cpp.

◆ getPrefix()

const Name& ndn::mgmt::StatusDatasetContext::getPrefix ( ) const
inline

Returns the prefix of Data packets, with version component but without segment component.

Definition at line 40 of file status-dataset-context.hpp.

◆ reject()

void ndn::mgmt::StatusDatasetContext::reject ( const ControlResponse resp = ControlResponse().setCode(400))

Rejects the request.

Parameters
respContent of producer-generated NACK

This should be invoked when the incoming Interest is malformed. A producer-generated NACK will be returned to the requester.

Exceptions
std::logic_errorappend() or end() has already been invoked

Definition at line 98 of file status-dataset-context.cpp.

◆ setPrefix()

StatusDatasetContext & ndn::mgmt::StatusDatasetContext::setPrefix ( const Name prefix)

Changes the prefix of the response Data packets.

Parameters
prefixthe 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.

Exceptions
std::invalid_argumentprefix does not satisfy the requirements
std::logic_errorappend(), end(), or reject() has already been invoked

Definition at line 39 of file status-dataset-context.cpp.

Friends And Related Function Documentation

◆ Dispatcher

friend class Dispatcher
friend

Definition at line 94 of file status-dataset-context.hpp.