dtn::DTNServer Class Reference

#include <DTNServer.h>

Inheritance diagram for dtn::DTNServer:

oasys::Logger dtnsim::Simulator List of all members.

Detailed Description

Encapsulation class for the "guts" of the server library.

Definition at line 32 of file DTNServer.h.

Public Types

typedef void(*) ShutdownProc (void *args)
 Typedef for a shutdown procedure.

Public Member Functions

 DTNServer (const char *logpath, DTNStorageConfig *storage_config)
 ~DTNServer ()
DTNStorageConfigstorage_config ()
void init ()
bool init_datastore ()
 Initialize the datastore.
void close_datastore ()
 Close and sync the data store.
void start ()
 Start DTN daemon.
bool parse_conf_file (std::string &conf_file, bool conf_file_set)
 Parse the conf file.
void shutdown ()
 Shut down the server.
void set_app_shutdown (ShutdownProc proc, void *data)
 Set an application-specific shutdown handler.

Private Member Functions

bool init_dir (const char *dirname)
bool tidy_dir (const char *dirname)
bool validate_dir (const char *dirname)
void init_commands ()
 Initialize and register all the server related dtn commands.
void init_components ()
 Initialize all components before modifying any configuration.

Private Attributes

bool init_
oasys::atomic_t in_shutdown_
DTNStorageConfigstorage_config_
oasys::DurableStorestore_
APIServerapi_server_


Member Typedef Documentation

typedef void(*) dtn::DTNServer::ShutdownProc(void *args)

Typedef for a shutdown procedure.

Definition at line 64 of file DTNServer.h.


Constructor & Destructor Documentation

dtn::DTNServer::DTNServer ( const char *  logpath,
DTNStorageConfig storage_config 
)

Definition at line 67 of file DTNServer.cc.

dtn::DTNServer::~DTNServer (  ) 

Definition at line 76 of file DTNServer.cc.

References log_notice.


Member Function Documentation

DTNStorageConfig* dtn::DTNServer::storage_config (  )  [inline]

Definition at line 38 of file DTNServer.h.

References storage_config_.

Referenced by dtnsim::Simulator::Simulator().

void dtn::DTNServer::init (  ) 

Initialize storage, components

NOTE: This needs to be called with thread barrier and timer system off because of initialization ordering constraints.

Definition at line 82 of file DTNServer.cc.

References ASSERT, init_commands(), init_components(), and oasys::Thread::start_barrier_enabled().

Referenced by dtn::DTND::main().

bool dtn::DTNServer::init_datastore (  ) 

Initialize the datastore.

Definition at line 99 of file DTNServer.cc.

References oasys::DurableStore::create_store(), dtn::RegistrationStore::init(), dtn::LinkStore::init(), dtn::BundleStore::init(), dtn::GlobalStore::init(), oasys::StorageConfig::init_, init_dir(), dtn::GlobalStore::instance(), log_crit, dtn::DTNStorageConfig::payload_dir_, storage_config_, store_, oasys::StorageConfig::tidy_, tidy_dir(), and validate_dir().

Referenced by dtn::DTND::main().

void dtn::DTNServer::close_datastore (  ) 

Close and sync the data store.

Definition at line 234 of file DTNServer.cc.

References dtn::GlobalStore::close(), oasys::InternalKeyDurableTable< _ShimType, _KeyType, _DataType >::close(), delete_z, dtn::GlobalStore::instance(), dtn::LinkStore::instance(), dtn::RegistrationStore::instance(), log_notice, and store_.

Referenced by dtn::DTND::main(), and shutdown().

void dtn::DTNServer::start (  ) 

Start DTN daemon.

Definition at line 91 of file DTNServer.cc.

References daemon(), and log_debug.

Referenced by dtn::DTND::main().

bool dtn::DTNServer::parse_conf_file ( std::string &  conf_file,
bool  conf_file_set 
)

Parse the conf file.

Definition at line 151 of file DTNServer.cc.

References oasys::TclCommandInterp::instance(), log_err, log_info, log_warn, oasys::Logger::logpath(), and oasys::FileUtils::readable().

Referenced by dtn::DTND::main().

void dtn::DTNServer::shutdown (  ) 

Shut down the server.

Definition at line 247 of file DTNServer.cc.

References oasys::atomic_incr_ret(), close_datastore(), in_shutdown_, log_info, and log_notice.

Referenced by dtn::DTND::main().

void dtn::DTNServer::set_app_shutdown ( ShutdownProc  proc,
void *  data 
)

Set an application-specific shutdown handler.

Definition at line 268 of file DTNServer.cc.

bool dtn::DTNServer::init_dir ( const char *  dirname  )  [private]

Definition at line 274 of file DTNServer.cc.

References errno, and log_crit.

Referenced by init_datastore().

bool dtn::DTNServer::tidy_dir ( const char *  dirname  )  [private]

Definition at line 298 of file DTNServer.cc.

References oasys::FileUtils::abspath(), errno, log_crit, log_debug, log_notice, and snprintf().

Referenced by init_datastore().

bool dtn::DTNServer::validate_dir ( const char *  dirname  )  [private]

Definition at line 332 of file DTNServer.cc.

References errno, log_crit, and log_debug.

Referenced by init_datastore().

void dtn::DTNServer::init_commands (  )  [private]

Initialize and register all the server related dtn commands.

Definition at line 201 of file DTNServer.cc.

References oasys::TclCommandInterp::instance(), log_debug, oasys::TclCommandInterp::reg(), and storage_config_.

Referenced by init().

void dtn::DTNServer::init_components (  )  [private]

Initialize all components before modifying any configuration.

Definition at line 222 of file DTNServer.cc.

References dtn::DiscoveryTable::init(), dtn::BundleDaemon::init(), dtn::InterfaceTable::init(), dtn::ConvergenceLayer::init_clayers(), and log_debug.

Referenced by init().


Member Data Documentation

bool dtn::DTNServer::init_ [private]

Definition at line 70 of file DTNServer.h.

oasys::atomic_t dtn::DTNServer::in_shutdown_ [private]

Definition at line 71 of file DTNServer.h.

Referenced by shutdown().

DTNStorageConfig* dtn::DTNServer::storage_config_ [private]

Definition at line 73 of file DTNServer.h.

Referenced by init_commands(), init_datastore(), and storage_config().

oasys::DurableStore* dtn::DTNServer::store_ [private]

Reimplemented in dtnsim::Simulator.

Definition at line 74 of file DTNServer.h.

Referenced by close_datastore(), and init_datastore().

APIServer* dtn::DTNServer::api_server_ [private]

Definition at line 75 of file DTNServer.h.


The documentation for this class was generated from the following files:
Generated on Thu Jun 7 12:54:33 2007 for DTN Reference Implementation by  doxygen 1.5.1