xmlBlaster 2.2.0 client API

Class StreamCallback

  extended by org.xmlBlaster.client.script.StreamCallback
All Implemented Interfaces:

public class StreamCallback
extends java.lang.Object
implements I_Callback

StreamCallback is a sample implementation of the I_Callback interface which provides basic functionality as a callback to the XmlScriptInterpreter. It writes the information it gets from the update method to the output stream in an xml formatted way. <p/> If you want another behavior (for example by outputting the content in base64) you can overwrite the writeContent method.

Michele Laghi

Constructor Summary
StreamCallback(Global global, java.io.OutputStream out, java.lang.String offset)
          The constructor
Method Summary
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          Enforced by I_Callback
protected  void writeContent(java.lang.String contentStr, java.lang.StringBuffer buf)
          Invoked in the update method to write out the content in an xml formatted way.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public StreamCallback(Global global,
                      java.io.OutputStream out,
                      java.lang.String offset)
The constructor

global - The global
out - the output stream to which you want to send the information coming to the update method.
offset - the offset to use.
Method Detail


protected void writeContent(java.lang.String contentStr,
                            java.lang.StringBuffer buf)
Invoked in the update method to write out the content in an xml formatted way.

content - the content to write
buf - the StringBuffer object to fill with the content


public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
                        throws XmlBlasterException
Enforced by I_Callback

Specified by:
update in interface I_Callback
cbSessionId - The session ID specified by the client which registered the callback. You can specify a cbSessionId during connection (with ConnectQos) and this is bounced back here so you can authenticate the message.
updateKey - The arrived key containing the topic name
content - The arrived message content. This is your payload.
See Also:

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.