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_ACTIONS_H_ 00018 #define _BUNDLE_ACTIONS_H_ 00019 00020 #include <vector> 00021 #include <oasys/debug/Log.h> 00022 #include "ForwardingInfo.h" 00023 #include "BundleProtocol.h" 00024 #include "contacts/Link.h" 00025 00026 namespace dtn { 00027 00028 class Bundle; 00029 class BundleList; 00030 class CustodyTimerSpec; 00031 class EndpointID; 00032 class Interface; 00033 00038 class BundleActions : public oasys::Logger { 00039 public: 00040 BundleActions() : Logger("BundleActions", "/dtn/bundle/actions") {} 00041 virtual ~BundleActions() {} 00042 00052 virtual void open_link(const LinkRef& link); 00053 00058 virtual void close_link(const LinkRef& link); 00059 00071 virtual bool queue_bundle(Bundle* bundle, const LinkRef& link, 00072 ForwardingInfo::action_t action, 00073 const CustodyTimerSpec& custody_timer); 00074 00083 virtual void cancel_bundle(Bundle* bundle, const LinkRef& link); 00084 00094 virtual void inject_bundle(Bundle* bundle); 00095 00105 virtual bool delete_bundle(Bundle* bundle, 00106 BundleProtocol::status_report_reason_t 00107 reason = BundleProtocol::REASON_NO_ADDTL_INFO, 00108 bool log_on_error = true); 00109 00110 protected: 00111 // The protected functions (exposed only to the BundleDaemon) and 00112 // serve solely for the simulator abstraction 00113 friend class BundleDaemon; 00114 00118 virtual void store_add(Bundle* bundle); 00119 00124 virtual void store_update(Bundle* bundle); 00125 00129 virtual void store_del(Bundle* bundle); 00130 }; 00131 00132 } // namespace dtn 00133 00134 #endif /* _BUNDLE_ACTIONS_H_ */