|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jackrabbit.core.journal.FileRecordLog
public class FileRecordLog
A file record log is a file containing Record
s. Every file record
log contains a header with the following physical layout:
After this header, zero or more
Byte 1 Byte 2 Byte 3 Byte 4 'J' 'L' 'O' 'G' MAJOR MINOR START REVISION
ReadRecord
s follow.
Constructor Summary | |
---|---|
FileRecordLog(File logFile)
Create a new instance of this class. |
Method Summary | |
---|---|
long |
append(String journalId,
String producerId,
InputStream in,
int length)
Append a record to this log. |
void |
close()
Close this log. |
boolean |
contains(long revision)
Return a flag indicating whether this record log contains a certain revision. |
boolean |
exceeds(long size)
Return a flag indicating whether this record log exceeds a given size. |
long |
getLastRevision()
Return the last revision. |
long |
getPreviousRevision()
Return the previous revision. |
void |
init(long previousRevision)
Initialize this record log by writing a header containing the previous revision. |
boolean |
isNew()
Return a flag indicating whether this record log is new. |
ReadRecord |
read(NamespaceResolver resolver,
NamePathResolver npResolver)
Read the file record at the current seek position. |
void |
seek(long revision)
Seek an entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileRecordLog(File logFile) throws IOException
logFile
- file containing record log
IOException
- if an I/O error occursMethod Detail |
---|
public void init(long previousRevision) throws IOException
IOException
public boolean contains(long revision)
revision
- revision to look for
true
if this record log contain a certain revision;
false
otherwisepublic boolean isNew()
true
if this record log is new;
false
otherwisepublic boolean exceeds(long size)
public void seek(long revision) throws IOException
revision
- revision to seek
IOException
- if an I/O error occurspublic ReadRecord read(NamespaceResolver resolver, NamePathResolver npResolver) throws IOException
resolver
- namespace resolver
IOException
- if an I/O error occurspublic long append(String journalId, String producerId, InputStream in, int length) throws IOException
journalId
- journal identifierproducerId
- producer identifierin
- record to addlength
- record length
IOException
- if an I/O error occurspublic long getPreviousRevision()
public long getLastRevision()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |