dtn::BundleEventHandler Class Reference

#include <BundleEventHandler.h>

Inheritance diagram for dtn::BundleEventHandler:

oasys::Logger dtn::BundleDaemon dtn::BundleRouter dtn::ContactManager dtnsim::Node dtn::LinkStateRouter dtn::TableBasedRouter dtnsim::GlueNode dtnsim::SimpleNode dtn::FloodBundleRouter dtn::NeighborhoodRouter dtn::ProphetRouter dtn::StaticBundleRouter dtn::TcaRouter List of all members.

Detailed Description

Both the BundleDaemon and all the BundleRouter classes need to process the various types of BundleEvent that are generated by the rest of the system.

This class provides that abstraction plus a useful dispatching function for event-specific handlers.

Definition at line 53 of file BundleEventHandler.h.

Public Member Functions

virtual void handle_event (BundleEvent *event)=0
 Pure virtual event handler function.

Protected Member Functions

 BundleEventHandler (const char *classname, const char *logpath)
 Constructor -- protected since this class shouldn't ever be instantiated directly.
virtual ~BundleEventHandler ()
 Destructor -- Needs to be defined virtual to be sure that derived classes get a chance to clean up their stuff on removal.
void dispatch_event (BundleEvent *event)
 Dispatch the event by type code to one of the event-specific handler functions below.
virtual void handle_bundle_received (BundleReceivedEvent *event)
 Default event handler for new bundle arrivals.
virtual void handle_bundle_transmitted (BundleTransmittedEvent *event)
 Default event handler when bundles are transmitted.
virtual void handle_bundle_transmit_failed (BundleTransmitFailedEvent *event)
 Default event handler when a bundle transmission fails.
virtual void handle_bundle_delivered (BundleDeliveredEvent *event)
 Default event handler when bundles are locally delivered.
virtual void handle_bundle_expired (BundleExpiredEvent *event)
 Default event handler when bundles expire.
virtual void handle_bundle_free (BundleFreeEvent *event)
 Default event handler when bundles are free (i.e.
virtual void handle_registration_added (RegistrationAddedEvent *event)
 Default event handler when a new application registration arrives.
virtual void handle_registration_removed (RegistrationRemovedEvent *event)
 Default event handler when a registration is removed.
virtual void handle_registration_expired (RegistrationExpiredEvent *event)
 Default event handler when a registration expires.
virtual void handle_contact_up (ContactUpEvent *event)
 Default event handler when a new contact is up.
virtual void handle_contact_down (ContactDownEvent *event)
 Default event handler when a contact is down.
virtual void handle_link_created (LinkCreatedEvent *event)
 Default event handler when a new link is created.
virtual void handle_link_deleted (LinkDeletedEvent *event)
 Default event handler when a link is deleted.
virtual void handle_link_available (LinkAvailableEvent *event)
 Default event handler when link becomes available.
virtual void handle_link_unavailable (LinkUnavailableEvent *event)
 Default event handler when a link is unavailable.
virtual void handle_link_state_change_request (LinkStateChangeRequest *req)
 Default event handler for link state change requests.
virtual void handle_reassembly_completed (ReassemblyCompletedEvent *event)
 Default event handler when reassembly is completed.
virtual void handle_route_add (RouteAddEvent *event)
 Default event handler when a new route is added by the command or management interface.
virtual void handle_route_del (RouteDelEvent *event)
 Default event handler when a route is deleted by the command or management interface.
virtual void handle_custody_signal (CustodySignalEvent *event)
 Default event handler when custody signals are received.
virtual void handle_custody_timeout (CustodyTimeoutEvent *event)
 Default event handler when custody transfer timers expire.
virtual void handle_shutdown_request (ShutdownRequest *event)
 Default event handler for shutdown requests.
virtual void handle_status_request (StatusRequest *event)
 Default event handler for status requests.


Constructor & Destructor Documentation

dtn::BundleEventHandler::BundleEventHandler ( const char *  classname,
const char *  logpath 
) [inline, protected]

Constructor -- protected since this class shouldn't ever be instantiated directly.

Definition at line 65 of file BundleEventHandler.h.

virtual dtn::BundleEventHandler::~BundleEventHandler (  )  [inline, protected, virtual]

Destructor -- Needs to be defined virtual to be sure that derived classes get a chance to clean up their stuff on removal.

Definition at line 73 of file BundleEventHandler.h.


Member Function Documentation

virtual void dtn::BundleEventHandler::handle_event ( BundleEvent event  )  [pure virtual]

Pure virtual event handler function.

Implemented in dtn::BundleDaemon, dtn::ContactManager, dtn::BundleRouter, dtn::LinkStateRouter, and dtn::TableBasedRouter.

void dtn::BundleEventHandler::dispatch_event ( BundleEvent event  )  [protected]

Dispatch the event by type code to one of the event-specific handler functions below.

Definition at line 11 of file BundleEventHandler.cc.

References dtn::BUNDLE_DELIVERED, dtn::BUNDLE_EXPIRED, dtn::BUNDLE_FREE, dtn::BUNDLE_RECEIVED, dtn::BUNDLE_TRANSMIT_FAILED, dtn::BUNDLE_TRANSMITTED, dtn::CONTACT_DOWN, dtn::CONTACT_UP, dtn::CUSTODY_SIGNAL, dtn::CUSTODY_TIMEOUT, dtn::DAEMON_SHUTDOWN, dtn::DAEMON_STATUS, handle_bundle_delivered(), handle_bundle_expired(), handle_bundle_free(), handle_bundle_received(), handle_bundle_transmit_failed(), handle_bundle_transmitted(), handle_contact_down(), handle_contact_up(), handle_custody_signal(), handle_custody_timeout(), handle_link_available(), handle_link_created(), handle_link_deleted(), handle_link_state_change_request(), handle_link_unavailable(), handle_reassembly_completed(), handle_registration_added(), handle_registration_expired(), handle_registration_removed(), handle_route_add(), handle_route_del(), handle_shutdown_request(), handle_status_request(), dtn::LINK_AVAILABLE, dtn::LINK_CREATED, dtn::LINK_DELETED, dtn::LINK_STATE_CHANGE_REQUEST, dtn::LINK_UNAVAILABLE, log_debug, dtn::REASSEMBLY_COMPLETED, dtn::REGISTRATION_ADDED, dtn::REGISTRATION_EXPIRED, dtn::REGISTRATION_REMOVED, dtn::ROUTE_ADD, dtn::ROUTE_DEL, dtn::BundleEvent::type_, and dtn::BundleEvent::type_str().

Referenced by dtn::TableBasedRouter::handle_event(), dtn::LinkStateRouter::handle_event(), dtn::ContactManager::handle_event(), and dtn::BundleDaemon::handle_event().

void dtn::BundleEventHandler::handle_bundle_received ( BundleReceivedEvent event  )  [protected, virtual]

Default event handler for new bundle arrivals.

Reimplemented in dtn::BundleDaemon, dtn::FloodBundleRouter, dtn::LinkStateRouter, dtn::TableBasedRouter, and dtn::TcaRouter.

Definition at line 118 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_transmitted ( BundleTransmittedEvent event  )  [protected, virtual]

Default event handler when bundles are transmitted.

Reimplemented in dtn::BundleDaemon, and dtn::TcaRouter.

Definition at line 126 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_transmit_failed ( BundleTransmitFailedEvent event  )  [protected, virtual]

Default event handler when a bundle transmission fails.

Reimplemented in dtn::BundleDaemon, and dtn::TableBasedRouter.

Definition at line 134 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_delivered ( BundleDeliveredEvent event  )  [protected, virtual]

Default event handler when bundles are locally delivered.

Reimplemented in dtn::BundleDaemon.

Definition at line 142 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_expired ( BundleExpiredEvent event  )  [protected, virtual]

Default event handler when bundles expire.

Reimplemented in dtn::BundleDaemon, and dtn::FloodBundleRouter.

Definition at line 150 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_free ( BundleFreeEvent event  )  [protected, virtual]

Default event handler when bundles are free (i.e.

no more references).

Reimplemented in dtn::BundleDaemon.

Definition at line 159 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_registration_added ( RegistrationAddedEvent event  )  [protected, virtual]

Default event handler when a new application registration arrives.

Reimplemented in dtn::BundleDaemon.

Definition at line 168 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_registration_removed ( RegistrationRemovedEvent event  )  [protected, virtual]

Default event handler when a registration is removed.

Reimplemented in dtn::BundleDaemon.

Definition at line 176 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_registration_expired ( RegistrationExpiredEvent event  )  [protected, virtual]

Default event handler when a registration expires.

Reimplemented in dtn::BundleDaemon.

Definition at line 184 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_contact_up ( ContactUpEvent event  )  [protected, virtual]

Default event handler when a new contact is up.

Reimplemented in dtn::BundleDaemon, dtn::ContactManager, dtn::LinkStateRouter, dtn::NeighborhoodRouter, dtn::TableBasedRouter, and dtn::TcaRouter.

Definition at line 192 of file BundleEventHandler.cc.

Referenced by dispatch_event(), and dtn::LinkStateRouter::handle_contact_up().

void dtn::BundleEventHandler::handle_contact_down ( ContactDownEvent event  )  [protected, virtual]

Default event handler when a contact is down.

Reimplemented in dtn::BundleDaemon, dtn::LinkStateRouter, dtn::NeighborhoodRouter, dtn::ProphetRouter, and dtn::TcaRouter.

Definition at line 200 of file BundleEventHandler.cc.

Referenced by dispatch_event(), dtn::ProphetRouter::handle_contact_down(), dtn::NeighborhoodRouter::handle_contact_down(), and dtn::LinkStateRouter::handle_contact_down().

void dtn::BundleEventHandler::handle_link_created ( LinkCreatedEvent event  )  [protected, virtual]

Default event handler when a new link is created.

Reimplemented in dtn::FloodBundleRouter, dtn::ProphetRouter, and dtn::TableBasedRouter.

Definition at line 208 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_deleted ( LinkDeletedEvent event  )  [protected, virtual]

Default event handler when a link is deleted.

Definition at line 216 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_available ( LinkAvailableEvent event  )  [protected, virtual]

Default event handler when link becomes available.

Reimplemented in dtn::BundleDaemon, dtn::ContactManager, dtn::TableBasedRouter, and dtn::TcaRouter.

Definition at line 224 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_unavailable ( LinkUnavailableEvent event  )  [protected, virtual]

Default event handler when a link is unavailable.

Reimplemented in dtn::BundleDaemon, dtn::ContactManager, and dtn::TcaRouter.

Definition at line 232 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_state_change_request ( LinkStateChangeRequest req  )  [protected, virtual]

Default event handler for link state change requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 240 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_reassembly_completed ( ReassemblyCompletedEvent event  )  [protected, virtual]

Default event handler when reassembly is completed.

Reimplemented in dtn::BundleDaemon.

Definition at line 248 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_route_add ( RouteAddEvent event  )  [protected, virtual]

Default event handler when a new route is added by the command or management interface.

Reimplemented in dtn::BundleDaemon, and dtn::TableBasedRouter.

Definition at line 257 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_route_del ( RouteDelEvent event  )  [protected, virtual]

Default event handler when a route is deleted by the command or management interface.

Reimplemented in dtn::BundleDaemon, and dtn::TableBasedRouter.

Definition at line 266 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_custody_signal ( CustodySignalEvent event  )  [protected, virtual]

Default event handler when custody signals are received.

Reimplemented in dtn::BundleDaemon.

Definition at line 274 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_custody_timeout ( CustodyTimeoutEvent event  )  [protected, virtual]

Default event handler when custody transfer timers expire.

Reimplemented in dtn::BundleDaemon, and dtn::TableBasedRouter.

Definition at line 282 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_shutdown_request ( ShutdownRequest event  )  [protected, virtual]

Default event handler for shutdown requests.

Reimplemented in dtn::BundleDaemon, and dtn::TcaRouter.

Definition at line 290 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_status_request ( StatusRequest event  )  [protected, virtual]

Default event handler for status requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 298 of file BundleEventHandler.cc.

Referenced by dispatch_event().


The documentation for this class was generated from the following files:
Generated on Fri Dec 22 14:48:03 2006 for DTN Reference Implementation by  doxygen 1.5.1