|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.InternalStorageController
final class InternalStorageController
A simple implementation of a secondary storage controller which just moves files to another directory. In the secondary storage the files are named according to their ID in the database. This is neccessary because we need to be able to detect if a file has been deleted from the database or not.
The configuration
is done in the base.config
file with the following settings:
Setting | Default/possible value(s) | Description |
---|---|---|
secondary.storage.driver | net.sf.basedb.core.InternalStorageController | The class name of the secondary storage controller. |
secondary.storage.init | - | The path to the seconday storage directory. |
This class logs information to a logger named net.sf.basedb.core.storage
.
Configure the settings for the logger in the log4j.properties
file.
Nested Class Summary | |
---|---|
private static class |
InternalStorageController.StorageKeyring
Our own keyring containing the permissions we need to move the files. |
Field Summary | |
---|---|
private static Logger |
log
Log storage events. |
private File |
path
The path to the directory where the secondary storage is located. |
private SessionControl |
sc
The session controller. |
Constructor Summary | |
---|---|
InternalStorageController()
Create the storage controller. |
Method Summary | |
---|---|
void |
close()
Cleanup |
void |
init(String settings)
Initialises the object. |
private void |
moveToPrimary(int fileId)
|
private void |
moveToSecondary(int fileId)
|
void |
run()
Check the database for files for waiting to be moved. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Logger log
private SessionControl sc
InternalStorageController.StorageKeyring
.
private File path
Constructor Detail |
---|
InternalStorageController()
Method Detail |
---|
public void init(String settings) throws BaseException
SecondaryStorageController
settings
string should be defined by the implementing class. It may for
example be the path to another directory of information about how to
connect to a remote FTP server.
init
in interface SecondaryStorageController
settings
- A string containing initialisation parameters
BaseException
- If the parameters are invalidpublic void run()
run
in interface SecondaryStorageController
public void close()
close
in interface SecondaryStorageController
private void moveToPrimary(int fileId) throws Throwable
Throwable
private void moveToSecondary(int fileId) throws Throwable
Throwable
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |