|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
Set<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 |
Resource |
getResource(String path)
Return resource by name |
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. |
boolean |
setAttributes(IAttributeStore attributes)
Set multiple attributes on this object. |
boolean |
setAttributes(Map<String,Object> attributes)
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. |
int |
size()
Size of the attribute store. |
Methods inherited from class org.red5.server.adapter.AbstractScopeAdapter |
---|
addChildScope, checkBandwidth, checkBandwidthUp, 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 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 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 IAttributeStore
getAttributeNames
in interface AttributeStoreMXBean
public Map<String,Object> getAttributes()
getAttributes
in interface IAttributeStore
public boolean hasAttribute(String name)
hasAttribute
in interface IAttributeStore
hasAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to check
public boolean removeAttribute(String name)
removeAttribute
in interface IAttributeStore
removeAttribute
in interface AttributeStoreMXBean
name
- the name of the attribute to remove
public void removeAttributes()
removeAttributes
in interface IAttributeStore
removeAttributes
in interface AttributeStoreMXBean
public int size()
size
in interface IAttributeStore
public boolean setAttribute(String name, Object value)
setAttribute
in interface IAttributeStore
name
- the name of the attribute to changevalue
- the new value of the attribute
public boolean setAttributes(IAttributeStore attributes)
setAttributes
in interface IAttributeStore
attributes
- the attributes to set
public boolean setAttributes(Map<String,Object> attributes)
setAttributes
in interface IAttributeStore
attributes
- the attributes to set
public boolean createChildScope(String name)
name
- Child scope name
true
on success, false
otherwisepublic IScope getChildScope(String name)
name
- Child scope name
public Set<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 Resource[] getResources(String pattern) throws IOException
pattern
- Resource pattern
IOException
- I/O exceptionpublic Resource getResource(String path)
path
- Resource name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |