1 /*-----------------------------------------------------------------------------
 2 Name:      I_Callback.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 #ifndef _CLIENT_ICALLBACK_H
 9 #define _CLIENT_ICALLBACK_H
10 
11 #include <string>
12 #include <client/key/UpdateKey.h>
13 #include <client/qos/UpdateQos.h>
14 
15 namespace org { namespace xmlBlaster { namespace client {
16 /**
17  * This is a little helper class wraps the CORBA BlasterCallback update(),
18  * and delivers the client a nicer update() method. <p>
19  * You may use this, if you don't want to program with the rawer CORBA 
20  * BlasterCallback.update()
21  *
22  * @author laghi
23  */
24 class Dll_Export I_Callback {
25    /**
26     * This is the callback method invoked from CorbaConnection
27     * informing the client in an asynchronous mode about a new message.
28     * <p />The raw BlasterCallback.update() is unpacked and for each 
29     * arrived message this update is called. <p />
30     * So you should implement in your client the I_Callback interface -
31     * suppling the update() method where you can do with the message 
32     * whatever you want. <p />
33     * If you do multiple logins with the same I_Callback implementation, 
34     * the loginName which is delivered with this update() method may be 
35     * used to dispatch the message to the correct client.
36     *
37     * @param sessionId The sessionId to authenticate the callback
38     *                  This sessionId was passed on subscription
39     *                  we can use it to decide if we trust this update()
40     * @param updateKey The arrived key
41     * @param content   The arrived message content. If the size is 0 it is NULL
42     * @param contentSize the size of the content of the message
43     * @param qos       Quality of Service of the org::xmlBlaster::util::MessageUnit
44     * @return The status std::string
45     */
46    
47 public:
48    virtual std::string update(const std::string &sessionId,
49                        org::xmlBlaster::client::key::UpdateKey &updateKey, 
50                        const unsigned char *content, long contentSize, 
51                        org::xmlBlaster::client::qos::UpdateQos &updateQos) = 0;
52 
53    virtual ~I_Callback() // = 0;
54    {
55    }
56 
57 
58 };
59 }}} // namespace
60 
61 #endif


syntax highlighted by Code2HTML, v. 0.9.1