|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.persistence.RamPersistence
org.red5.server.persistence.FilePersistence
public class FilePersistence
Simple file-based persistence for objects. Lowers memory usage if used instead of RAM memory storage.
| Field Summary |
|---|
| Fields inherited from class org.red5.server.persistence.RamPersistence |
|---|
objects, PERSISTENCE_NO_NAME, resources |
| Constructor Summary | |
|---|---|
FilePersistence(IScope scope)
Create file persistence object for given scope |
|
FilePersistence(ResourcePatternResolver resolver)
Create file persistence object from given resource pattern resolver |
|
| Method Summary | |
|---|---|
protected void |
checkRemoveEmptyDirectories(String base)
Remove empty dirs |
protected String |
getObjectPath(String id,
String name)
Get object path for given id and name |
boolean |
load(IPersistable object)
Load state of an already instantiated persistent object. |
IPersistable |
load(String name)
Load a persistent object with the given name. |
void |
notifyClose()
Notify store that it's being closed. |
boolean |
remove(IPersistable object)
Delete the passed persistent object. |
boolean |
remove(String name)
Delete the persistent object with the given name. |
boolean |
save(IPersistable object)
Persist given object. |
protected boolean |
saveObject(IPersistable object)
Save persistable object |
void |
setExtension(String extension)
Setter for extension. |
void |
setPath(String path)
Setter for file path. |
| Methods inherited from class org.red5.server.persistence.RamPersistence |
|---|
getObjectId, getObjectName, getObjectNames, getObjects |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilePersistence(ResourcePatternResolver resolver)
resolver - Resource pattern resolver and loaderpublic FilePersistence(IScope scope)
scope - Scope| Method Detail |
|---|
public void setPath(String path)
path - New pathpublic void setExtension(String extension)
extension - New extension.
protected String getObjectPath(String id,
String name)
getObjectPath in class RamPersistenceid - Object ID. The format of the object id is name - Object name
public IPersistable load(String name)
load in interface IPersistenceStoreload in class RamPersistencename - the name of the object to load
null if no such object was
foundpublic boolean load(IPersistable object)
load in interface IPersistenceStoreload in class RamPersistenceobject - the object to initializ
protected boolean saveObject(IPersistable object)
object - Persistable object
true on success, false otherwisepublic boolean save(IPersistable object)
save in interface IPersistenceStoresave in class RamPersistenceobject - Object to store
true on success, false otherwiseprotected void checkRemoveEmptyDirectories(String base)
base - Base directorypublic boolean remove(String name)
remove in interface IPersistenceStoreremove in class RamPersistencename - the name of the object to delete
true if object was persisted and thus can be removed, false otherwisepublic boolean remove(IPersistable object)
remove in interface IPersistenceStoreremove in class RamPersistenceobject - the object to delete
true if object was persisted and thus can be removed, false otherwisepublic void notifyClose()
notifyClose in interface IPersistenceStorenotifyClose in class RamPersistence
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||