public interface Journal
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this journal.
|
InstanceRevision |
getInstanceRevision()
Gets the instance that manages the cluster node's local revision.
|
RecordProducer |
getProducer(String identifier)
Return the record producer for a given identifier.
|
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 |
register(RecordConsumer consumer)
Register a record consumer.
|
void |
sync(boolean startup)
Synchronize contents from journal.
|
boolean |
unregister(RecordConsumer consumer)
Unregister a record processor.
|
void init(String id, NamespaceResolver resolver) throws JournalException
id
- id this journal should use to write its own recordsresolver
- resolver used when reading/writing recordsJournalException
- if an error occursvoid register(RecordConsumer consumer) throws JournalException
consumer
- record consumerJournalException
- if an error occursboolean unregister(RecordConsumer consumer)
consumer
- record processor to unregistertrue
if the consumer was previously registered;
false
otherwisevoid sync(boolean startup) throws JournalException
RecordConsumer.consume(org.apache.jackrabbit.core.journal.Record)
method when their identifier
matches the one found in the records.
The startup flag allow for a separate treatment of the initial sync
when the cluster nodes starts up. This might be needed for example
when there are a lot of old revisions in a database.startup
- indicates if the cluster node is syncing on startup
or does a normal sync.JournalException
- if an error occursRecordProducer getProducer(String identifier) throws JournalException
identifier
- identifierJournalException
- if an error occursvoid close()
InstanceRevision getInstanceRevision() throws JournalException
JournalException
- on errorRecordIterator getRecords(long startRevision) throws JournalException
startRevision
- start point (exlusive)JournalException
- if an error occursRecordIterator getRecords() throws JournalException
JournalException
- if an error occursCopyright © 2004–2021 The Apache Software Foundation. All rights reserved.