xmlBlaster 2.2.0 client API

org.xmlBlaster.util.dispatch.plugins.prio
Class XmlBlasterNativeClient

java.lang.Object
  extended by org.xmlBlaster.util.dispatch.plugins.prio.XmlBlasterNativeClient
All Implemented Interfaces:
I_Callback

public final class XmlBlasterNativeClient
extends java.lang.Object
implements I_Callback

Helper class encapsulates xmlBlaster access for PriorizedDispatchPlugin.

We subscribe to a status message which describes the current connection to the remote side.

Exactly one instance of this class exists in the Global scope, the shutdown is triggered by util.Global using DispatchPluginManager.shutdown()

Author:
xmlBlaster@marcelruff.info

Constructor Summary
XmlBlasterNativeClient(Global glob_, PriorizedDispatchPlugin plugin, java.lang.String sessionId)
          Creates a remote client to xmlBlaster.
 
Method Summary
 java.lang.String getLoginName()
           
 void sendPtPMessage(MsgQueueEntry entry, java.lang.String pluginName, java.lang.String action, java.lang.String currStatus)
          Send a PtP message to the publisher notifying him on problems about dispatching his just published message.
 void subscribeToStatusMessage(java.lang.String msgOid, I_Notify callback)
          We subscribe to the status message (e.g.
 void unSubscribeStatusMessages(I_Notify callback)
          Unsubscribe from all status messages, usually if configuration has changed.
 java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos)
          Callback from xmlBlaster core
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlBlasterNativeClient

public XmlBlasterNativeClient(Global glob_,
                              PriorizedDispatchPlugin plugin,
                              java.lang.String sessionId)
                       throws XmlBlasterException
Creates a remote client to xmlBlaster.

Throws:
XmlBlasterException
Method Detail

getLoginName

public java.lang.String getLoginName()

sendPtPMessage

public final void sendPtPMessage(MsgQueueEntry entry,
                                 java.lang.String pluginName,
                                 java.lang.String action,
                                 java.lang.String currStatus)
                          throws XmlBlasterException
Send a PtP message to the publisher notifying him on problems about dispatching his just published message.

The message oid remains the same as that one published

The sender of this PtP message is the loginName of the plugin itself - to avoid looping we check the sender name in our plugin

Throws:
XmlBlasterException

subscribeToStatusMessage

public void subscribeToStatusMessage(java.lang.String msgOid,
                                     I_Notify callback)
                              throws XmlBlasterException
We subscribe to the status message (e.g. "_bandwidth.status') which switches our operational mode. Take care not to invoke it twice for the same message oid, on configuration change call unsSubscribeStatusMessage() first.

Throws:
XmlBlasterException

unSubscribeStatusMessages

public void unSubscribeStatusMessages(I_Notify callback)
Unsubscribe from all status messages, usually if configuration has changed.


update

public java.lang.String update(java.lang.String cbSessionId,
                               UpdateKey updateKey,
                               byte[] content,
                               UpdateQos updateQos)
Callback from xmlBlaster core

Specified by:
update in interface I_Callback
Parameters:
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:
I_XmlBlasterAccess

xmlBlaster 2.2.0 client API

Copyright © 1999-2014 The xmlBlaster.org contributers.