xmlBlaster 2.2.0 API

org.xmlBlaster.protocol
Interface I_CallbackDriver

All Superinterfaces:
I_Plugin
All Known Implementing Classes:
CallbackCorbaDriver, CallbackEmailDriver, CallbackJdbcDriver, CallbackLocalDriver, CallbackRmiDriver, CallbackSocketDriver, CallbackXmlRpcDriver, CallbackXmlRpcDriverSingleChannel, XbStompInOutBridge

public interface I_CallbackDriver
extends I_Plugin

This interface hides the real protocol used to send a client a callback message

Author:
xmlBlaster@marcelruff.info

Method Summary
 java.lang.String getName()
          Get a human readable name of this driver
 java.lang.String getProtocolId()
          Access the xmlBlaster internal name of the protocol driver.
 java.lang.String getRawAddress()
          Return the address how to access this driver.
 void init(Global glob, CallbackAddress callbackAddress)
          Intialize the driver.
 boolean isAlive()
           
 java.lang.String ping(java.lang.String qos)
          Ping to check if the clients callback server instance is alive.
 I_ProgressListener registerProgressListener(I_ProgressListener listener)
          Register a listener for to receive information about the progress of incoming data.
 java.lang.String[] sendUpdate(MsgUnitRaw[] msgArr)
          Send the message update to the client.
 void sendUpdateOneway(MsgUnitRaw[] msgArr)
          The oneway variant, without return value
 
Methods inherited from interface org.xmlBlaster.util.plugin.I_Plugin
getType, getVersion, init, shutdown
 

Method Detail

getName

java.lang.String getName()
Get a human readable name of this driver


init

void init(Global glob,
          CallbackAddress callbackAddress)
          throws XmlBlasterException
Intialize the driver.

Parameters:
callbackAddress - Contains the callback address, e.g. the stringified CORBA callback handle of the client or his email address.
Throws:
XmlBlasterException

getProtocolId

java.lang.String getProtocolId()
Access the xmlBlaster internal name of the protocol driver.

Returns:
e.g. "IOR" "EMAIL" "XMLRPC" depending on driver

getRawAddress

java.lang.String getRawAddress()
Return the address how to access this driver.

Returns:
e.g. "http:/www.mars.universe:8080/RPC2" or "IOR:000034100..."

sendUpdate

java.lang.String[] sendUpdate(MsgUnitRaw[] msgArr)
                              throws XmlBlasterException
Send the message update to the client.

The protocol for sending is implemented in the derived class

Parameters:
msgArr - Array of all messages to send, is guaranteed to never be null
Returns:
Clients should return a qos as follows. An empty qos string "" is valid as well and interpreted as OK
  <qos>
     <state id='OK'/>  <!-- Client processing state OK | ERROR ... see Constants.java -->
  </qos>
 
Throws:
On - callback problems you need to throw an XmlBlasterException and the message will queued until the client logs in again.
NOTE: A remote user may only throw ErrorCode.USER*, you have to check the received ErrorCode and transform it to a e.g ErrorCode.USER_UPDATE_ERROR if it is no user error.
NOTE: All connection problems need to be thrown as ErrorCode.COMMUNICATION* errors.
XmlBlasterException

sendUpdateOneway

void sendUpdateOneway(MsgUnitRaw[] msgArr)
                      throws XmlBlasterException
The oneway variant, without return value

Parameters:
msgArr - Array of all messages to send, is guaranteed to never be null
Throws:
XmlBlasterException - Is never from the client (oneway).

ping

java.lang.String ping(java.lang.String qos)
                      throws XmlBlasterException
Ping to check if the clients callback server instance is alive. This ping checks the availability on the application level, a future implementation could return other values than 'OK' for example to signalize a standby mode of this client.

Parameters:
qos - Currently not looked at, please pass an empty string ""
Returns:
"<qos><state id='OK'/></qos>"
Throws:
On - connection error
XmlBlasterException
See Also:
org.xmlBlaster.protocol.I_XmlBlaster#ping(String)

isAlive

boolean isAlive()
Returns:
true if the plugin is still alive, false otherwise

registerProgressListener

I_ProgressListener registerProgressListener(I_ProgressListener listener)
Register a listener for to receive information about the progress of incoming data. Only one listener is supported, the last call overwrites older calls.

Parameters:
listener - Your listener, pass 0 to unregister.
Returns:
The previously registered listener or 0

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.