dtn::ProphetBundleCore Class Reference

#include <ProphetBundleCore.h>

Inheritance diagram for dtn::ProphetBundleCore:

prophet::BundleCore prophet::Repository::BundleCoreRep

List of all members.


Detailed Description

Implements the prophet::BundleCore API by integrating DTN's system services.

Definition at line 44 of file ProphetBundleCore.h.


Public Member Functions

 ProphetBundleCore (const std::string &local_eid, BundleActions *actions, oasys::SpinLock *lock)
 Constructor.
 ProphetBundleCore (oasys::Builder)
 Test constructor.
virtual ~ProphetBundleCore ()
 Destructor.
bool read_bundle (const prophet::Bundle *bundle, u_char *buffer, size_t &len)
 Implementation trick to get around const issues.
void load_prophet_nodes (prophet::Table *nodes, prophet::ProphetParams *params)
 Initialization routine for deserializing routes from permanent storage.
void load_dtn_bundles (const BundleList *list)
 Initialization routine for loading Bundle metadata into Prophet's facade.
void shutdown ()
 Callback for host system's shutdown routine.
prophet::Repositorybundles ()
 Prophet's queue policy implementation.
bool is_route (const std::string &dest_id, const std::string &route) const
 Virtual from prophet::BundleCore.
bool should_fwd (const prophet::Bundle *bundle, const prophet::Link *link) const
 Virtual from prophet::BundleCore.
std::string get_route (const std::string &dest_id) const
 Virtual from prophet::BundleCore.
std::string get_route_pattern (const std::string &dest_id) const
 Virtual from prophet::BundleCore.
u_int64_t max_bundle_quota () const
 Virtual from prophet::BundleCore.
bool custody_accepted () const
 Virtual from prophet::BundleCore.
void drop_bundle (const prophet::Bundle *bundle)
 Virtual from prophet::BundleCore.
bool send_bundle (const prophet::Bundle *bundle, const prophet::Link *link)
 Virtual from prophet::BundleCore.
bool write_bundle (const prophet::Bundle *bundle, const u_char *buffer, size_t len)
 Virtual from prophet::BundleCore.
bool read_bundle (const prophet::Bundle *bundle, u_char *buffer, size_t &len) const
 Virtual from prophet::BundleCore.
prophet::Bundlecreate_bundle (const std::string &src, const std::string &dst, u_int expiration)
 Virtual from prophet::BundleCore.
const prophet::BundleListbundles () const
 Virtual from prophet::BundleCore.
const prophet::Bundlefind (const prophet::BundleList &list, const std::string &eid, u_int32_t creation_ts, u_int32_t seqno) const
 Virtual from prophet::BundleCore.
void update_node (const prophet::Node *node)
 Virtual from prophet::BundleCore.
void delete_node (const prophet::Node *node)
 Virtual from prophet::BundleCore.
std::string local_eid () const
 Virtual from prophet::BundleCore.
std::string prophet_id (const prophet::Link *link) const
 Virtual from prophet::BundleCore.
std::string prophet_id () const
 Virtual from prophet::BundleCore.
prophet::Alarmcreate_alarm (prophet::ExpirationHandler *handler, u_int timeout, bool jitter=false)
 Virtual from prophet::BundleCore.
void print_log (const char *name, int level, const char *fmt,...)
 Virtual from prophet::BundleCore.
const Bundleget_bundle (const prophet::Bundle *b)
 Conversion between Prophet's Facade type and DTN native type.
const prophet::Bundleget_bundle (const Bundle *b)
 Conversion between Prophet's Facade type and DTN native type.
const prophet::Bundleget_temp_bundle (const BundleRef &b)
 Conversion between Prophet's Facade type and DTN native type.
const Linkget_link (const prophet::Link *link)
 Conversion between Prophet's Facade type and DTN native type.
const prophet::Linkget_link (const Link *link)
 Conversion between Prophet's Facade type and DTN native type.
void add (const BundleRef &b)
void del (const BundleRef &b)
void add (const LinkRef &link)
void del (const LinkRef &link)

Protected Attributes

BundleActions *const actions_
 actions interface for send, delete, etc
ProphetBundleList bundles_
 objects that link DTN to Prophet bundles
ProphetLinkList links_
 objects that link DTN to Prophet links
ProphetNodeList nodes_
 interface into persistent storage
const std::string local_eid_
 route to local DTN instance
oasys::SpinLock *const lock_
 shared lock with ProphetRouter
bool test_mode_
 test constructor used, meaning that BundleDaemon is unavailable

Friends

class ProphetRouter

Constructor & Destructor Documentation

dtn::ProphetBundleCore::ProphetBundleCore ( const std::string &  local_eid,
BundleActions actions,
oasys::SpinLock *  lock 
)

Constructor.

Definition at line 38 of file ProphetBundleCore.cc.

References actions_, and ASSERT.

dtn::ProphetBundleCore::ProphetBundleCore ( oasys::Builder   ) 

Test constructor.

Definition at line 52 of file ProphetBundleCore.cc.

References test_mode_.

dtn::ProphetBundleCore::~ProphetBundleCore (  )  [virtual]

Destructor.

Definition at line 76 of file ProphetBundleCore.cc.


Member Function Documentation

bool dtn::ProphetBundleCore::is_route ( const std::string &  dest_id,
const std::string &  route 
) const [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 116 of file ProphetBundleCore.cc.

References get_route_pattern(), and dtn::EndpointIDPattern::match().

Referenced by find().

bool dtn::ProphetBundleCore::should_fwd ( const prophet::Bundle bundle,
const prophet::Link link 
) const [virtual]

std::string dtn::ProphetBundleCore::get_route ( const std::string &  dest_id  )  const [virtual]

std::string dtn::ProphetBundleCore::get_route_pattern ( const std::string &  dest_id  )  const [virtual]

u_int64_t dtn::ProphetBundleCore::max_bundle_quota (  )  const [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 144 of file ProphetBundleCore.cc.

References test_mode_, and TEST_MODE_QUOTA.

bool dtn::ProphetBundleCore::custody_accepted (  )  const [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 151 of file ProphetBundleCore.cc.

References dtn::BundleDaemon::params_, and test_mode_.

void dtn::ProphetBundleCore::drop_bundle ( const prophet::Bundle bundle  )  [virtual]

bool dtn::ProphetBundleCore::send_bundle ( const prophet::Bundle bundle,
const prophet::Link link 
) [virtual]

bool dtn::ProphetBundleCore::write_bundle ( const prophet::Bundle bundle,
const u_char *  buffer,
size_t  len 
) [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 251 of file ProphetBundleCore.cc.

References get_bundle(), dtn::LOG, and prophet::Bundle::sequence_num().

bool dtn::ProphetBundleCore::read_bundle ( const prophet::Bundle bundle,
u_char *  buffer,
size_t &  len 
) const [inline, virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 82 of file ProphetBundleCore.h.

prophet::Bundle * dtn::ProphetBundleCore::create_bundle ( const std::string &  src,
const std::string &  dst,
u_int  expiration 
) [virtual]

const prophet::BundleList& dtn::ProphetBundleCore::bundles (  )  const [inline, virtual]

const prophet::Bundle * dtn::ProphetBundleCore::find ( const prophet::BundleList list,
const std::string &  eid,
u_int32_t  creation_ts,
u_int32_t  seqno 
) const [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 300 of file ProphetBundleCore.cc.

References is_route().

void dtn::ProphetBundleCore::update_node ( const prophet::Node node  )  [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 350 of file ProphetBundleCore.cc.

References dtn::LOG, nodes_, and dtn::ProphetNodeList::update().

void dtn::ProphetBundleCore::delete_node ( const prophet::Node node  )  [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 357 of file ProphetBundleCore.cc.

References dtn::ProphetNodeList::del(), dtn::LOG, and nodes_.

std::string dtn::ProphetBundleCore::local_eid (  )  const [inline, virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 101 of file ProphetBundleCore.h.

References local_eid_.

Referenced by prophet_id().

std::string dtn::ProphetBundleCore::prophet_id ( const prophet::Link link  )  const [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 364 of file ProphetBundleCore.cc.

References ASSERT, and prophet::Link::remote_eid().

std::string dtn::ProphetBundleCore::prophet_id (  )  const [inline, virtual]

prophet::Alarm * dtn::ProphetBundleCore::create_alarm ( prophet::ExpirationHandler handler,
u_int  timeout,
bool  jitter = false 
) [virtual]

void dtn::ProphetBundleCore::print_log ( const char *  name,
int  level,
const char *  fmt,
  ... 
) [virtual]

Virtual from prophet::BundleCore.

Implements prophet::BundleCore.

Definition at line 396 of file ProphetBundleCore.cc.

Referenced by should_fwd().

bool dtn::ProphetBundleCore::read_bundle ( const prophet::Bundle bundle,
u_char *  buffer,
size_t &  len 
)

Implementation trick to get around const issues.

Definition at line 265 of file ProphetBundleCore.cc.

References get_bundle(), dtn::LOG, and prophet::Bundle::sequence_num().

void dtn::ProphetBundleCore::load_prophet_nodes ( prophet::Table nodes,
prophet::ProphetParams params 
)

void dtn::ProphetBundleCore::load_dtn_bundles ( const BundleList list  ) 

Initialization routine for loading Bundle metadata into Prophet's facade.

Definition at line 62 of file ProphetBundleCore.cc.

References ASSERT, dtn::BundleList::begin(), dtn::BundleList::end(), dtn::BundleList::lock(), dtn::LOG, and dtn::BundleList::size().

void dtn::ProphetBundleCore::shutdown (  )  [inline]

Callback for host system's shutdown routine.

Definition at line 141 of file ProphetBundleCore.h.

References bundles_, dtn::ProphetNodeList::clear(), dtn::ProphetLinkList::clear(), dtn::ProphetBundleList::clear(), links_, and nodes_.

Referenced by dtn::ProphetRouter::shutdown().

const Bundle * dtn::ProphetBundleCore::get_bundle ( const prophet::Bundle b  ) 

const prophet::Bundle * dtn::ProphetBundleCore::get_bundle ( const Bundle b  ) 

Conversion between Prophet's Facade type and DTN native type.

Definition at line 433 of file ProphetBundleCore.cc.

References bundles_, dtn::ProphetBundleList::find(), and dtn::LOG.

const prophet::Bundle * dtn::ProphetBundleCore::get_temp_bundle ( const BundleRef b  ) 

Conversion between Prophet's Facade type and DTN native type.

Definition at line 441 of file ProphetBundleCore.cc.

References dtn::LOG.

Referenced by dtn::ProphetRouter::accept_bundle(), and dtn::ProphetRouter::handle_bundle_received().

const Link * dtn::ProphetBundleCore::get_link ( const prophet::Link link  ) 

const prophet::Link * dtn::ProphetBundleCore::get_link ( const Link link  ) 

Conversion between Prophet's Facade type and DTN native type.

Definition at line 459 of file ProphetBundleCore.cc.

References dtn::EndpointID::c_str(), dtn::ProphetLinkList::find(), links_, dtn::LOG, and dtn::Link::remote_eid().

void dtn::ProphetBundleCore::add ( const BundleRef b  ) 

Convenience method for insert/delete into Prophet's BundleCore facade

Definition at line 468 of file ProphetBundleCore.cc.

References dtn::ProphetBundleList::add(), bundles_, and dtn::LOG.

Referenced by dtn::ProphetRouter::handle_bundle_received(), and dtn::ProphetRouter::handle_contact_up().

void dtn::ProphetBundleCore::del ( const BundleRef b  ) 

Convenience method for insert/delete into Prophet's BundleCore facade

Definition at line 475 of file ProphetBundleCore.cc.

References bundles_, dtn::ProphetBundleList::del(), and dtn::LOG.

Referenced by dtn::ProphetRouter::handle_bundle_expired(), and dtn::ProphetRouter::handle_contact_down().

void dtn::ProphetBundleCore::add ( const LinkRef link  ) 

Convenience method for insert/delete into Prophet's BundleCore facade

Definition at line 482 of file ProphetBundleCore.cc.

References dtn::ProphetLinkList::add(), links_, and dtn::LOG.

void dtn::ProphetBundleCore::del ( const LinkRef link  ) 

Convenience method for insert/delete into Prophet's BundleCore facade

Definition at line 489 of file ProphetBundleCore.cc.

References dtn::ProphetLinkList::del(), links_, and dtn::LOG.

prophet::Repository* dtn::ProphetBundleCore::bundles (  )  [inline]

Prophet's queue policy implementation.

Definition at line 167 of file ProphetBundleCore.h.

References dtn::ProphetBundleList::bundles(), and bundles_.


Friends And Related Function Documentation

friend class ProphetRouter [friend]

Definition at line 170 of file ProphetBundleCore.h.


Member Data Documentation

actions interface for send, delete, etc

Definition at line 172 of file ProphetBundleCore.h.

Referenced by drop_bundle(), ProphetBundleCore(), and send_bundle().

objects that link DTN to Prophet bundles

Definition at line 173 of file ProphetBundleCore.h.

Referenced by add(), bundles(), del(), drop_bundle(), get_bundle(), dtn::ProphetRouter::handle_bundle_received(), should_fwd(), and shutdown().

objects that link DTN to Prophet links

Definition at line 174 of file ProphetBundleCore.h.

Referenced by add(), del(), get_link(), should_fwd(), and shutdown().

interface into persistent storage

Definition at line 175 of file ProphetBundleCore.h.

Referenced by delete_node(), load_prophet_nodes(), shutdown(), and update_node().

const std::string dtn::ProphetBundleCore::local_eid_ [protected]

route to local DTN instance

Definition at line 176 of file ProphetBundleCore.h.

Referenced by local_eid().

oasys::SpinLock* const dtn::ProphetBundleCore::lock_ [protected]

shared lock with ProphetRouter

Definition at line 177 of file ProphetBundleCore.h.

Referenced by create_alarm().

test constructor used, meaning that BundleDaemon is unavailable

Definition at line 178 of file ProphetBundleCore.h.

Referenced by custody_accepted(), max_bundle_quota(), ProphetBundleCore(), and should_fwd().


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

Generated on Mon Jul 21 14:12:21 2008 for DTN Reference Implementation by  doxygen 1.5.6