1 /*------------------------------------------------------------------------------
 2 Name:      I_ConnectionProblems.h
 3 Project:   xmlBlaster.org
 4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
 5 Comment:   Helper to easy get the callback messages
 6 ------------------------------------------------------------------------------*/
 7 
 8 /**
 9  * Callback the client from XmlBlasterConnection if the connection to xmlBlaster is lost
10  * or was reestablished (failsafe mode).
11  * <p>
12  * @version $Revision: 1.10 $
13  * @author <a href='xmlBlaster@marcelruff.info'>Marcel Ruff</a>
14  * @author <a href='laghi@swissinfo.org'>Michele Laghi</a>
15  */
16 
17 #ifndef _CLIENT_ICONNECTIONPROBLEMS_H
18 #define _CLIENT_ICONNECTIONPROBLEMS_H
19 
20 #include <util/dispatch/I_ConnectionsHandler.h>
21 //namespace org { namespace xmlBlaster { namespace util { namespace dispatch {
22 //   class I_ConnectionsHandler;
23 //}}}}
24 
25 namespace org { namespace xmlBlaster { namespace client {
26 
27 typedef enum org::xmlBlaster::util::dispatch::States StatesEnum;
28 
29 class Dll_Export I_ConnectionProblems
30 {
31 public:
32    virtual ~I_ConnectionProblems() {}
33 
34    /**
35     * This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler
36     * notifying the client that a connection has been established and that its status is now ALIVE.
37     * It has a bool return which informs the org::xmlBlaster::util::dispatch::ConnectionsHandler what to do with the entries in the queue. 
38     * If you return 'true', then the queue is flushed (i.e. the contents of the queue are sent to 
39     * xmlBlaster). If you return 'false', then the contents of the queue are left untouched. You can then 
40     * erase all entries manually. Note that this method is invoked also when the connection has been 
41     * established the first time.
42     */
43    virtual bool reachedAlive(
44                   org::xmlBlaster::client::StatesEnum oldState,
45                   org::xmlBlaster::util::dispatch::I_ConnectionsHandler* connectionsHandler) = 0;
46 
47    /**
48     * This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler
49     * informing the client that the connection was lost (i.e. when the state of the
50     * connectionsHandler has gone to DEAD).
51     */
52    virtual void reachedDead(
53                   org::xmlBlaster::client::StatesEnum oldState,
54                   org::xmlBlaster::util::dispatch::I_ConnectionsHandler* connectionsHandler) = 0;
55 
56    /**
57     * This is the callback method invoked from org::xmlBlaster::util::dispatch::ConnectionsHandler
58     * informing the client that the connection state has changed to POLLING.
59     */
60    virtual void reachedPolling(
61                   org::xmlBlaster::client::StatesEnum oldState,
62                   org::xmlBlaster::util::dispatch::I_ConnectionsHandler* connectionsHandler) = 0;
63 
64 };
65 
66 }}} // namespace 
67 
68 #endif


syntax highlighted by Code2HTML, v. 0.9.1