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::ProphetRouter dtn::TableBasedRouter dtnsim::GlueNode dtnsim::SimpleNode dtn::FloodBundleRouter dtn::NeighborhoodRouter 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 32 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_bundle_send (BundleSendRequest *event)
 Default event handler for bundle send requests.
virtual void handle_bundle_cancel (BundleCancelRequest *event)
 Default event handler for send bundle request cancellations.
virtual void handle_bundle_inject (BundleInjectRequest *event)
 Default event handler for bundle inject requests.
virtual void handle_bundle_accept (BundleAcceptRequest *event)
 Default event handler for a bundle accept request probe.
virtual void handle_bundle_query (BundleQueryRequest *request)
 Default event handler for bundle query requests.
virtual void handle_bundle_report (BundleReportEvent *request)
 Default event handler for bundle reports.
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_contact_query (ContactQueryRequest *request)
 Default event handler for contact query requests.
virtual void handle_contact_report (ContactReportEvent *request)
 Default event handler for contact reports.
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_link_create (LinkCreateRequest *request)
 Default event handler for link create requests.
virtual void handle_link_query (LinkQueryRequest *request)
 Default event handler for link query requests.
virtual void handle_link_report (LinkReportEvent *request)
 Default event handler for link reports.
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_route_query (RouteQueryRequest *request)
 Default event handler for static route query requests.
virtual void handle_route_report (RouteReportEvent *request)
 Default event handler for static route reports.
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 44 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 52 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, dtn::ProphetRouter, 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 27 of file BundleEventHandler.cc.

References dtn::BUNDLE_ACCEPT_REQUEST, dtn::BUNDLE_CANCEL, dtn::BUNDLE_DELIVERED, dtn::BUNDLE_EXPIRED, dtn::BUNDLE_FREE, dtn::BUNDLE_INJECT, dtn::BUNDLE_QUERY, dtn::BUNDLE_RECEIVED, dtn::BUNDLE_REPORT, dtn::BUNDLE_SEND, dtn::BUNDLE_TRANSMIT_FAILED, dtn::BUNDLE_TRANSMITTED, dtn::CONTACT_DOWN, dtn::CONTACT_QUERY, dtn::CONTACT_REPORT, dtn::CONTACT_UP, dtn::CUSTODY_SIGNAL, dtn::CUSTODY_TIMEOUT, dtn::DAEMON_SHUTDOWN, dtn::DAEMON_STATUS, handle_bundle_accept(), handle_bundle_cancel(), handle_bundle_delivered(), handle_bundle_expired(), handle_bundle_free(), handle_bundle_inject(), handle_bundle_query(), handle_bundle_received(), handle_bundle_report(), handle_bundle_send(), handle_bundle_transmit_failed(), handle_bundle_transmitted(), handle_contact_down(), handle_contact_query(), handle_contact_report(), handle_contact_up(), handle_custody_signal(), handle_custody_timeout(), handle_link_available(), handle_link_create(), handle_link_created(), handle_link_deleted(), handle_link_query(), handle_link_report(), 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_route_query(), handle_route_report(), handle_shutdown_request(), handle_status_request(), dtn::LINK_AVAILABLE, dtn::LINK_CREATE, dtn::LINK_CREATED, dtn::LINK_DELETED, dtn::LINK_QUERY, dtn::LINK_REPORT, 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::ROUTE_QUERY, dtn::ROUTE_REPORT, dtn::BundleEvent::type_, and dtn::BundleEvent::type_str().

Referenced by dtn::TableBasedRouter::handle_event(), dtn::ProphetRouter::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::ProphetRouter, dtn::TableBasedRouter, and dtn::TcaRouter.

Definition at line 186 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 194 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 202 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 210 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, dtn::FloodBundleRouter, and dtn::ProphetRouter.

Definition at line 218 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 227 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_send ( BundleSendRequest event  )  [protected, virtual]

Default event handler for bundle send requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 235 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_cancel ( BundleCancelRequest event  )  [protected, virtual]

Default event handler for send bundle request cancellations.

Reimplemented in dtn::BundleDaemon.

Definition at line 243 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_inject ( BundleInjectRequest event  )  [protected, virtual]

Default event handler for bundle inject requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 251 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_accept ( BundleAcceptRequest event  )  [protected, virtual]

Default event handler for a bundle accept request probe.

Reimplemented in dtn::BundleDaemon.

Definition at line 259 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_query ( BundleQueryRequest request  )  [protected, virtual]

Default event handler for bundle query requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 267 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_bundle_report ( BundleReportEvent request  )  [protected, virtual]

Default event handler for bundle reports.

Reimplemented in dtn::BundleDaemon.

Definition at line 275 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 284 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 292 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 300 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::ProphetRouter, dtn::TableBasedRouter, and dtn::TcaRouter.

Definition at line 308 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 316 of file BundleEventHandler.cc.

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

void dtn::BundleEventHandler::handle_contact_query ( ContactQueryRequest request  )  [protected, virtual]

Default event handler for contact query requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 324 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_contact_report ( ContactReportEvent request  )  [protected, virtual]

Default event handler for contact reports.

Reimplemented in dtn::BundleDaemon.

Definition at line 332 of file BundleEventHandler.cc.

Referenced by dispatch_event().

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 340 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 348 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 356 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 364 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, and dtn::ProphetRouter.

Definition at line 372 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_create ( LinkCreateRequest request  )  [protected, virtual]

Default event handler for link create requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 380 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_query ( LinkQueryRequest request  )  [protected, virtual]

Default event handler for link query requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 388 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_link_report ( LinkReportEvent request  )  [protected, virtual]

Default event handler for link reports.

Reimplemented in dtn::BundleDaemon.

Definition at line 396 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 404 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 413 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 422 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_route_query ( RouteQueryRequest request  )  [protected, virtual]

Default event handler for static route query requests.

Reimplemented in dtn::BundleDaemon.

Definition at line 430 of file BundleEventHandler.cc.

Referenced by dispatch_event().

void dtn::BundleEventHandler::handle_route_report ( RouteReportEvent request  )  [protected, virtual]

Default event handler for static route reports.

Reimplemented in dtn::BundleDaemon.

Definition at line 438 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 446 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 454 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 462 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 470 of file BundleEventHandler.cc.

Referenced by dispatch_event().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:44 2007 for DTN Reference Implementation by  doxygen 1.5.3