NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::mgmt::StatusDatasetContext Class Reference

provides a context for generating response to a StatusDataset request More...

#include <status-dataset-context.hpp>

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

Public Types

typedef std::function< void(const ControlResponse &resp)> NackSender
 

Public Member Functions

const NamegetPrefix () const
 
StatusDatasetContextsetPrefix (const Name &prefix)
 change prefix of Data packets More...
 
const time::milliseconds & getExpiry () const
 
StatusDatasetContextsetExpiry (const time::milliseconds &expiry)
 set expiration duration More...
 
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...
 
void reject (const ControlResponse &resp=ControlResponse().setCode(400))
 declare the non-existence of a response More...
 
 StatusDatasetContext (const Interest &interest, const DataSender &dataSender, const NackSender &nackSender)
 

Public Attributes

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE __pad0__: typedef std::function<void(const Name& dataName
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Blockcontent
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds imsFresh
 
NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds bool isFinalBlock DataSender
 

Friends

class Dispatcher
 Copyright (c) 2013-2017 Regents of the University of California. More...
 

Detailed Description

provides a context for generating response to a StatusDataset request

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

Member Typedef Documentation

typedef std::function<void(const ControlResponse& resp)> ndn::mgmt::StatusDatasetContext::NackSender

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

Constructor & Destructor Documentation

ndn::mgmt::StatusDatasetContext::StatusDatasetContext ( const Interest interest,
const DataSender dataSender,
const NackSender nackSender 
)

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

References ndn::Interest::getName(), and setPrefix().

Member Function Documentation

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.

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.

References ndn::Name::appendVersion(), ndn::Interest::getName(), ndn::Name::isPrefixOf(), and websocketpp::lib::asio::milliseconds().

Referenced by StatusDatasetContext().

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.

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.

Referenced by nfd::ForwarderStatusManager::ForwarderStatusManager().

void ndn::mgmt::StatusDatasetContext::end ( )
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.

Referenced by nfd::FaceManager::setConfigFile().

Friends And Related Function Documentation

friend class Dispatcher
friend

Copyright (c) 2013-2017 Regents of the University of California.

This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).

ndn-cxx library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received copies of the GNU General Public License and GNU Lesser General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see http://www.gnu.org/licenses/.

See AUTHORS.md for complete list of ndn-cxx authors and contributors.

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

Member Data Documentation

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE ndn::mgmt::StatusDatasetContext::__pad0__

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

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block& ndn::mgmt::StatusDatasetContext::content

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

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds ndn::mgmt::StatusDatasetContext::imsFresh

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

NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE const Block time::milliseconds bool isFinalBlock ndn::mgmt::StatusDatasetContext::DataSender

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


The documentation for this class was generated from the following files: