org.red5.server.util
public class ScopeUtils extends Object
Constructor and Description |
---|
ScopeUtils() |
Modifier and Type | Method and Description |
---|---|
static IScope |
findApplication(IScope from)
Returns the application scope for specified scope.
|
static IScope |
findRoot(IScope from)
Finds root scope for specified scope object.
|
static Object |
getScopeService(IScope scope,
Class<?> intf)
Returns scope service that implements a given interface.
|
static Object |
getScopeService(IScope scope,
Class<?> intf,
boolean checkHandler) |
static Object |
getScopeService(IScope scope,
Class<?> intf,
Class<?> defaultClass)
Returns scope service that implements a given interface.
|
static Object |
getScopeService(IScope scope,
Class<?> intf,
Class<?> defaultClass,
boolean checkHandler) |
protected static Object |
getScopeService(IScope scope,
String name)
Returns scope service by bean name.
|
protected static Object |
getScopeService(IScope scope,
String name,
Class<?> defaultClass)
Returns scope services (e.g.
|
static boolean |
isAncestor(IBasicScope from,
IBasicScope ancestor)
Check whether one scope is an ancestor of another
|
static boolean |
isApp(IBasicScope scope)
Check whether scope is an application scope (level 1 leaf in scope tree)
or not
|
static boolean |
isGlobal(IBasicScope scope)
Check whether scope is the global scope (level 0 leaf in scope tree) or
not
When user connects the following URL: rtmp://localhost/myapp/foo/bar then /
is the global level scope, myapp is app level, foo is room level and bar
is room level as well (but with higher depth level)
|
static boolean |
isRoom(IBasicScope scope)
Check whether scope is a room scope (level 2 leaf in scope tree or lower,
e.g.
|
static boolean |
isRoot(IBasicScope scope)
Checks whether scope is root or not
|
static IScope |
resolveScope(IScope from,
String path)
Resolves scope for specified scope and path.
|
public static IScope resolveScope(IScope from, String path)
from
- Scope to use as context (to start from)path
- Path to resolvepublic static IScope findRoot(IScope from)
from
- Scope to find root forpublic static IScope findApplication(IScope from)
isApp
method for details.from
- Scope to find application forpublic static boolean isAncestor(IBasicScope from, IBasicScope ancestor)
from
- Scopeancestor
- Scope to checktrue
if ancestor scope is really an ancestor of
scope passed as from parameter, false
otherwise.public static boolean isRoot(IBasicScope scope)
scope
- Scope to checktrue
if scope is root scope (top level scope),
false
otherwise.public static boolean isGlobal(IBasicScope scope)
scope
- Scope to checktrue
if scope is the global scope,
false
otherwise.public static boolean isApp(IBasicScope scope)
scope
- Scope to checktrue
if scope is an application scope,
false
otherwise.public static boolean isRoom(IBasicScope scope)
scope
- Scope to checktrue
if scope is a room scope, false
otherwise.protected static Object getScopeService(IScope scope, String name)
scope
- scopename
- nameprotected static Object getScopeService(IScope scope, String name, Class<?> defaultClass)
scope
- The scope service belongs toname
- Bean namedefaultClass
- Class of servicepublic static Object getScopeService(IScope scope, Class<?> intf)
scope
- The scope service belongs tointf
- The interface the service must implementpublic static Object getScopeService(IScope scope, Class<?> intf, boolean checkHandler)
public static Object getScopeService(IScope scope, Class<?> intf, Class<?> defaultClass)
scope
- The scope service belongs tointf
- The interface the service must implementdefaultClass
- Class that should be used to create a new service if no service was found.Copyright © 2006-2012 The Red5 Project