|
xmlBlaster 1.5.1 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.recorder.file.FileRecorder
Records requests of the client into a file, if the client is not able to connect to the xmlBlaster. By implementing the I_InvocationRecorder it can be plugged into the xmlBlaster. This implementation is very similar to the implementation of RamRecorder for the xmlBlaster ($XMLBLASTER_HOME/src/java/org/xmlBlaster/util/recorder/ram).
Configuration:RecorderPlugin[FileRecorder][1.0]=org.xmlBlaster.util.recorder.file.FileRecorderSee the util.recorder requirement.
org.xmlBlaster.test.qos.TestFailSave
,
InvocationRecorderTest
Field Summary | |
private boolean |
autoCommit
Automatically write curr pos to file? |
private EraseReturnQos[] |
dummyEraseReturnQosArr
|
private MsgUnit[] |
dummyMArr
|
private PublishReturnQos |
dummyPubRet
|
private PublishReturnQos[] |
dummyPubRetQosArr
|
private SubscribeReturnQos |
dummySubRet
|
private UnSubscribeReturnQos[] |
dummyUnSubRet
|
private java.lang.String |
fileName
|
private Global |
glob
|
private static java.util.logging.Logger |
log
|
private java.lang.String |
ME
|
private FileIO |
rb
|
private I_XmlBlaster |
serverCallback
|
Constructor Summary | |
FileRecorder()
|
Method Summary | |
private void |
callback(RequestContainer cont)
|
private java.lang.String |
createPathString(java.lang.String fn)
Returns the name of the file to store tail back messages. |
void |
destroy()
deletes the file |
EraseReturnQos[] |
erase(java.lang.String xmlKey,
java.lang.String qos)
storing erase request |
MsgUnit[] |
get(java.lang.String xmlKey,
java.lang.String qos)
storing get request |
java.lang.String |
getFullFileName()
Returns the name of the database file or null if RAM based |
long |
getNumLost()
How many messages are silently lost in 'discard' or 'discardOldest' mode? |
long |
getNumUnread()
Number of requests buffered |
java.lang.String |
getType()
Return plugin type for Plugin loader |
java.lang.String |
getVersion()
Return plugin version for Plugin loader |
void |
init(Global glob,
PluginInfo pluginInfo)
This method is called by the PluginManager (enforced by I_Plugin). |
void |
initialize(Global glob,
java.lang.String fn,
long maxEntries,
I_XmlBlaster serverCallback)
Setup the file name. |
boolean |
isFull()
Dummy method. |
boolean |
ping()
|
void |
playback(long startDate,
long endDate,
double motionFactor)
Not implemented yet |
PublishReturnQos |
publish(MsgUnit msgUnit)
storing publish request |
PublishReturnQos[] |
publishArr(MsgUnit[] msgUnitArr)
storing publishArr request |
void |
publishOneway(MsgUnit[] msgUnitArr)
storing publishOneway request |
void |
pullback(float msgPerSec)
Playback the stored messages, the are removed from the recorder after the callback. |
void |
pullback(long startDate,
long endDate,
double motionFactor)
This method reads out stored requests from the file where they were buffered. |
void |
setMode(java.lang.String mode)
|
void |
shutdown()
Cleans up the resource. |
SubscribeReturnQos |
subscribe(java.lang.String xmlKey,
java.lang.String qos)
storing subscribe request |
UnSubscribeReturnQos[] |
unSubscribe(java.lang.String xmlKey,
java.lang.String qos)
storing unSubscribe request |
java.lang.String[] |
update(java.lang.String cbSessionId,
MsgUnit[] msgUnitArr)
storing update request |
void |
updateOneway(java.lang.String cbSessionId,
MsgUnit[] msgUnitArr)
storing updateOneway request |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final java.lang.String ME
private Global glob
private static java.util.logging.Logger log
private FileIO rb
private java.lang.String fileName
private I_XmlBlaster serverCallback
private final MsgUnit[] dummyMArr
private final PublishReturnQos[] dummyPubRetQosArr
private PublishReturnQos dummyPubRet
private SubscribeReturnQos dummySubRet
private UnSubscribeReturnQos[] dummyUnSubRet
private final EraseReturnQos[] dummyEraseReturnQosArr
private boolean autoCommit
Constructor Detail |
public FileRecorder()
Method Detail |
public void initialize(Global glob, java.lang.String fn, long maxEntries, I_XmlBlaster serverCallback) throws XmlBlasterException
Persistence.Path=${user.home}${file.separator}tmp recorder.path=${Persistence.Path}${file.separator}fileRecorder The file name is tailback-[clientClusterNodeId]-[serverClusterNodeId].frc For example: /home/michelle/tmp/fileRecorder/tailback-heron-to-avalon.frc
initialize
in interface I_InvocationRecorder
fn
- The file name (without path information!) for persistence or null (will be generated or ignored if RAM based)maxEntries
- The maximum number of invocations to storeserverCallback
- You need to implement I_XmlBlaster to receive the invocations on playback
null if you are not interested in those
XmlBlasterException
private java.lang.String createPathString(java.lang.String fn)
For an ordinary client 'joe' with public session id 9 /home/xmlblast/tmp/fileRecorder/tailback-joe9-to-frodo.frc In a cluster environment (which only logs in once (exactly one session): /home/xmlblast/tmp/fileRecorder/tailback-bilbo-to-heron.frc (in cluster environment)See the util.recorder requirement on how to configure.
fn
- The file name, without any path information or null
public java.lang.String getFullFileName()
getFullFileName
in interface I_InvocationRecorder
public void init(Global glob, PluginInfo pluginInfo)
init
in interface I_Plugin
I_Plugin.init(org.xmlBlaster.util.Global,org.xmlBlaster.util.plugin.PluginInfo)
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public void setMode(java.lang.String mode)
setMode
in interface I_InvocationRecorder
mode
- ONOVERFLOW_DEADMESSAGE = "deadMessage",
ONOVERFLOW_DISCARD = "discard", ONOVERFLOW_DISCARDOLDEST = "discardOldest",
ONOVERFLOW_EXCEPTION = "exception"public final boolean isFull() throws XmlBlasterException
isFull
in interface I_InvocationRecorder
XmlBlasterException
public final long getNumUnread()
getNumUnread
in interface I_InvocationRecorder
public void pullback(long startDate, long endDate, double motionFactor) throws XmlBlasterException
pullback
in interface I_InvocationRecorder
startDate
- Start date for playback, 0 means from the very startendDate
- End date to stop playback, pass 0 to go to the very endmotionFactor
- for fast motion choose for example 4.0
so four reals seconds are elapsing in one second.XmlBlasterException
public void pullback(float msgPerSec) throws XmlBlasterException
pullback
in interface I_InvocationRecorder
msgPerSec
- 20. is 20 msg/sec, 0.1 is one message every 10 secondsXmlBlasterException
public long getNumLost()
getNumLost
in interface I_InvocationRecorder
public void playback(long startDate, long endDate, double motionFactor) throws XmlBlasterException
playback
in interface I_InvocationRecorder
startDate
- Start date for playback, 0 means from the very startendDate
- End date to stop playback, pass 0 to go to the very endmotionFactor
- for fast motion choose for example 4.0
so four reals seconds are elapsing in one second.XmlBlasterException
private void callback(RequestContainer cont) throws XmlBlasterException
XmlBlasterException
public SubscribeReturnQos subscribe(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
subscribe
in interface I_XmlBlaster
XmlBlasterException
public UnSubscribeReturnQos[] unSubscribe(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
unSubscribe
in interface I_XmlBlaster
XmlBlasterException
public PublishReturnQos publish(MsgUnit msgUnit) throws XmlBlasterException
publish
in interface I_XmlBlaster
XmlBlasterException
public void publishOneway(MsgUnit[] msgUnitArr) throws XmlBlasterException
publishOneway
in interface I_XmlBlaster
XmlBlasterException
public PublishReturnQos[] publishArr(MsgUnit[] msgUnitArr) throws XmlBlasterException
publishArr
in interface I_XmlBlaster
XmlBlasterException
public EraseReturnQos[] erase(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
erase
in interface I_XmlBlaster
XmlBlasterException
public MsgUnit[] get(java.lang.String xmlKey, java.lang.String qos) throws XmlBlasterException
get
in interface I_XmlBlaster
XmlBlasterException
public boolean ping()
public java.lang.String[] update(java.lang.String cbSessionId, MsgUnit[] msgUnitArr) throws XmlBlasterException
XmlBlasterException
public void updateOneway(java.lang.String cbSessionId, MsgUnit[] msgUnitArr)
public void destroy()
destroy
in interface I_InvocationRecorder
public void shutdown()
I_Plugin
shutdown
in interface I_Plugin
|
xmlBlaster 1.5.1 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |