org.apache.jackrabbit.core.journal
Interface Journal

All Known Implementing Classes:
AbstractJournal, DatabaseJournal, FileJournal, JNDIDatabaseJournal, MemoryJournal, MSSqlDatabaseJournal, OracleDatabaseJournal

public interface Journal

Generic journal interface.


Method Summary
 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()
          Synchronize contents from journal.
 boolean unregister(RecordConsumer consumer)
          Unregister a record processor.
 

Method Detail

init

void init(String id,
          NamespaceResolver resolver)
          throws JournalException
Initialize journal.

Parameters:
id - id this journal should use to write its own records
resolver - resolver used when reading/writing records
Throws:
JournalException - if an error occurs

register

void register(RecordConsumer consumer)
              throws JournalException
Register a record consumer.

Parameters:
consumer - record consumer
Throws:
JournalException - if an error occurs

unregister

boolean unregister(RecordConsumer consumer)
Unregister a record processor.

Parameters:
consumer - record processor to unregister
Returns:
true if the consumer was previously registered; false otherwise

sync

void sync()
          throws JournalException
Synchronize contents from journal. This will compare the journal's revision with the revisions of all registered consumers and invoke their RecordConsumer.consume(org.apache.jackrabbit.core.journal.Record) method when their identifier matches the one found in the records.

Throws:
JournalException - if an error occurs

getProducer

RecordProducer getProducer(String identifier)
                           throws JournalException
Return the record producer for a given identifier.

Parameters:
identifier - identifier
Returns:
the record producer for a given identifier.
Throws:
JournalException - if an error occurs

close

void close()
Close this journal. This should release any resources still held by this journal.


getInstanceRevision

InstanceRevision getInstanceRevision()
                                     throws JournalException
Gets the instance that manages the cluster node's local revision.

Returns:
the InstanceRevision manager
Throws:
JournalException - on error

getRecords

RecordIterator getRecords(long startRevision)
                          throws JournalException
Return an iterator over all records after the specified revision.

Parameters:
startRevision - start point (exlusive)
Returns:
an iterator over all records after the specified revision.
Throws:
JournalException - if an error occurs

getRecords

RecordIterator getRecords()
                          throws JournalException
Return an iterator over all available records in the journal.

Returns:
an iterator over all records.
Throws:
JournalException - if an error occurs


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.