IBR-DTNSuite  0.12
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 dtn::core::Event *evt) throw ()
 
std::vector< std::string > getVersion () const throw ()
 
void clearStorage () const throw ()
 
void startDiscovery () const throw ()
 
void stopDiscovery () const throw ()
 
- Public Member Functions inherited from dtn::core::EventReceiver
virtual ~EventReceiver ()=0
 

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 150 of file NativeDaemon.cpp.

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

Destructor

Definition at line 156 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 168 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 438 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 688 of file NativeDaemon.cpp.

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

Returns version information about the native daemon

Definition at line 160 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 693 of file NativeDaemon.cpp.

Referenced by __daemon_run(), and ServiceMain().

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

initiate a connection to a given neighbor

Definition at line 590 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 dtn::core::Event evt)
throw (
)
virtual
See Also
dtn::core::EventReceiver::raiseEvent()

Implements dtn::core::EventReceiver.

Definition at line 268 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::ConnectionEvent::getNode(), dtn::net::TransferCompletedEvent::getPeer(), dtn::net::TransferAbortedEvent::getPeer(), dtn::net::ConnectionEvent::getState(), 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_RELOAD, dtn::core::GlobalEvent::GLOBAL_RESUME, dtn::core::GlobalEvent::GLOBAL_SHUTDOWN, dtn::core::GlobalEvent::GLOBAL_START_DISCOVERY, dtn::core::GlobalEvent::GLOBAL_STOP_DISCOVERY, dtn::core::GlobalEvent::GLOBAL_SUSPEND, dtn::core::NODE_AVAILABLE, dtn::core::NODE_DATA_ADDED, dtn::core::NODE_DATA_REMOVED, dtn::core::NODE_UNAVAILABLE, and dtn::net::BundleReceivedEvent::peer.

Here is the call graph for this function:

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

Generate a reload signal

Definition at line 1525 of file NativeDaemon.cpp.

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

Referenced by func_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 1537 of file NativeDaemon.cpp.

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

Referenced by func_sighandler(), and InitService().

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::startDiscovery ( ) const
throw (
)

Enable discovery mechanisms IPND beacons

Definition at line 173 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_START_DISCOVERY, and dtn::core::GlobalEvent::raise().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::stopDiscovery ( ) const
throw (
)

Disable discovery mechanism like IPND beacons

Definition at line 178 of file NativeDaemon.cpp.

References dtn::core::GlobalEvent::GLOBAL_STOP_DISCOVERY, and dtn::core::GlobalEvent::raise().

Here is the call graph for this function:

void dtn::daemon::NativeDaemon::wait ( DaemonRunLevel  rl)
throw (
)

Wait until the runlevel is reached

Definition at line 822 of file NativeDaemon.cpp.


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