00001 /* 00002 * Copyright 2005-2006 Intel Corporation 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef _BUNDLE_EVENT_HANDLER_H_ 00018 #define _BUNDLE_EVENT_HANDLER_H_ 00019 00020 #include <oasys/debug/Log.h> 00021 00022 #include "BundleEvent.h" 00023 00024 namespace dtn { 00025 00032 class BundleEventHandler : public oasys::Logger { 00033 public: 00037 virtual void handle_event(BundleEvent* event) = 0; 00038 00039 protected: 00044 BundleEventHandler(const char* classname, 00045 const char* logpath) 00046 : oasys::Logger(classname, logpath) {} 00047 00052 virtual ~BundleEventHandler() {} 00053 00058 void dispatch_event(BundleEvent* event); 00059 00063 virtual void handle_bundle_received(BundleReceivedEvent* event); 00064 00068 virtual void handle_bundle_transmitted(BundleTransmittedEvent* event); 00069 00073 virtual void handle_bundle_delivered(BundleDeliveredEvent* event); 00074 00078 virtual void handle_bundle_expired(BundleExpiredEvent* event); 00079 00084 virtual void handle_bundle_free(BundleFreeEvent* event); 00085 00089 virtual void handle_bundle_send(BundleSendRequest* event); 00090 00094 virtual void handle_bundle_cancel(BundleCancelRequest* event); 00095 00099 virtual void handle_bundle_cancelled(BundleSendCancelledEvent*); 00100 00104 virtual void handle_bundle_inject(BundleInjectRequest* event); 00105 00109 virtual void handle_bundle_injected(BundleInjectedEvent* event); 00110 00114 virtual void handle_bundle_delete(BundleDeleteRequest* request); 00115 00119 virtual void handle_bundle_accept(BundleAcceptRequest* event); 00120 00124 virtual void handle_bundle_query(BundleQueryRequest* request); 00125 00129 virtual void handle_bundle_report(BundleReportEvent* request); 00130 00134 virtual void handle_bundle_attributes_query(BundleAttributesQueryRequest*); 00135 00139 virtual void handle_bundle_attributes_report(BundleAttributesReportEvent*); 00140 00145 virtual void handle_registration_added(RegistrationAddedEvent* event); 00146 00150 virtual void handle_registration_removed(RegistrationRemovedEvent* event); 00151 00155 virtual void handle_registration_expired(RegistrationExpiredEvent* event); 00156 00160 virtual void handle_registration_delete(RegistrationDeleteRequest* event); 00161 00165 virtual void handle_contact_up(ContactUpEvent* event); 00166 00170 virtual void handle_contact_down(ContactDownEvent* event); 00171 00175 virtual void handle_contact_query(ContactQueryRequest* request); 00176 00180 virtual void handle_contact_report(ContactReportEvent* request); 00181 00185 virtual void handle_contact_attribute_changed(ContactAttributeChangedEvent*); 00186 00190 virtual void handle_link_created(LinkCreatedEvent* event); 00191 00195 virtual void handle_link_deleted(LinkDeletedEvent* event); 00196 00200 virtual void handle_link_available(LinkAvailableEvent* event); 00201 00205 virtual void handle_link_unavailable(LinkUnavailableEvent* event); 00206 00210 virtual void handle_link_state_change_request(LinkStateChangeRequest* req); 00211 00215 virtual void handle_link_create(LinkCreateRequest* request); 00216 00220 virtual void handle_link_delete(LinkDeleteRequest* request); 00221 00225 virtual void handle_link_reconfigure(LinkReconfigureRequest* request); 00226 00230 virtual void handle_link_query(LinkQueryRequest* request); 00231 00235 virtual void handle_link_report(LinkReportEvent* request); 00236 00240 virtual void handle_link_attribute_changed(LinkAttributeChangedEvent*); 00241 00245 virtual void handle_reassembly_completed(ReassemblyCompletedEvent* event); 00246 00251 virtual void handle_route_add(RouteAddEvent* event); 00252 00257 virtual void handle_route_del(RouteDelEvent* event); 00258 00262 virtual void handle_route_query(RouteQueryRequest* request); 00263 00267 virtual void handle_route_report(RouteReportEvent* request); 00268 00272 virtual void handle_custody_signal(CustodySignalEvent* event); 00273 00277 virtual void handle_custody_timeout(CustodyTimeoutEvent* event); 00278 00282 virtual void handle_shutdown_request(ShutdownRequest* event); 00283 00287 virtual void handle_status_request(StatusRequest* event); 00288 00292 virtual void handle_cla_set_params(CLASetParamsRequest*); 00293 00297 virtual void handle_cla_params_set(CLAParamsSetEvent*); 00298 00302 virtual void handle_set_link_defaults(SetLinkDefaultsRequest*); 00303 00307 virtual void handle_new_eid_reachable(NewEIDReachableEvent*); 00308 00312 virtual void handle_bundle_queued_query(BundleQueuedQueryRequest*); 00313 virtual void handle_bundle_queued_report(BundleQueuedReportEvent*); 00314 virtual void handle_eid_reachable_query(EIDReachableQueryRequest*); 00315 virtual void handle_eid_reachable_report(EIDReachableReportEvent*); 00316 virtual void handle_link_attributes_query(LinkAttributesQueryRequest*); 00317 virtual void handle_link_attributes_report(LinkAttributesReportEvent*); 00318 virtual void handle_iface_attributes_query(IfaceAttributesQueryRequest*); 00319 virtual void handle_iface_attributes_report(IfaceAttributesReportEvent*); 00320 virtual void handle_cla_parameters_query(CLAParametersQueryRequest*); 00321 virtual void handle_cla_parameters_report(CLAParametersReportEvent*); 00322 }; 00323 00324 } // namespace dtn 00325 00326 #endif /* _BUNDLE_EVENT_HANDLER_H_ */