|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.red5.server.adapter.AbstractScopeAdapter
org.red5.server.adapter.StatefulScopeWrappingAdapter
public class StatefulScopeWrappingAdapter
StatefulScopeWrappingAdapter class wraps stateful IScope functionality. That is, it has attributes that you can work with, subscopes, associated resources and connections.
Field Summary | |
---|---|
protected List<PluginDescriptor> |
plugins
List of plug-in descriptors |
protected IScope |
scope
Wrapped scope |
Constructor Summary | |
---|---|
StatefulScopeWrappingAdapter()
|
Method Summary | |
---|---|
boolean |
createChildScope(String name)
Creates child scope |
Object |
getAttribute(String name)
Return the value for a given attribute. |
Object |
getAttribute(String name,
Object defaultValue)
Return the value for a given attribute and set it if it doesn't exist. |
Set<String> |
getAttributeNames()
Get the attribute names. |
Map<String,Object> |
getAttributes()
Wrapper for Scope#getAttributes |
IScope |
getChildScope(String name)
Return child scope |
Iterator<String> |
getChildScopeNames()
Iterator for child scope names |
Set<IClient> |
getClients()
Getter for set of clients |
Collection<Set<IConnection>> |
getConnections()
Returns all connections in the scope |
IContext |
getContext()
Getter for context |
int |
getDepth()
Getter for depth |
String |
getName()
Getter for name |
IScope |
getParent()
Return parent scope |
String |
getPath()
Getter for stateful scope path |
List<PluginDescriptor> |
getPlugins()
Returns any plug-ins descriptors added |
org.springframework.core.io.Resource |
getResource(String path)
Return resource by name |
org.springframework.core.io.Resource[] |
getResources(String pattern)
Returns array of resources (as Spring core Resource class instances) |
IScope |
getScope()
Getter for wrapped scope |
boolean |
hasAttribute(String name)
Check the object has an attribute. |
boolean |
hasChildScope(String name)
Whether this scope has a child scope with given name |
boolean |
hasParent()
If this scope has a parent |
Set<IConnection> |
lookupConnections(IClient client)
|
boolean |
removeAttribute(String name)
Remove an attribute. |
void |
removeAttributes()
Remove all attributes. |
boolean |
setAttribute(String name,
Object value)
Set an attribute on this object. |
void |
setAttributes(IAttributeStore values)
Set multiple attributes on this object. |
void |
setAttributes(Map<String,Object> values)
Set multiple attributes on this object. |
void |
setPlugins(List<PluginDescriptor> plugins)
Adds a list of plug-in descriptors |
void |
setScope(IScope scope)
Set the scope the object is located in. |
Methods inherited from class org.red5.server.adapter.AbstractScopeAdapter |
---|
addChildScope, connect, disconnect, handleEvent, join, leave, removeChildScope, serviceCall, setCanCallService, setCanConnect, setCanStart, setJoin, start, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IScope scope
protected List<PluginDescriptor> plugins
Constructor Detail |
---|
public StatefulScopeWrappingAdapter()
Method Detail |
---|
public void setScope(IScope scope)
setScope
in interface IScopeAware
scope
- Scope for this objectpublic IScope getScope()
public List<PluginDescriptor> getPlugins()
public void setPlugins(List<PluginDescriptor> plugins)
plugins
- public Object getAttribute(String name)
getAttribute
in interface AttributeStoreMBean
getAttribute
in interface IAttributeStore
name
- the name of the attribute to get
public Object getAttribute(String name, Object defaultValue)
This is a utility function that internally performs the following code:
if (!hasAttribute(name)) setAttribute(name, defaultValue);
return getAttribute(name);
getAttribute
in interface AttributeStoreMBean
getAttribute
in interface IAttributeStore
name
- the name of the attribute to getdefaultValue
- the value of the attribute to set if the attribute doesn't
exist
public Set<String> getAttributeNames()
getAttributeNames
in interface AttributeStoreMBean
getAttributeNames
in interface IAttributeStore
public Map<String,Object> getAttributes()
getAttributes
in interface AttributeStoreMBean
getAttributes
in interface IAttributeStore
public boolean hasAttribute(String name)
hasAttribute
in interface AttributeStoreMBean
hasAttribute
in interface IAttributeStore
name
- the name of the attribute to check
public boolean removeAttribute(String name)
removeAttribute
in interface AttributeStoreMBean
removeAttribute
in interface IAttributeStore
name
- the name of the attribute to remove
public void removeAttributes()
removeAttributes
in interface AttributeStoreMBean
removeAttributes
in interface IAttributeStore
public boolean setAttribute(String name, Object value)
setAttribute
in interface AttributeStoreMBean
setAttribute
in interface IAttributeStore
name
- the name of the attribute to changevalue
- the new value of the attribute
public void setAttributes(IAttributeStore values)
setAttributes
in interface IAttributeStore
values
- the attributes to setpublic void setAttributes(Map<String,Object> values)
setAttributes
in interface IAttributeStore
values
- the attributes to setpublic boolean createChildScope(String name)
name
- Child scope name
true
on success, false
otherwisepublic IScope getChildScope(String name)
name
- Child scope name
public Iterator<String> getChildScopeNames()
public Set<IClient> getClients()
public Collection<Set<IConnection>> getConnections()
public IContext getContext()
public int getDepth()
public String getName()
public IScope getParent()
public String getPath()
public boolean hasChildScope(String name)
name
- Child scope name
true
if it does have it, false
otherwisepublic boolean hasParent()
true
if this scope has a parent scope, false
otherwisepublic Set<IConnection> lookupConnections(IClient client)
public org.springframework.core.io.Resource[] getResources(String pattern) throws IOException
pattern
- Resource pattern
IOException
- I/O exceptionpublic org.springframework.core.io.Resource getResource(String path)
path
- Resource name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |