|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.engine.DeadMessageDumper
public class DeadMessageDumper
Subscribes to the "__sys__deadMessage" topic and dumps the dead messages to the hard disk.
The dumped messages are xml formatted and can be resend with XmlScriptInterpreter
:
java org.xmlBlaster.Main -xmlBlaster/acceptWrongSenderAddress/joe true java javaclients.script.XmlScript -prepareForPublish true -session.name joe -requestFile 2004-10-23_21_25_33_39.xml
In the above example xmlBlaster allows 'joe' to send faked sender addresses (the original ones) with the command line parameter -xmlBlaster/acceptWrongSenderAddress/joe true.
This DeadMessageDumper plugin is started with the run level manager as configured in xmlBlasterPlugins.xml, for example:
<plugin id='DeadMessageDumper' className='org.xmlBlaster.engine.DeadMessageDumper'> <action do='LOAD' onStartupRunlevel='7' sequence='1' onFail='resource.configuration.pluginFailed'/> <action do='STOP' onShutdownRunlevel='6' sequence='1'/> <attribute id='loginName'>_DeadMessageDumper</attribute> <attribute id='password'>secret</attribute> <attribute id='directoryName'>/tmp</attribute> <attribute id='receiverSubdir'>true</attribute> <attribute id='forceBase64'>false</attribute> </plugin>
The directorName defaults to $HOME/tmp and foceBase64=false tries to dump the message content in human readable form (if the message dump xml syntax allows it). If the directory does not exist, it is created automatically.
We use the LOCAL protocol driver to talk to xmlBlaster, therefor this plugin works only if the client and server is in the same virtual machine (JVM).
A typical authorization line in xmlBlaster.htpasswd could be:
_DeadMessageDumper:yZfKBiZG8:connect,disconnect,subscribe(exact:__sys__deadMessage)
Field Summary | |
---|---|
private I_XmlBlasterAccess |
connection
|
private java.lang.String |
directoryName
|
private boolean |
forceBase64
forceBase64==false: ASCII dump for content if possible (XML embedable) |
private Global |
global
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
loginName
|
private static java.lang.String |
ME
|
private java.lang.String |
password
|
private PluginInfo |
pluginInfo
|
private long |
pubSessionId
|
private boolean |
receiverSubdir
|
Constructor Summary | |
---|---|
DeadMessageDumper()
|
Method Summary | |
---|---|
private void |
dumpMessage(UpdateKey updateKey,
byte[] content,
UpdateQos updateQos)
Dump dead message to hard disk. |
java.lang.String |
getType()
|
java.lang.String |
getVersion()
|
void |
init(Global glob,
PluginInfo pluginInfo)
Initializes the plugin |
private java.io.File |
initDirectory(java.io.File parent,
java.lang.String propName,
java.lang.String dirName)
Returns the specified directory or null or if needed it will create one |
void |
shutdown()
Shutdown the plugin |
private void |
subscribeToDeadMessages()
On startup subscribe to topic __sys__deadMessage. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String ME
private PluginInfo pluginInfo
private Global global
private static java.util.logging.Logger log
private I_XmlBlasterAccess connection
private java.lang.String directoryName
private java.lang.String loginName
private long pubSessionId
private java.lang.String password
private boolean forceBase64
private boolean receiverSubdir
Constructor Detail |
---|
public DeadMessageDumper()
Method Detail |
---|
public void init(Global glob, PluginInfo pluginInfo) throws XmlBlasterException
init
in interface I_Plugin
XmlBlasterException
I_Plugin.init(org.xmlBlaster.util.Global, org.xmlBlaster.util.plugin.PluginInfo)
public java.lang.String getType()
getType
in interface I_Plugin
I_Plugin.getType()
public java.lang.String getVersion()
getVersion
in interface I_Plugin
I_Plugin.getVersion()
public void shutdown() throws XmlBlasterException
shutdown
in interface I_Plugin
XmlBlasterException
- if an exception occurs. The exception is
handled by the RunLevelManager depending on how the plugin has been
configured with the action:
<action do='STOP' onShutdownRunlevel='2' sequence='5'
onFail='resource.configuration.pluginFailed'>
If onFail is defined to something, the RunLevelManager will stop.I_Plugin.shutdown()
private void subscribeToDeadMessages() throws XmlBlasterException
XmlBlasterException
private void dumpMessage(UpdateKey updateKey, byte[] content, UpdateQos updateQos)
private java.io.File initDirectory(java.io.File parent, java.lang.String propName, java.lang.String dirName) throws XmlBlasterException
parent
- propName
- For logging onlydirName
-
XmlBlasterException
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |