|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.prevayler.implementation.PrevaylerDirectory
public class PrevaylerDirectory
Constructor Summary | |
---|---|
PrevaylerDirectory(File directory)
|
|
PrevaylerDirectory(String directory)
|
Method Summary | |
---|---|
static void |
checkValidJournalSuffix(String suffix)
Ensure that the given suffix (which should not include a dot) is valid for journals. |
static void |
checkValidSnapshotSuffix(String suffix)
Ensure that the given suffix (which should not include a dot) is valid for snapshots. |
File |
createTempFile(String prefix,
String suffix)
Create a temporary file in the directory. |
File |
findInitialJournalFile(long initialTransactionWanted)
Find the journal file containing the desired transaction. |
File |
journalFile(long transaction,
String suffix)
Generate a valid journal filename. |
static long |
journalVersion(File file)
Extract the version number from a journal filename. |
File |
latestSnapshot()
Find the latest snapshot file. |
Set |
necessaryFiles()
Determine which snapshot and journal files are still necessary for recovery. |
void |
produceDirectory()
Ensure that the directory exists, creating it and parent directories if necessary. |
static void |
renameUnusedFile(File journalFile)
Rename a journal file to indicate it was found empty and is being ignored. |
File |
snapshotFile(long version,
String suffix)
Generate a valid snapshot filename. |
static long |
snapshotVersion(File file)
Extract the version number from a snapshot filename. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrevaylerDirectory(String directory)
public PrevaylerDirectory(File directory)
Method Detail |
---|
public void produceDirectory() throws IOException
IOException
- if the directory can't be created or isn't a directory.public static void checkValidSnapshotSuffix(String suffix)
IllegalArgumentException
- otherwise.public static void checkValidJournalSuffix(String suffix)
IllegalArgumentException
- otherwise.public File snapshotFile(long version, String suffix)
IllegalArgumentException
- if the version is negative or the suffix is invalid.public File journalFile(long transaction, String suffix)
IllegalArgumentException
- if the version is negative or the suffix is invalid.public static long snapshotVersion(File file)
public static long journalVersion(File file)
public File latestSnapshot() throws IOException
IOException
public File findInitialJournalFile(long initialTransactionWanted)
public File createTempFile(String prefix, String suffix) throws IOException
IOException
public static void renameUnusedFile(File journalFile)
public Set necessaryFiles() throws IOException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |