|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.persistence.RamPersistence
public class RamPersistence
Persistence implementation that stores the objects in memory. This serves as default persistence if nothing has been configured.
| Field Summary | |
|---|---|
protected ConcurrentMap<String,IPersistable> |
objects
Map for persistable objects |
protected static String |
PERSISTENCE_NO_NAME
This is used in the id for objects that have a name of null |
protected ResourcePatternResolver |
resources
Resource pattern resolver. |
| Constructor Summary | |
|---|---|
RamPersistence(IScope scope)
Creates RAM persistence object from scope |
|
RamPersistence(ResourcePatternResolver resources)
Creates RAM persistence object from resource pattern resolvers |
|
| Method Summary | |
|---|---|
protected String |
getObjectId(IPersistable object)
Get object id |
protected String |
getObjectName(String id)
Get resource name from path |
Set<String> |
getObjectNames()
Return iterator over the names of all already loaded objects in the storage. |
protected String |
getObjectPath(String id,
String name)
Get object path for given id and name |
Collection<IPersistable> |
getObjects()
Return iterator over the already loaded objects in the storage. |
boolean |
load(IPersistable obj)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String PERSISTENCE_NO_NAME
null
protected ConcurrentMap<String,IPersistable> objects
protected ResourcePatternResolver resources
| Constructor Detail |
|---|
public RamPersistence(ResourcePatternResolver resources)
resources - Resource pattern resolver and loaderpublic RamPersistence(IScope scope)
scope - Scope| Method Detail |
|---|
protected String getObjectName(String id)
id - Object ID. The format of the object id is
protected String getObjectPath(String id,
String name)
id - Object ID. The format of the object id is name - Object name
protected String getObjectId(IPersistable object)
object - Persistable object whose id is asked for
public boolean save(IPersistable object)
save in interface IPersistenceStoreobject - Object to store
true on success, false otherwisepublic IPersistable load(String name)
load in interface IPersistenceStorename - the name of the object to load
null if no such object was
foundpublic boolean load(IPersistable obj)
load in interface IPersistenceStoreobj - the object to initializ
public boolean remove(IPersistable object)
remove in interface IPersistenceStoreobject - the object to delete
true if object was persisted and thus can be removed, false otherwisepublic boolean remove(String name)
remove in interface IPersistenceStorename - the name of the object to delete
true if object was persisted and thus can be removed, false otherwisepublic Set<String> getObjectNames()
getObjectNames in interface IPersistenceStorepublic Collection<IPersistable> getObjects()
getObjects in interface IPersistenceStorepublic void notifyClose()
notifyClose in interface IPersistenceStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||