|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.red5.server.AttributeStore org.red5.server.PersistableAttributeStore
public class PersistableAttributeStore
Persistable attributes store. Server-side SharedObjects feature based on this class.
Field Summary | |
---|---|
protected long |
lastModified
Last modified Timestamp |
protected String |
name
Attribute store name |
protected String |
path
Attribute store path (on local hard drive) |
protected boolean |
persistent
Persistence flag |
protected IPersistenceStore |
store
Store object that deals with save/load routines |
protected String |
type
Attribute store type |
Fields inherited from class org.red5.server.AttributeStore |
---|
attributes, log |
Fields inherited from interface org.red5.server.api.persistence.IPersistable |
---|
TRANSIENT_PREFIX |
Constructor Summary | |
---|---|
PersistableAttributeStore(String type,
String name,
String path,
boolean persistent)
Creates persistable attribute store |
Method Summary | |
---|---|
void |
deserialize(Input input)
Deserializes data from input to attributes |
Object |
getAttribute(String name,
Object defaultValue)
Return the value for a given attribute and set it if it doesn't exist. |
long |
getLastModified()
Returns last modification time as timestamp |
String |
getName()
Return store name |
String |
getPath()
Ruturn scope path |
IPersistenceStore |
getStore()
Return persistent store |
String |
getType()
Return scope type |
boolean |
isPersistent()
Check whether object is persistent or not |
protected void |
modified()
Set last modified flag to current system time |
boolean |
removeAttribute(String name)
Removes attribute |
void |
removeAttributes()
Removes all attributes and sets modified flag |
void |
serialize(Output output)
Serializes byte buffer output, storing them to attributes |
boolean |
setAttribute(String name,
Object value)
Set an attribute on this object. |
boolean |
setAttributes(IAttributeStore values)
Set multiple attributes on this object. |
boolean |
setAttributes(Map<String,Object> values)
Set multiple attributes on this object. |
void |
setName(String name)
Setter for name |
void |
setPath(String path)
Setter for scope path |
void |
setPersistent(boolean persistent)
Set for persistence |
void |
setStore(IPersistenceStore store)
Load data from another persistent store |
Methods inherited from class org.red5.server.AttributeStore |
---|
filterNull, from, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute, size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean persistent
protected String name
protected String type
protected String path
protected long lastModified
protected IPersistenceStore store
Constructor Detail |
---|
public PersistableAttributeStore(String type, String name, String path, boolean persistent)
type
- Attribute store typename
- Attribute store namepath
- Attribute store pathpersistent
- Whether store is persistent or notMethod Detail |
---|
protected void modified()
public boolean isPersistent()
isPersistent
in interface IPersistable
public void setPersistent(boolean persistent)
setPersistent
in interface IPersistable
persistent
- Persistence flag valuepublic long getLastModified()
getLastModified
in interface IPersistable
public String getName()
getName
in interface IPersistable
public void setName(String name)
setName
in interface IPersistable
name
- Namepublic String getPath()
getPath
in interface IPersistable
public void setPath(String path)
setPath
in interface IPersistable
path
- Pathpublic String getType()
getType
in interface IPersistable
public void serialize(Output output) throws IOException
serialize
in interface IPersistable
output
- Output object
IOException
- if errorpublic void deserialize(Input input) throws IOException
deserialize
in interface IPersistable
input
- Input object
IOException
- I/O exceptionpublic void setStore(IPersistenceStore store)
setStore
in interface IPersistable
store
- Persistent storepublic IPersistenceStore getStore()
getStore
in interface IPersistable
public Object getAttribute(String name, Object defaultValue)
getAttribute
in interface IAttributeStore
getAttribute
in class AttributeStore
name
- the name of the attribute to getdefaultValue
- the value of the attribute to set if the attribute doesn't
exist
public boolean setAttribute(String name, Object value)
setAttribute
in interface IAttributeStore
setAttribute
in class AttributeStore
name
- the name of the attribute to changevalue
- the new value of the attribute
public boolean setAttributes(Map<String,Object> values)
setAttributes
in interface IAttributeStore
setAttributes
in class AttributeStore
values
- the attributes to set
public boolean setAttributes(IAttributeStore values)
setAttributes
in interface IAttributeStore
setAttributes
in class AttributeStore
values
- the attributes to set
public boolean removeAttribute(String name)
removeAttribute
in interface IAttributeStore
removeAttribute
in interface AttributeStoreMXBean
removeAttribute
in class AttributeStore
name
- Attribute name
public void removeAttributes()
removeAttributes
in interface IAttributeStore
removeAttributes
in interface AttributeStoreMXBean
removeAttributes
in class AttributeStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |