BundleActions.h

Go to the documentation of this file.
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 
00025 namespace dtn {
00026 
00027 class Bundle;
00028 class BundleList;
00029 class CustodyTimerSpec;
00030 class EndpointID;
00031 class Interface;
00032 class Link;
00033 class RouterInfo;
00034 
00041 class BundleActions : public oasys::Logger {
00042 public:
00043     BundleActions() : Logger("BundleActions", "/dtn/bundle/actions") {}
00044     virtual ~BundleActions() {}
00045     
00055     virtual void open_link(Link* link);
00056 
00061     virtual void close_link(Link* link);
00062     
00074     virtual bool send_bundle(Bundle* bundle, Link* link,
00075                              ForwardingInfo::action_t action,
00076                              const CustodyTimerSpec& custody_timer);
00077     
00086     virtual bool cancel_bundle(Bundle* bundle, Link* link);
00087 
00097     virtual void inject_bundle(Bundle* bundle);
00098 
00108     virtual bool delete_bundle(Bundle* bundle,
00109                                BundleProtocol::status_report_reason_t
00110                                  reason = BundleProtocol::REASON_NO_ADDTL_INFO,
00111                                bool log_on_error = true);
00112 
00113 protected:
00114     // The protected functions (exposed only to the BundleDaemon) and
00115     // serve solely for the simulator abstraction
00116     friend class BundleDaemon;
00117     
00121     virtual void store_add(Bundle* bundle);
00122 
00127     virtual void store_update(Bundle* bundle);
00128 
00132     virtual void store_del(Bundle* bundle);
00133 };
00134 
00135 } // namespace dtn
00136 
00137 #endif /* _BUNDLE_ACTIONS_H_ */

Generated on Thu Jun 7 16:56:48 2007 for DTN Reference Implementation by  doxygen 1.5.1