1 /*------------------------------------------------------------------------------
2 Name: I_CallbackServer.h
3 Project: xmlBlaster.org
4 Copyright: xmlBlaster.org, see xmlBlaster-LICENSE file
5 Comment: Interface for clients, used by xmlBlaster to send messages back
6 ------------------------------------------------------------------------------*/
7
8
9 /**
10 * This is the client callback interface to xmlBlaster.
11 * <p />
12 * All callback protocol drivers are accessed through these methods.
13 * We need it to decouple the protocol specific stuff
14 * (like RemoteException from SOCKET or CORBA exceptions) from
15 * our c++ client code.
16 * <p />
17 * Note that you don't need this code, you can access xmlBlaster
18 * with your own lowlevel SOCKET or CORBA coding as well.
19 *
20 * @see org.xmlBlaster.client.protocol.I_XmlBlasterConnection
21 * @author <a href="mailto:xmlBlaster@marcelruff.info">Marcel Ruff</a>.
22 * @author <a href="mailto:laghi@swissinfo.org">Michele Laghi</a>.
23 */
24
25 #ifndef _CLIENT_PROTOCOL_I_CALLBACKSERVER
26 #define _CLIENT_PROTOCOL_I_CALLBACKSERVER
27
28 #include <util/xmlBlasterDef.h>
29 #include <string>
30 #include <client/I_Callback.h>
31 #include <client/protocol/I_ProgressListener.h>
32
33 namespace org { namespace xmlBlaster { namespace client { namespace protocol {
34
35 class Dll_Export I_CallbackServer
36 {
37 public:
38
39 virtual ~I_CallbackServer()
40 {
41 }
42
43 /**
44 * Initialize and start the callback server.
45 * <p />
46 * This is guaranteed to be invoked after the default constructor.
47 * @param glob The global handle with your environment settings
48 * @param name The login name of the client, for logging only
49 * @param client Your implementation to receive the callback messages from xmlBlaster
50 */
51 virtual void initialize(const std::string& name, org::xmlBlaster::client::I_Callback &client) = 0;
52
53 /**
54 * Returns the 'well known' protocol type.
55 * @return E.g. "RMI", "SOCKET", "XMLRPC"
56 */
57 virtual std::string getCbProtocol() = 0;
58
59 /**
60 * Returns the current callback address.
61 * @return "rmi://develop.MarcelRuff.info:1099/xmlBlasterCB", "127.128.2.1:7607", "http://XMLRPC"
62 * or null if not known
63 */
64 virtual std::string getCbAddress() = 0;
65
66 /**
67 * Stop the server
68 * @return true if everything went fine.
69 */
70 virtual bool shutdownCb() = 0;
71
72 /**
73 * Register a listener for to receive information about the progress of incoming data.
74 * Only one listener is supported, the last call overwrites older calls.
75 * @param listener Your listener, pass 0 to unregister.
76 * @return The previously registered listener or 0
77 */
78 virtual org::xmlBlaster::client::protocol::I_ProgressListener* registerProgressListener(org::xmlBlaster::client::protocol::I_ProgressListener *listener) = 0;
79 };
80
81 }}}} // namespaces
82
83 #endif
syntax highlighted by Code2HTML, v. 0.9.1