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)
isAppmethod for details.
from
- Scope to find application forpublic static boolean isAncestor(IBasicScope from, IBasicScope ancestor)
from
- Scopeancestor
- Scope to checktrueif ancestor scope is really an ancestor of scope passed as from parameter,
falseotherwise.
public static boolean isRoot(IBasicScope scope)
scope
- Scope to checktrueif scope is root scope (top level scope),
falseotherwise.
public static boolean isGlobal(IBasicScope scope)
scope
- Scope to checktrueif scope is the global scope,
falseotherwise.
public static boolean isApp(IBasicScope scope)
scope
- Scope to checktrueif scope is an application scope,
falseotherwise.
public static boolean isRoom(IBasicScope scope)
scope
- Scope to checktrueif scope is a room scope,
falseotherwise.
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 © 2005–2019 Red5. All rights reserved.