|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.journal.AbstractJournal
org.apache.jackrabbit.core.journal.FileJournal
public class FileJournal
File-based journal implementation that appends journal records to a single file.
It is configured through the following properties:revision
: the filename where the parent cluster node's revision
file should be written to; this is a required property with no default valuedirectory
: the directory where to keep the journal file as
well as the rotated files; this is a required property with no default valuebasename
: the basename of journal files; the default
value is DEFAULT_BASENAME
maximumSize
: the maximum size of an active journal file
before rotating it: the default value is DEFAULT_MAXSIZE
Field Summary | |
---|---|
static String |
DEFAULT_INSTANCE_FILE_NAME
Default instance revision file name. |
Constructor Summary | |
---|---|
FileJournal()
|
Method Summary | |
---|---|
protected void |
append(AppendRecord record,
InputStream in,
int length)
Append a record backed by a file. |
void |
close()
Close this journal. |
protected void |
doLock()
Lock the journal revision. |
protected void |
doUnlock(boolean successful)
Unlock the journal revision. |
String |
getBasename()
|
String |
getDirectory()
Bean getters |
protected long |
getGlobalRevision()
|
InstanceRevision |
getInstanceRevision()
Gets the instance that manages the cluster node's local revision. |
int |
getMaximumSize()
|
RecordIterator |
getRecords()
Return an iterator over all available records in the journal. |
RecordIterator |
getRecords(long startRevision)
Return an iterator over all records after the specified revision. |
void |
init(String id,
NamespaceResolver resolver)
Initialize journal. |
void |
setBasename(String basename)
|
void |
setDirectory(String directory)
Bean setters |
void |
setMaximumSize(int maximumSize)
|
Methods inherited from class org.apache.jackrabbit.core.journal.AbstractJournal |
---|
appending, createProducer, doSync, getConsumer, getId, getNamePathResolver, getProducer, getRepositoryHome, getResolver, getRevision, lockAndSync, register, setRepositoryHome, setRevision, sync, unlock, unregister |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_INSTANCE_FILE_NAME
Constructor Detail |
---|
public FileJournal()
Method Detail |
---|
public void init(String id, NamespaceResolver resolver) throws JournalException
init
in interface Journal
init
in class AbstractJournal
id
- id this journal should use to write its own recordsresolver
- resolver used when reading/writing records
JournalException
- if an error occursprotected long getGlobalRevision() throws JournalException
JournalException
public RecordIterator getRecords(long startRevision) throws JournalException
startRevision
- start point (exlusive)
JournalException
- if an error occurspublic RecordIterator getRecords() throws JournalException
JournalException
- if an error occursprotected void doLock() throws JournalException
doLock
in class AbstractJournal
JournalException
- if an error occursprotected void append(AppendRecord record, InputStream in, int length) throws JournalException
append
in class AbstractJournal
record
- record to appendin
- input streamlength
- number of bytes in input stream
JournalException
- if an error occursprotected void doUnlock(boolean successful)
doUnlock
in class AbstractJournal
successful
- flag indicating whether the update process was
successfulpublic void close()
public InstanceRevision getInstanceRevision() throws JournalException
JournalException
- on errorpublic String getDirectory()
public String getBasename()
public int getMaximumSize()
public void setDirectory(String directory)
public void setBasename(String basename)
public void setMaximumSize(int maximumSize)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |