public class WrappedStorage 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 |
---|
WrappedStorage(java.lang.String storageType,
Storage wrapped)
Creates a new wrapped (or encapsulated) storage.
|
Modifier and Type | Method and Description |
---|---|
protected void |
destroy()
Destroys this object.
|
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 |
remove(Path path)
Removes an object or an index at the specified location.
|
void |
setMountInfo(Path path,
boolean readWrite,
Path overlay,
int prio)
Updates the mount information for this storage.
|
void |
store(Path path,
java.lang.Object data)
Stores an object at the specified location.
|
compareTo, isReadWrite, loadAll, localPath, lookupAll, mountOverlayPath, mountOverlayPrio, mountTime, path
activate, id, init, isActive, isModified, passivate, serialize, toString, type
public WrappedStorage(java.lang.String storageType, Storage wrapped)
storageType
- the storage type namewrapped
- the encapsulated storageprotected void destroy() throws StorageException
destroy
in class StorableObject
StorageException
- if the destruction failedpublic void setMountInfo(Path path, boolean readWrite, Path overlay, int prio)
setMountInfo
in class Storage
path
- the mount path (or storage root path)readWrite
- the storage read-write flagoverlay
- the mount overlay pathprio
- the mount overlay prioritypublic 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 removed