|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.client.script.StreamCallback
public class StreamCallback
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.
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)
global
- The globalout
- 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)
content
- the content to writebuf
- the StringBuffer object to fill with the contentpublic java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
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 namecontent
- The arrived message content. This is your payload.
XmlBlasterException
I_XmlBlasterAccess
|
xmlBlaster 2.2.0 client API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |