#include <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 () | |
DTNStorageConfig * | storage_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_ |
DTNStorageConfig * | storage_config_ |
oasys::DurableStore * | store_ |
Definition at line 31 of file DTNServer.h.
typedef void(* dtn::DTNServer::ShutdownProc)(void *args) |
Typedef for a shutdown procedure.
dtn::DTNServer::DTNServer | ( | const char * | logpath, | |
DTNStorageConfig * | storage_config | |||
) |
Definition at line 71 of file DTNServer.cc.
dtn::DTNServer::~DTNServer | ( | ) |
Definition at line 80 of file DTNServer.cc.
void dtn::DTNServer::close_datastore | ( | ) |
Close and sync the data store.
Definition at line 248 of file DTNServer.cc.
References dtn::GlobalStore::close(), dtn::GlobalStore::instance(), and store_.
Referenced by dtn::DTND::main(), and shutdown().
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 86 of file DTNServer.cc.
References ASSERT, init_commands(), and init_components().
Referenced by init_components(), and dtn::DTND::main().
void dtn::DTNServer::init_commands | ( | ) | [private] |
Initialize and register all the server related dtn commands.
Definition at line 207 of file DTNServer.cc.
References storage_config_.
Referenced by init().
void dtn::DTNServer::init_components | ( | ) | [private] |
Initialize all components before modifying any configuration.
Definition at line 236 of file DTNServer.cc.
References init(), and dtn::ConvergenceLayer::init_clayers().
Referenced by init().
bool dtn::DTNServer::init_datastore | ( | ) |
Initialize the datastore.
Definition at line 103 of file DTNServer.cc.
References dtn::RegistrationStore::init(), dtn::LinkStore::init(), dtn::ProphetStore::init(), dtn::BundleStore::init(), dtn::GlobalStore::init(), init_dir(), dtn::GlobalStore::instance(), dtn::DTNStorageConfig::payload_dir_, storage_config_, store_, tidy_dir(), and validate_dir().
Referenced by dtn::DTND::main().
bool dtn::DTNServer::init_dir | ( | const char * | dirname | ) | [private] |
Parse the conf file.
Definition at line 156 of file DTNServer.cc.
References INSTALL_SYSCONFDIR.
Referenced by dtn::DTND::main().
void dtn::DTNServer::set_app_shutdown | ( | ShutdownProc | proc, | |
void * | data | |||
) |
void dtn::DTNServer::shutdown | ( | ) |
Shut down the server.
Definition at line 262 of file DTNServer.cc.
References close_datastore(), and in_shutdown_.
Referenced by dtn::DTND::main().
void dtn::DTNServer::start | ( | ) |
DTNStorageConfig* dtn::DTNServer::storage_config | ( | ) | [inline] |
bool dtn::DTNServer::tidy_dir | ( | const char * | dirname | ) | [private] |
bool dtn::DTNServer::validate_dir | ( | const char * | dirname | ) | [private] |
oasys::atomic_t dtn::DTNServer::in_shutdown_ [private] |
bool dtn::DTNServer::init_ [private] |
Definition at line 69 of file DTNServer.h.
DTNStorageConfig* dtn::DTNServer::storage_config_ [private] |
Definition at line 72 of file DTNServer.h.
Referenced by init_commands(), init_datastore(), and storage_config().
oasys::DurableStore* dtn::DTNServer::store_ [private] |