|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xmlBlaster.contrib.MomEventEngine
public class MomEventEngine
Field Summary | |
---|---|
private int |
compressSize
|
protected I_XmlBlasterAccess |
con
|
protected ConnectQos |
connectQos
|
protected I_Update |
eventHandler
|
protected Global |
glob
|
private static java.util.logging.Logger |
log
|
protected java.lang.String |
loginName
|
protected java.lang.String |
password
|
protected boolean |
shutdownMom
|
protected java.util.List |
subscribeKeyList
|
protected java.util.List |
subscribeQosList
|
Constructor Summary | |
---|---|
MomEventEngine()
|
Method Summary | |
---|---|
static byte[] |
compress(byte[] buffer,
java.util.Map props,
int compressSizeLimit,
java.lang.String zipType)
Compresses the message if needed. |
static byte[] |
compressOLD(byte[] buffer,
java.util.Map props,
int compressSizeLimit,
java.lang.String zipType)
Deprecated. |
static java.io.InputStream |
decompress(java.io.InputStream is,
java.util.Map clientProperties)
|
static byte[] |
decompressXX(byte[] buffer,
java.util.Map clientProperties)
Deprecated. you should use the one with InputStream instead since less memory hungry (for big messages) |
private static java.lang.String |
dumpProps(java.util.Map clientProperties)
|
XBSession |
getJmsSession()
Only used in replication, can return null if not used. |
java.util.Set |
getUsedPropertyKeys()
Gets all property keys which may be used by this object. |
void |
init(I_Info info)
After creation this method is called. |
java.lang.String |
publish(java.lang.String oid,
byte[] message,
java.util.Map attrMap)
Send the message to the MoM. |
boolean |
registerAlertListener(I_Update update,
java.util.Map attrs)
Register for alerts when the data source has changed. |
void |
shutdown()
Cleanup resources. |
java.lang.String |
update(java.lang.String cbSessionId,
UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
This is the callback method invoked from I_XmlBlasterAccess informing the client in an asynchronous mode about a new message. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static java.util.logging.Logger log
protected Global glob
protected I_XmlBlasterAccess con
protected java.lang.String loginName
protected java.lang.String password
protected java.util.List subscribeKeyList
protected java.util.List subscribeQosList
protected ConnectQos connectQos
protected I_Update eventHandler
protected boolean shutdownMom
private int compressSize
Constructor Detail |
---|
public MomEventEngine()
Method Detail |
---|
public java.util.Set getUsedPropertyKeys()
I_ContribPlugin
getUsedPropertyKeys
in interface I_ContribPlugin
I_ContribPlugin.getUsedPropertyKeys()
public void init(I_Info info) throws java.lang.Exception
I_ChangePublisher
init
in interface I_ChangePublisher
init
in interface I_ContribPlugin
info
- The configuration environment
java.lang.Exception
- MoM specificpublic java.lang.String update(java.lang.String cbSessionId, UpdateKey updateKey, byte[] content, UpdateQos updateQos) throws XmlBlasterException
I_Callback
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
public java.lang.String publish(java.lang.String oid, byte[] message, java.util.Map attrMap) throws java.lang.Exception
I_ChangePublisher
publish
in interface I_ChangePublisher
changeKey
- The topic of the message as a string.message
- the content of the message to publish.
java.lang.Exception
- On sending problemspublic boolean registerAlertListener(I_Update update, java.util.Map attrs) throws java.lang.Exception
I_ChangePublisher
This funtionality is plugin depending, for example the xmlBlaster plugin has a configuration option to subscribe on a alert topic and listens if somebody publishes a message to it. If such a message arrives we trigger a new database poll.
registerAlertListener
in interface I_ChangePublisher
update
- The callback interface to receive the notificationattrs
- extra parameters to pass for the registration. For example
if one implementation wants to do a specific extra subscription it would
pass the quality of service in the attributes.
java.lang.Exception
- The MoM specific exceptionpublic void shutdown()
I_ChangePublisher
Can be called multiple times if instance is reused from different plugins.
shutdown
in interface I_ChangePublisher
shutdown
in interface I_ContribPlugin
I_Plugin
public XBSession getJmsSession()
I_ChangePublisher
getJmsSession
in interface I_ChangePublisher
I_ChangePublisher.getJmsSession()
public static byte[] compressOLD(byte[] buffer, java.util.Map props, int compressSizeLimit, java.lang.String zipType)
buffer
- The buffer to compressprops
- The properties to update with the compressed flag (uncompressed size)compressSizeLimit
- The limit for compression. If less than one no compression
is done. If the size of the buffer is less than this limit it is not compressed either.
public static byte[] compress(byte[] buffer, java.util.Map props, int compressSizeLimit, java.lang.String zipType)
buffer
- The buffer to compressprops
- The properties to update with the compressed flag (uncompressed size)compressSizeLimit
- The limit for compression. If less than one no compression
is done. If the size of the buffer is less than this limit it is not compressed either.
private static final java.lang.String dumpProps(java.util.Map clientProperties)
public static byte[] decompressXX(byte[] buffer, java.util.Map clientProperties)
buffer
- clientProperties
-
public static java.io.InputStream decompress(java.io.InputStream is, java.util.Map clientProperties)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |