org.red5.server
public class PersistableAttributeStore extends AttributeStore implements IPersistable
Modifier and Type | Field and Description |
---|---|
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
|
attributes
TRANSIENT_PREFIX
Constructor and Description |
---|
PersistableAttributeStore(String type,
String name,
String path,
boolean persistent)
Creates persistable attribute store
|
Modifier and Type | Method and Description |
---|---|
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 attribute by name and return success as boolean
|
void |
setAttributes(IAttributeStore values)
Bulk set of attributes from another attributes store
|
void |
setAttributes(Map<String,Object> values)
Set attributes from Map
|
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
|
filterNull, from, getAttribute, getAttributeNames, getAttributes, getBoolAttribute, getByteAttribute, getDoubleAttribute, getIntAttribute, getListAttribute, getLongAttribute, getMapAttribute, getSetAttribute, getShortAttribute, getStringAttribute, hasAttribute
protected boolean persistent
protected String name
protected String type
protected String path
protected long lastModified
protected IPersistenceStore store
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 objectIOException
- if errorpublic void deserialize(Input input) throws IOException
deserialize
in interface IPersistable
input
- Input objectIOException
- 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
existpublic boolean setAttribute(String name, Object value)
setAttribute
in interface IAttributeStore
setAttribute
in class AttributeStore
name
- Attribute namevalue
- Attribute valuepublic void setAttributes(Map<String,Object> values)
setAttributes
in interface IAttributeStore
setAttributes
in class AttributeStore
values
- Attributes as Mappublic void setAttributes(IAttributeStore values)
setAttributes
in interface IAttributeStore
setAttributes
in class AttributeStore
values
- Attributes storepublic boolean removeAttribute(String name)
removeAttribute
in interface IAttributeStore
removeAttribute
in interface AttributeStoreMXBean
removeAttribute
in class AttributeStore
name
- Attribute namepublic void removeAttributes()
removeAttributes
in interface IAttributeStore
removeAttributes
in interface AttributeStoreMXBean
removeAttributes
in class AttributeStore
Copyright © 2006-2012 The Red5 Project