public class JahiaDatabaseJournal extends JahiaAbstractJournal implements org.apache.jackrabbit.core.util.db.DatabaseAware
| Modifier and Type | Class and Description |
|---|---|
class |
JahiaDatabaseJournal.DatabaseRevision
This class manages the local revision of the cluster node.
|
class |
JahiaDatabaseJournal.RevisionTableJanitor
Class for maintaining the revision table.
|
| Modifier and Type | Field and Description |
|---|---|
protected String |
cleanRevisionStmtSQL
SQL statement removing a set of revisions with from the journal table.
|
static int |
DEFAULT_JANITOR_SLEEP |
protected String |
getLocalRevisionStmtSQL
SQL statement returning the local revision of this cluster node.
|
protected String |
insertLocalRevisionStmtSQL
SQL statement for inserting the local revision of this cluster node.
|
protected String |
insertRevisionStmtSQL
SQL statement appending a new record.
|
protected String |
schemaObjectPrefix
Schema object prefix, bean property.
|
protected String |
selectGlobalStmtSQL
SQL statement returning the global revision.
|
protected String |
selectMinLocalRevisionStmtSQL
SQL statement returning the minimum of the local revisions.
|
protected String |
selectRevisionsStmtSQL
SQL statement returning all revisions within a range.
|
protected String |
updateGlobalStmtSQL
SQL statement updating the global revision.
|
protected String |
updateLocalRevisionStmtSQL
SQL statement for updating the local revision of this cluster node.
|
DEFAULT_MAX_LOCK_TIME, MAX_LOCK_TIME_INT, MAX_LOCK_TIME_LONG, RETRY_COUNT| Constructor and Description |
|---|
JahiaDatabaseJournal()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
append(org.apache.jackrabbit.core.journal.AppendRecord record,
InputStream in,
int length)
We have already saved away the revision for this record.
|
protected void |
appending(org.apache.jackrabbit.core.journal.AppendRecord record)
Save away the locked revision inside the newly appended record.
|
protected void |
buildSQLStatements()
Builds the SQL statements.
|
void |
close() |
protected org.apache.jackrabbit.core.util.db.CheckSchemaOperation |
createCheckSchemaOperation()
This method is called from
init(String, NamespaceResolver) after the
createConnectionHelper(DataSource) method, and returns a default CheckSchemaOperation. |
protected org.apache.jackrabbit.core.util.db.ConnectionHelper |
createConnectionHelper(DataSource dataSrc)
This method is called from the
init(String, NamespaceResolver) method of this class and
returns a ConnectionHelper instance which is assigned to the conHelper field. |
protected void |
doLock()
This journal is locked by incrementing the current value in the table
named
GLOBAL_REVISION, which effectively write-locks this
table. |
protected void |
doSync(long startRevision,
boolean startup)
Synchronize contents from journal.
|
protected void |
doUnlock(boolean successful) |
String |
getDatabaseType()
Get the database type.
|
String |
getDataSourceName() |
String |
getDriver()
Bean getters
|
org.apache.jackrabbit.core.journal.InstanceRevision |
getInstanceRevision() |
boolean |
getJanitorEnabled() |
int |
getJanitorFirstRunHourOfDay() |
int |
getJanitorSleep() |
protected long |
getLockedRevision() |
String |
getPassword() |
org.apache.jackrabbit.core.journal.RecordIterator |
getRecords() |
org.apache.jackrabbit.core.journal.RecordIterator |
getRecords(long startRevision) |
String |
getSchema()
Deprecated.
This method is deprecated;
getDatabaseType() should be used instead. |
String |
getSchemaObjectPrefix() |
String |
getUrl() |
String |
getUser() |
protected void |
init()
Completes initialization of this database journal.
|
void |
init(String id,
org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver resolver) |
protected void |
initInstanceRevisionAndJanitor()
Initialize the instance revision manager and the janitor thread.
|
boolean |
isSchemaCheckEnabled() |
void |
setConnectionFactory(org.apache.jackrabbit.core.util.db.ConnectionFactory connnectionFactory) |
void |
setDatabaseType(String databaseType)
Set the database type.
|
void |
setDataSourceName(String dataSourceName) |
void |
setDriver(String driver)
Bean setters
|
void |
setJanitorEnabled(boolean enabled) |
void |
setJanitorFirstRunHourOfDay(int hourOfDay) |
void |
setJanitorSleep(int sleep) |
void |
setPassword(String password) |
void |
setSchema(String databaseType)
Deprecated.
This method is deprecated;
setDatabaseType(java.lang.String) should be used instead. |
void |
setSchemaCheckEnabled(boolean enabled) |
void |
setSchemaObjectPrefix(String schemaObjectPrefix) |
void |
setUrl(String url) |
void |
setUser(String user) |
doSync, doSync, getMaxLockedSyncTime, lockAndSync, register, setInternalVersionManager, setMaxLockedSyncTime, sync, unlock, unregisterpublic static final int DEFAULT_JANITOR_SLEEP
protected String selectRevisionsStmtSQL
protected String updateGlobalStmtSQL
protected String selectGlobalStmtSQL
protected String insertRevisionStmtSQL
protected String selectMinLocalRevisionStmtSQL
protected String cleanRevisionStmtSQL
protected String getLocalRevisionStmtSQL
protected String insertLocalRevisionStmtSQL
protected String updateLocalRevisionStmtSQL
protected String schemaObjectPrefix
public void setConnectionFactory(org.apache.jackrabbit.core.util.db.ConnectionFactory connnectionFactory)
setConnectionFactory in interface org.apache.jackrabbit.core.util.db.DatabaseAwarepublic void init(String id, org.apache.jackrabbit.spi.commons.namespace.NamespaceResolver resolver) throws org.apache.jackrabbit.core.journal.JournalException
init in interface org.apache.jackrabbit.core.journal.Journalinit in class org.apache.jackrabbit.core.journal.AbstractJournalorg.apache.jackrabbit.core.journal.JournalExceptionprotected org.apache.jackrabbit.core.util.db.ConnectionHelper createConnectionHelper(DataSource dataSrc) throws Exception
init(String, NamespaceResolver) method of this class and
returns a ConnectionHelper instance which is assigned to the conHelper field.
Subclasses may override it to return a specialized connection helper.dataSrc - the DataSource of this persistence managerConnectionHelperException - on errorprotected org.apache.jackrabbit.core.util.db.CheckSchemaOperation createCheckSchemaOperation()
init(String, NamespaceResolver) after the
createConnectionHelper(DataSource) method, and returns a default CheckSchemaOperation.
Subclasses can overrride this implementation to get a customized implementation.CheckSchemaOperation instanceprotected void init()
throws org.apache.jackrabbit.core.journal.JournalException
driver and
url have been specified and optionally deduces a valid
database type. Should be overridden by subclasses that use a different way to
create a connection and therefore require other arguments.org.apache.jackrabbit.core.journal.JournalException - if initialization failsprotected void initInstanceRevisionAndJanitor()
throws org.apache.jackrabbit.core.journal.JournalException
org.apache.jackrabbit.core.journal.JournalException - on errorpublic org.apache.jackrabbit.core.journal.InstanceRevision getInstanceRevision()
throws org.apache.jackrabbit.core.journal.JournalException
getInstanceRevision in interface org.apache.jackrabbit.core.journal.Journalorg.apache.jackrabbit.core.journal.JournalExceptionpublic org.apache.jackrabbit.core.journal.RecordIterator getRecords(long startRevision)
throws org.apache.jackrabbit.core.journal.JournalException
getRecords in interface org.apache.jackrabbit.core.journal.Journalorg.apache.jackrabbit.core.journal.JournalExceptionpublic org.apache.jackrabbit.core.journal.RecordIterator getRecords()
throws org.apache.jackrabbit.core.journal.JournalException
getRecords in interface org.apache.jackrabbit.core.journal.Journalorg.apache.jackrabbit.core.journal.JournalExceptionprotected void doSync(long startRevision,
boolean startup)
throws org.apache.jackrabbit.core.journal.JournalException
doSync in class org.apache.jackrabbit.core.journal.AbstractJournalstartRevision - start point (exclusive)startup - indicates if the cluster node is syncing on startup
or does a normal sync.org.apache.jackrabbit.core.journal.JournalException - if an error occursprotected void doLock()
throws org.apache.jackrabbit.core.journal.JournalException
GLOBAL_REVISION, which effectively write-locks this
table. The updated value is then saved away and remembered in the
appended record, because a save may entail multiple appends (JCR-884).doLock in class org.apache.jackrabbit.core.journal.AbstractJournalorg.apache.jackrabbit.core.journal.JournalExceptionprotected void doUnlock(boolean successful)
doUnlock in class org.apache.jackrabbit.core.journal.AbstractJournalprotected void appending(org.apache.jackrabbit.core.journal.AppendRecord record)
appending in class org.apache.jackrabbit.core.journal.AbstractJournalprotected void append(org.apache.jackrabbit.core.journal.AppendRecord record,
InputStream in,
int length)
throws org.apache.jackrabbit.core.journal.JournalException
append in class org.apache.jackrabbit.core.journal.AbstractJournalorg.apache.jackrabbit.core.journal.JournalExceptionpublic void close()
close in interface org.apache.jackrabbit.core.journal.Journalprotected void buildSQLStatements()
public String getDriver()
public String getUrl()
public String getDatabaseType()
@Deprecated public String getSchema()
getDatabaseType() should be used instead.public String getSchemaObjectPrefix()
public String getUser()
public String getPassword()
public boolean getJanitorEnabled()
public int getJanitorSleep()
public int getJanitorFirstRunHourOfDay()
public void setDriver(String driver)
public void setUrl(String url)
public void setDatabaseType(String databaseType)
databaseType - the database type@Deprecated public void setSchema(String databaseType)
setDatabaseType(java.lang.String) should be used instead.databaseType - the database typepublic void setSchemaObjectPrefix(String schemaObjectPrefix)
public void setUser(String user)
public void setPassword(String password)
public void setJanitorEnabled(boolean enabled)
public void setJanitorSleep(int sleep)
public void setJanitorFirstRunHourOfDay(int hourOfDay)
public String getDataSourceName()
public void setDataSourceName(String dataSourceName)
public final boolean isSchemaCheckEnabled()
public final void setSchemaCheckEnabled(boolean enabled)
enabled - set whether the schema check is enabledprotected long getLockedRevision()
getLockedRevision in class JahiaAbstractJournalCopyright © 2004–2021 Jahia Solutions Group SA. All rights reserved.