Package org.red5.server.api
Interface IAttributeStore
- All Superinterfaces:
AttributeStoreMXBean
- All Known Subinterfaces:
ICastingAttributeStore,IClient,IClientSharedObject,IConnection,IServiceCapableConnection,ISharedObject,ISharedObjectBase,IStreamCapableConnection
- All Known Implementing Classes:
AttributeStore,BaseConnection,Client,ClientSharedObject,RTMPConnection,RTMPMinaConnection,SharedObject,SharedObjectScope
Base interface for all API objects with attributes
- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com)
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute(Enum<?> enm) Return the value for a given attribute.getAttribute(String name) Return the value for a given attribute.getAttribute(String name, Object defaultValue) Return the value for a given attribute and set it if it doesn't exist.Get the attribute names.Get the attributes.booleanhasAttribute(Enum<?> enm) Check the object has an attribute.booleanhasAttribute(String name) Check the object has an attribute.booleanremoveAttribute(Enum<?> enm) Remove an attribute.booleanremoveAttribute(String name) Remove an attribute.voidRemove all attributes.booleansetAttribute(Enum<?> enm, Object value) Set an attribute on this object.booleansetAttribute(String name, Object value) Set an attribute on this object.booleansetAttributes(Map<String, Object> values) Set multiple attributes on this object.booleansetAttributes(IAttributeStore values) Set multiple attributes on this object.intsize()Size of the attribute store.
-
Method Details
-
getAttributeNames
Get the attribute names. The resulting set will be read-only.- Specified by:
getAttributeNamesin interfaceAttributeStoreMXBean- Returns:
- set containing all attribute names
-
getAttributes
Get the attributes. The resulting map will be read-only.- Returns:
- map containing all attributes
-
setAttribute
Set an attribute on this object.- Parameters:
name- the name of the attribute to changevalue- the new value of the attribute- Returns:
- true if the attribute value changed otherwise false
-
setAttribute
Set an attribute on this object.- Parameters:
enm- the enum of the attribute to changevalue- the new value of the attribute- Returns:
- true if the attribute value was added or changed, otherwise false
-
setAttributes
Set multiple attributes on this object.- Parameters:
values- the attributes to set- Returns:
- true if the attribute values changed otherwise false
-
setAttributes
Set multiple attributes on this object.- Parameters:
values- the attributes to set- Returns:
- true if the attribute values changed otherwise false
-
getAttribute
Return the value for a given attribute.- Parameters:
name- the name of the attribute to get- Returns:
- the attribute value or null if the attribute doesn't exist
-
getAttribute
Return the value for a given attribute.- Parameters:
enm- the enum for the attribute to get- Returns:
- the attribute value or null if the attribute doesn't exist
-
getAttribute
Return the value for a given attribute and set it if it doesn't exist. This is a utility function that internally performs the following code:
if (!hasAttribute(name)) setAttribute(name, defaultValue); return getAttribute(name);- Parameters:
name- the name of the attribute to getdefaultValue- the value of the attribute to set if the attribute doesn't exist- Returns:
- the attribute value
-
hasAttribute
Check the object has an attribute.- Specified by:
hasAttributein interfaceAttributeStoreMXBean- Parameters:
name- the name of the attribute to check- Returns:
- true if the attribute exists otherwise false
-
hasAttribute
Check the object has an attribute.- Parameters:
enm- the enum for the attribute to check- Returns:
- true if the attribute exists otherwise false
-
removeAttribute
Remove an attribute.- Specified by:
removeAttributein interfaceAttributeStoreMXBean- Parameters:
name- the name of the attribute to remove- Returns:
- true if the attribute was found and removed otherwise false
-
removeAttribute
Remove an attribute.- Parameters:
enm- the enum of the attribute to remove- Returns:
- true if the attribute was found and removed otherwise false
-
removeAttributes
void removeAttributes()Remove all attributes.- Specified by:
removeAttributesin interfaceAttributeStoreMXBean
-
size
int size()Size of the attribute store.- Returns:
- count of attributes
-