public class RootStorage extends Storage
KEY_MOUNT_OVERLAY_PATH, KEY_MOUNT_OVERLAY_PRIO, KEY_MOUNT_PATH, KEY_MOUNT_TIME, KEY_READWRITE, PATH_STORAGE, PATH_STORAGE_CACHE, PATH_STORAGEINFO
dict, KEY_CLASSNAME, KEY_ID, KEY_TYPE
Constructor and Description |
---|
RootStorage(boolean readWrite)
Creates a new root storage.
|
Modifier and Type | Method and Description |
---|---|
void |
cacheClean(boolean force)
Destroys all cached objects.
|
java.lang.Object |
load(Path path)
Loads an object from the specified location.
|
Metadata |
lookup(Path path)
Searches for an object at the specified location and returns
metadata about the object if found.
|
void |
mount(Storage storage,
Path path,
boolean readWrite,
Path overlay,
int prio)
Mounts a storage to a unique path.
|
void |
remount(Path path,
boolean readWrite,
Path overlay,
int prio)
Remounts a storage for a unique path.
|
void |
remove(Path path)
Removes an object or an index at the specified location.
|
void |
store(Path path,
java.lang.Object data)
Stores an object at the specified location.
|
void |
unmount(Path path)
Unmounts a storage from the specified path.
|
void |
unmountAll()
Unmounts and destroys all mounted storages.
|
compareTo, isReadWrite, loadAll, localPath, lookupAll, mountOverlayPath, mountOverlayPrio, mountTime, path, setMountInfo
public RootStorage(boolean readWrite)
readWrite
- the read write flagpublic void mount(Storage storage, Path path, boolean readWrite, Path overlay, int prio) throws StorageException
storage
- the storage to mountpath
- the mount pathreadWrite
- the read write flagoverlay
- the root overlay pathprio
- the root overlay search priority (higher numbers
are searched before lower numbers)StorageException
- if the storage couldn't be mountedpublic void remount(Path path, boolean readWrite, Path overlay, int prio) throws StorageException
path
- the mount pathreadWrite
- the read write flagoverlay
- the root overlay pathprio
- the root overlay search priority (higher numbers
are searched before lower numbers)StorageException
- if the storage couldn't be remountedpublic void unmount(Path path) throws StorageException
path
- the mount pathStorageException
- if the storage couldn't be unmountedpublic void unmountAll()
public Metadata lookup(Path path)
public java.lang.Object load(Path path)
public void store(Path path, java.lang.Object data) throws StorageException
store
in class Storage
path
- the storage locationdata
- the data to storeStorageException
- if the data couldn't be writtenpublic void remove(Path path) throws StorageException
remove
in class Storage
path
- the storage locationStorageException
- if the data couldn't be removedpublic void cacheClean(boolean force)
This method is called regularly from a background job in order to destroy inactive objects.
force
- the forced clean flag