Package org.red5.server.api.persistence
Interface IPersistenceStore
public interface IPersistenceStore
Storage for persistent objects.
- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com), Joachim Bauch (jojo@struktur.de)
-
Method Summary
Modifier and TypeMethodDescriptionReturn iterator over the names of all already loaded objects in the storage.Return iterator over the already loaded objects in the storage.Load a persistent object with the given name.boolean
load
(IPersistable obj) Load state of an already instantiated persistent object.void
Notify store that it's being closed.boolean
Delete the persistent object with the given name.boolean
remove
(IPersistable obj) Delete the passed persistent object.boolean
save
(IPersistable obj) Persist given object.
-
Method Details
-
save
Persist given object.- Parameters:
obj
- Object to store- Returns:
true
on success,false
otherwise
-
load
Load a persistent object with the given name. The object must provide either a constructor that takes an input stream as only parameter or an empty constructor so it can be loaded from the persistence store.- Parameters:
name
- the name of the object to load- Returns:
- The loaded object or
null
if no such object was found
-
load
Load state of an already instantiated persistent object.- Parameters:
obj
- the object to initializ- Returns:
- true if the object was initialized, false otherwise
-
remove
Delete the passed persistent object.- Parameters:
obj
- the object to delete- Returns:
true
if object was persisted and thus can be removed,false
otherwise
-
remove
Delete the persistent object with the given name.- Parameters:
name
- the name of the object to delete- Returns:
true
if object was persisted and thus can be removed,false
otherwise
-
getObjectNames
Return iterator over the names of all already loaded objects in the storage.- Returns:
- Set of all object names
-
getObjects
Collection<IPersistable> getObjects()Return iterator over the already loaded objects in the storage.- Returns:
- Set of all objects
-
notifyClose
void notifyClose()Notify store that it's being closed. This allows the store to write any pending objects to disk.
-