|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.space4j.implementation.SimpleLogger
public class SimpleLogger
| Constructor Summary | |
|---|---|
SimpleLogger(java.lang.String dirname)
Initializes this SimpleLogger. |
|
| Method Summary | |
|---|---|
long |
getLogNumber()
Get the current log number. |
void |
logCommand(Command cmd)
Log a command to a log file on disk. |
Space |
readSnapshot()
Recover the last snapshot from disk and recreate a Space from it. |
void |
reapplyCommandsFromLog(Space4J space4j)
Read the last commands from the log and re-apply them to this Space4J. |
void |
takeSnapshot(Space space)
Take a snapshot of the Space to disk. |
void |
takeSnapshot(Space space,
long snapnumber)
Take a snapshot of the Space to disk. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleLogger(java.lang.String dirname)
dirname - The dir where to store the files.| Method Detail |
|---|
public long getLogNumber()
Logger
getLogNumber in interface Logger
public void logCommand(Command cmd)
throws LoggerException
Logger
logCommand in interface Loggercmd - The command to log
LoggerException
public void takeSnapshot(Space space)
throws LoggerException
Logger
takeSnapshot in interface Loggerspace - The space to be saved.
LoggerException
public void takeSnapshot(Space space,
long snapnumber)
throws LoggerException
Logger
takeSnapshot in interface Loggerspace - The space to be saved.snapnumber - The number of the snapshot to be saved.
LoggerException
public Space readSnapshot()
throws LoggerException
Logger
readSnapshot in interface LoggerLoggerException
public void reapplyCommandsFromLog(Space4J space4j)
throws LoggerException,
CommandException
Logger
reapplyCommandsFromLog in interface Loggerspace4j - The Space4J that will redo the commands.
LoggerException
CommandException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||