xmlBlaster 2.2.0 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

Field Summary
private  java.lang.String cbSessionId
           
private  boolean connected
           
private  ConnectQos connectQos
           
private  ConnectReturnQos conRetQos
           
private  Global glob
           
private static java.util.logging.Logger log
           
private  java.lang.String loginName
           
private  java.lang.String ME
           
private  java.util.Map oidListenerMap
          The key is the message oid, the value is a set with listeners
private  java.util.Map subscriptionsByNotifierMap
          The key is a I_Notify instance, the value is a set with SubscriptionReturnQos objects
private  I_XmlBlasterAccess xmlBlasterCon
           
 
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.
(package private)  void shutdown()
           
(package private)  void shutdown(I_Notify callback)
           
 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
 

Field Detail

ME

private java.lang.String ME

glob

private Global glob

log

private static java.util.logging.Logger log

xmlBlasterCon

private I_XmlBlasterAccess xmlBlasterCon

connectQos

private ConnectQos connectQos

conRetQos

private ConnectReturnQos conRetQos

connected

private boolean connected

loginName

private java.lang.String loginName

subscriptionsByNotifierMap

private java.util.Map subscriptionsByNotifierMap
The key is a I_Notify instance, the value is a set with SubscriptionReturnQos objects


oidListenerMap

private java.util.Map oidListenerMap
The key is the message oid, the value is a set with listeners


cbSessionId

private final java.lang.String cbSessionId
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

shutdown

void shutdown(I_Notify callback)

shutdown

void shutdown()
See Also:
I_MsgDispatchInterceptor#shutdown()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.