ndn::mgmt::StatusDatasetContext Class Reference

provides a context for generating 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 (const Block &block)
 append a Block to the response More...
 
void end ()
 end the response successfully after appending zero or more blocks More...
 
const time::milliseconds & getExpiry () const
 
const NamegetPrefix () const
 
void reject (const ControlResponse &resp=ControlResponse().setCode(400))
 declare the non-existence of a response More...
 
StatusDatasetContextsetExpiry (const time::milliseconds &expiry)
 set expiration duration More...
 
StatusDatasetContextsetPrefix (const Name &prefix)
 change prefix of Data packets More...
 

Friends

class Dispatcher
 

Detailed Description

provides a context for generating response to a StatusDataset request

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

Member Function Documentation

void ndn::mgmt::StatusDatasetContext::append ( const Block block)

append a Block to the response

Exceptions
std::domain_errorend or reject has been invoked

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

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

end the response successfully after appending zero or more blocks

Exceptions
std::domain_errorreject has been invoked

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

const time::milliseconds & ndn::mgmt::StatusDatasetContext::getExpiry ( ) const
Returns
expiration duration for this dataset response

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

const Name & ndn::mgmt::StatusDatasetContext::getPrefix ( ) const
Returns
prefix of Data packets, with version component but without segment component

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

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

declare the non-existence of a response

Exceptions
std::domain_errorappend or end has been invoked

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

Parameters
respContent of producer-generated NACK

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

StatusDatasetContext & ndn::mgmt::StatusDatasetContext::setExpiry ( const time::milliseconds &  expiry)

set expiration duration

The response will be cached for the specified duration. Incoming Interest that matches a cached response will be satisfied with that response, without invoking StatusDatasetHandler again.

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

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

change prefix of Data packets

Parameters
prefixthe prefix; it must start with Interest Name, may contain version component, but must not contain segment component
Exceptions
std::invalid_argumentprefix does not start with Interest Name
std::domain_errorappend, end, or reject has been invoked

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 current timestamp when omitted.

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

Friends And Related Function Documentation

friend class Dispatcher
friend

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