Package org.red5.server.api
Interface IAttributeStore
- All Superinterfaces:
AttributeStoreMXBean
- All Known Subinterfaces:
ICastingAttributeStore
,IClient
,IConnection
,IRemotingConnection
,IServiceCapableConnection
,IStreamCapableConnection
- All Known Implementing Classes:
AdminApplication
,AntMediaApplicationAdapter
,ApplicationAdapter
,AttributeStore
,BaseConnection
,Client
,MultiThreadedApplicationAdapter
,PersistableAttributeStore
,RTMPConnection
,RTMPMinaConnection
,StatefulScopeWrappingAdapter
Base interface for all API objects with attributes
- Author:
- The Red5 Project, Luke Hubbard (luke@codegent.com)
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(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.boolean
hasAttribute
(String name) Check the object has an attribute.boolean
removeAttribute
(String name) Remove an attribute.void
Remove all attributes.boolean
setAttribute
(String name, Object value) Set an attribute on this object.boolean
setAttributes
(Map<String, Object> values) Set multiple attributes on this object.boolean
setAttributes
(IAttributeStore values) Set multiple attributes on this object.int
size()
Size of the attribute store.
-
Method Details
-
getAttributeNames
Get the attribute names. The resulting set will be read-only.- Specified by:
getAttributeNames
in 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
-
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 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:
hasAttribute
in interfaceAttributeStoreMXBean
- Parameters:
name
- the name of the attribute to check- Returns:
- true if the attribute exists otherwise false
-
removeAttribute
Remove an attribute.- Specified by:
removeAttribute
in interfaceAttributeStoreMXBean
- Parameters:
name
- the name of the attribute to remove- Returns:
- true if the attribute was found and removed otherwise false
-
removeAttributes
void removeAttributes()Remove all attributes.- Specified by:
removeAttributes
in interfaceAttributeStoreMXBean
-
size
int size()Size of the attribute store.- Returns:
- count of attributes
-