org.apache.jackrabbit.core.journal
Class DatabaseJournal

java.lang.Object
  extended by org.apache.jackrabbit.core.journal.AbstractJournal
      extended by org.apache.jackrabbit.core.journal.DatabaseJournal
All Implemented Interfaces:
Journal

public class DatabaseJournal
extends AbstractJournal

Database-based journal implementation. Stores records inside a database table named JOURNAL, whereas the table GLOBAL_REVISION contains the highest available revision number. These tables are located inside the schema specified in schemaObjectPrefix.

It is configured through the following properties:


Field Summary
protected  String schemaObjectPrefix
          Schema object prefix, bean property.
 
Constructor Summary
DatabaseJournal()
           
 
Method Summary
protected  long append(String producerId, 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 getDriver()
          Bean getters
 String getPassword()
           
protected  RecordIterator getRecords(long startRevision)
          Return an iterator over all records after the specified revision.
 String getSchema()
           
 String getSchemaObjectPrefix()
           
 String getUrl()
           
 String getUser()
           
 void init(String id, NamespaceResolver resolver)
          Initialize journal.
 void setDriver(String driver)
          Bean setters
 void setPassword(String password)
           
 void setSchema(String schema)
           
 void setSchemaObjectPrefix(String schemaObjectPrefix)
           
 void setUrl(String url)
           
 void setUser(String user)
           
 
Methods inherited from class org.apache.jackrabbit.core.journal.AbstractJournal
createProducer, doSync, getConsumer, getId, getProducer, getResolver, lockAndSync, register, sync, unlock, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

schemaObjectPrefix

protected String schemaObjectPrefix
Schema object prefix, bean property.

Constructor Detail

DatabaseJournal

public DatabaseJournal()
Method Detail

init

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

Specified by:
init in interface Journal
Overrides:
init in class AbstractJournal
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

getRecords

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

Specified by:
getRecords in class AbstractJournal
Parameters:
startRevision - start point (exlusive)
Throws:
JournalException - if an error occurs

doLock

protected void doLock()
               throws JournalException
Lock the journal revision. Subclass responsibility.

Specified by:
doLock in class AbstractJournal
Throws:
JournalException - if an error occurs

doUnlock

protected void doUnlock(boolean successful)
Unlock the journal revision. Subclass responsibility.

Specified by:
doUnlock in class AbstractJournal
Parameters:
successful - flag indicating whether the update process was successful

append

protected long append(String producerId,
                      InputStream in,
                      int length)
               throws JournalException
Append a record backed by a file. Subclass responsibility.

Specified by:
append in class AbstractJournal
Parameters:
producerId - producer identifier
in - input stream
length - number of bytes in input stream
Returns:
the new record's revision
Throws:
JournalException - if an error occurs

close

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


getDriver

public String getDriver()
Bean getters


getUrl

public String getUrl()

getSchema

public String getSchema()

getSchemaObjectPrefix

public String getSchemaObjectPrefix()

getUser

public String getUser()

getPassword

public String getPassword()

setDriver

public void setDriver(String driver)
Bean setters


setUrl

public void setUrl(String url)

setSchema

public void setSchema(String schema)

setSchemaObjectPrefix

public void setSchemaObjectPrefix(String schemaObjectPrefix)

setUser

public void setUser(String user)

setPassword

public void setPassword(String password)


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