IBR-DTNSuite  0.10
dtn::daemon::NativeDaemon Class Reference

#include <NativeDaemon.h>

Inheritance diagram for dtn::daemon::NativeDaemon:
Inheritance graph
Collaboration diagram for dtn::daemon::NativeDaemon:
Collaboration graph

Public Member Functions

 NativeDaemon (NativeDaemonCallback *statecb=NULL, NativeEventCallback *eventcb=NULL)
 
virtual ~NativeDaemon ()
 
DaemonRunLevel getRunLevel () const throw ()
 
void init (DaemonRunLevel rl) throw (NativeDaemonException)
 
void wait (DaemonRunLevel rl) throw ()
 
void reload () throw ()
 
void setDebug (int level) throw ()
 
void setLogging (const std::string &defaultTag, int logLevel) const throw ()
 
void setLogFile (const std::string &path, int logLevel) const throw ()
 
void setConfigFile (const std::string &config_file)
 
std::string getLocalUri () const throw ()
 
std::vector< std::string > getNeighbors () const throw ()
 
NativeNode getInfo (const std::string &neighbor_eid) const throw (NativeDaemonException)
 
NativeStats getStats () throw ()
 
void addConnection (std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const throw ()
 
void removeConnection (std::string eid, std::string protocol, std::string address, std::string service, bool local=false) const throw ()
 
void initiateConnection (std::string eid)
 
virtual void raiseEvent (const Event *evt) throw ()
 
std::vector< std::string > getVersion () const throw ()
 
void clearStorage () const throw ()
 
- Public Member Functions inherited from dtn::core::EventReceiver
virtual ~EventReceiver ()=0
 

Static Public Attributes

static const std::string TAG = "NativeDaemon"
 

Detailed Description

Definition at line 142 of file NativeDaemon.h.

Constructor & Destructor Documentation

dtn::daemon::NativeDaemon::NativeDaemon ( NativeDaemonCallback statecb = NULL,
NativeEventCallback eventcb = NULL 
)

Constructor

Definition at line 145 of file NativeDaemon.cpp.

dtn::daemon::NativeDaemon::~NativeDaemon ( )
virtual

Destructor

Definition at line 151 of file NativeDaemon.cpp.

Member Function Documentation

void dtn::daemon::NativeDaemon::addConnection ( std::string  eid,
std::string  protocol,
std::string  address,
std::string  service,
bool  local = false 
) const throw ()
void dtn::daemon::NativeDaemon::clearStorage ( ) const throw ()

Delete all bundles in the storage

Definition at line 163 of file NativeDaemon.cpp.

References dtn::storage::BundleStorage::clear(), dtn::core::BundleCore::getInstance(), and dtn::core::BundleCore::getStorage().

Here is the call graph for this function:

std::string dtn::daemon::NativeDaemon::getLocalUri ( ) const throw ()

NATIVE DAEMON METHODS Get the local EID of this node

Definition at line 416 of file NativeDaemon.cpp.

References dtn::data::EID::getString(), and dtn::core::BundleCore::local.

Here is the call graph for this function:

std::vector< std::string > dtn::daemon::NativeDaemon::getNeighbors ( ) const throw ()
DaemonRunLevel dtn::daemon::NativeDaemon::getRunLevel ( ) const throw ()

Get the current runlevel

Definition at line 670 of file NativeDaemon.cpp.

std::vector< std::string > dtn::daemon::NativeDaemon::getVersion ( ) const throw ()

Returns version information about the native daemon

Definition at line 155 of file NativeDaemon.cpp.

References BUILD_NUMBER, and VERSION.

void dtn::daemon::NativeDaemon::init ( DaemonRunLevel  rl) throw (NativeDaemonException)

Switch the runlevel of the daemon

Definition at line 675 of file NativeDaemon.cpp.

Referenced by __daemon_run().

void dtn::daemon::NativeDaemon::initiateConnection ( std::string  eid)

initiate a connection to a given neighbor

Definition at line 572 of file NativeDaemon.cpp.

References dtn::core::BundleCore::getConnectionManager(), dtn::core::BundleCore::getInstance(), dtn::net::ConnectionManager::getNeighbor(), and dtn::net::ConnectionManager::open().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::raiseEvent ( const Event evt) throw ()
virtual
See Also
dtn::core::EventReceiver::raiseEvent()

Implements dtn::core::EventReceiver.

Definition at line 252 of file NativeDaemon.cpp.

References dtn::routing::QueueBundleEvent::bundle, dtn::net::BundleReceivedEvent::bundle, dtn::net::ConnectionEvent::CONNECTION_DOWN, dtn::net::ConnectionEvent::CONNECTION_SETUP, dtn::net::ConnectionEvent::CONNECTION_TIMEOUT, dtn::net::ConnectionEvent::CONNECTION_UP, dtn::core::CUSTODY_ACCEPT, dtn::core::CUSTODY_REJECT, dtn::net::BundleReceivedEvent::fromlocal, dtn::core::CustodyEvent::getAction(), dtn::core::NodeEvent::getAction(), dtn::core::GlobalEvent::getAction(), dtn::core::CustodyEvent::getBundle(), dtn::net::TransferCompletedEvent::getBundle(), dtn::net::TransferAbortedEvent::getBundleID(), dtn::core::Node::getEID(), dtn::core::NodeEvent::getNode(), dtn::net::TransferCompletedEvent::getPeer(), dtn::net::TransferAbortedEvent::getPeer(), dtn::data::EID::getString(), dtn::core::GlobalEvent::GLOBAL_BUSY, dtn::core::GlobalEvent::GLOBAL_IDLE, dtn::core::GlobalEvent::GLOBAL_INTERNET_AVAILABLE, dtn::core::GlobalEvent::GLOBAL_INTERNET_UNAVAILABLE, dtn::core::GlobalEvent::GLOBAL_POWERSAVE, dtn::core::GlobalEvent::GLOBAL_RELOAD, dtn::core::GlobalEvent::GLOBAL_SHUTDOWN, dtn::core::GlobalEvent::GLOBAL_SUSPEND, dtn::core::NODE_AVAILABLE, dtn::core::NODE_DATA_ADDED, dtn::core::NODE_DATA_REMOVED, dtn::core::NODE_UNAVAILABLE, dtn::net::BundleReceivedEvent::peer, dtn::net::ConnectionEvent::peer, and dtn::net::ConnectionEvent::state.

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::reload ( ) throw ()

Generate a reload signal

Definition at line 1517 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_RELOAD, dtn::core::GlobalEvent::raise(), and ibrcommon::Logger::reload().

Referenced by sighandler().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::removeConnection ( std::string  eid,
std::string  protocol,
std::string  address,
std::string  service,
bool  local = false 
) const throw ()
void dtn::daemon::NativeDaemon::setConfigFile ( const std::string &  config_file)
void dtn::daemon::NativeDaemon::setDebug ( int  level) throw ()

Enable / disable debugging at runtime

Definition at line 1529 of file NativeDaemon.cpp.

References IBRCOMMON_LOGGER_ENDL, IBRCOMMON_LOGGER_TAG, ibrcommon::LogLevel::info, ibrcommon::Logger::setVerbosity(), and TAG.

Referenced by sighandler().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::setLogging ( const std::string &  defaultTag,
int  logLevel 
) const throw ()
void dtn::daemon::NativeDaemon::wait ( DaemonRunLevel  rl) throw ()

Wait until the runlevel is reached

Definition at line 804 of file NativeDaemon.cpp.

Member Data Documentation

const std::string dtn::daemon::NativeDaemon::TAG = "NativeDaemon"
static

Definition at line 144 of file NativeDaemon.h.

Referenced by setDebug().


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