IBR-DTN  1.0.0
EMailConvergenceLayer.h
Go to the documentation of this file.
1 /*
2  * EMailConvergenceLayer.h
3  *
4  * Copyright (C) 2013 IBR, TU Braunschweig
5  *
6  * Written-by: Björn Gernert <mail@bjoern-gernert.de>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
22 #ifndef EMAILCONVERGENCELAYER_H_
23 #define EMAILCONVERGENCELAYER_H_
24 
25 #include "Component.h"
26 #include "Configuration.h"
27 
28 #include "core/EventReceiver.h"
29 #include "core/TimeEvent.h"
30 #include "net/ConvergenceLayer.h"
32 #include "net/EMailSmtpService.h"
33 #include "net/EMailImapService.h"
34 
35 namespace dtn
36 {
37  namespace net
38  {
40  public dtn::core::EventReceiver<dtn::core::TimeEvent>,
43  {
44  public:
49 
53  virtual ~EMailConvergenceLayer();
54 
61  void raiseEvent(const dtn::core::TimeEvent &event) throw ();
62 
67  void onUpdateBeacon(const ibrcommon::vinterface &iface, DiscoveryBeacon &beacon)
69 
77 
89  void queue(const dtn::core::Node &node,
90  const dtn::net::BundleTransfer &job);
91 
95  virtual const std::string getName() const;
96 
97  protected:
98  void __cancellation() throw ();
99 
100  void componentUp() throw ();
101  void componentDown() throw ();
102 
103  private:
107  const dtn::daemon::Configuration::EMail& _config;
108 
112  EMailSmtpService& _smtp;
113 
117  EMailImapService& _imap;
118 
122  size_t _lastSmtpTaskTime;
123 
127  size_t _lastImapTaskTime;
128  };
129  }
130 }
131 
132 #endif /* EMAILCONVERGENCELAYER_H_ */
virtual const std::string getName() const
void raiseEvent(const dtn::core::TimeEvent &event)
void onUpdateBeacon(const ibrcommon::vinterface &iface, DiscoveryBeacon &beacon)
void queue(const dtn::core::Node &node, const dtn::net::BundleTransfer &job)
dtn::core::Node::Protocol getDiscoveryProtocol() const