org.apache.jackrabbit.core.fs.db
Class DerbyFileSystem
java.lang.Object
org.apache.jackrabbit.core.fs.db.DatabaseFileSystem
org.apache.jackrabbit.core.fs.db.DbFileSystem
org.apache.jackrabbit.core.fs.db.DerbyFileSystem
- All Implemented Interfaces:
- FileSystem
public class DerbyFileSystem
- extends DbFileSystem
DerbyFileSystem is a JDBC-based FileSystem
implementation for Jackrabbit that persists file system entries in an
embedded Derby database.
It is configured through the following properties:
url: the database url of the form
"jdbc:derby:[db];[attributes]"
schemaObjectPrefix: prefix to be prepended to schema objects
driver: the FQN name of the JDBC driver class
(default: "org.apache.derby.jdbc.EmbeddedDriver")
schema: type of schema to be used
(default: "derby")
user: the database user (default: null)
password: the user's password (default: null)
shutdownOnClose: if true (the default) the
database is shutdown when the last connection is closed;
set this to false when using a standalone database
See also DbFileSystem.
The following is a fragment from a sample configuration:
<FileSystem class="org.apache.jackrabbit.core.fs.db.DerbyFileSystem">
<param name="url" value="jdbc:derby:${rep.home}/db;create=true"/>
<param name="schemaObjectPrefix" value="rep_"/>
</FileSystem>
|
Field Summary |
protected boolean |
shutdownOnClose
Flag indicating whether this derby database should be shutdown on close. |
| Fields inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem |
con, copyFileSQL, copyFilesSQL, deleteFileSQL, deleteFolderSQL, INITIAL_BUFFER_SIZE, initialized, insertFileSQL, insertFolderSQL, schema, SCHEMA_OBJECT_PREFIX_VARIABLE, schemaObjectPrefix, selectChildCountSQL, selectDataSQL, selectExistSQL, selectFileAndFolderNamesSQL, selectFileExistSQL, selectFileNamesSQL, selectFolderExistSQL, selectFolderNamesSQL, selectLastModifiedSQL, selectLengthSQL, SLEEP_BEFORE_RECONNECT, updateDataSQL, updateLastModifiedSQL |
|
Constructor Summary |
DerbyFileSystem()
Creates a new DerbyFileSystem instance. |
|
Method Summary |
protected void |
closeConnection(java.sql.Connection connection)
Closes the given connection and shuts down the embedded Derby
database if shutdownOnClose is set to true. |
boolean |
getShutdownOnClose()
|
void |
setShutdownOnClose(boolean shutdownOnClose)
|
| Methods inherited from class org.apache.jackrabbit.core.fs.db.DbFileSystem |
equals, getConnection, getDriver, getPassword, getUrl, getUser, hashCode, setDriver, setPassword, setUrl, setUser |
| Methods inherited from class org.apache.jackrabbit.core.fs.db.DatabaseFileSystem |
buildSQLStatements, checkSchema, close, closeResultSet, closeStatement, copy, copyDeepFolder, copyFile, createDeepFolder, createFolder, deleteFile, deleteFolder, executeStmt, exists, getInputStream, getOutputStream, getRandomAccessOutputStream, getSchema, getSchemaObjectPrefix, hasChildren, init, initConnection, initPreparedStatements, isFile, isFolder, lastModified, length, list, listFiles, listFolders, move, prepareSchemaObjectPrefix, reestablishConnection, resetStatement, setSchema, setSchemaObjectPrefix, touch, verifyRootExists |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
shutdownOnClose
protected boolean shutdownOnClose
- Flag indicating whether this derby database should be shutdown on close.
DerbyFileSystem
public DerbyFileSystem()
- Creates a new
DerbyFileSystem instance.
getShutdownOnClose
public boolean getShutdownOnClose()
setShutdownOnClose
public void setShutdownOnClose(boolean shutdownOnClose)
closeConnection
protected void closeConnection(java.sql.Connection connection)
throws java.sql.SQLException
- Closes the given connection and shuts down the embedded Derby
database if
shutdownOnClose is set to true.
- Overrides:
closeConnection in class DatabaseFileSystem
- Parameters:
connection - database connection
- Throws:
java.sql.SQLException - if an error occurs- See Also:
DatabaseFileSystem.closeConnection(Connection)
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.