Package org.red5.server.adapter
Class AbstractScopeAdapter
java.lang.Object
org.red5.server.adapter.AbstractScopeAdapter
- All Implemented Interfaces:
IEventHandler
,IScopeHandler
- Direct Known Subclasses:
StatefulScopeWrappingAdapter
Base scope handler implementation. Meant to be subclassed.
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
Can add child scope flag.private boolean
Can call service flag.private boolean
Can connect flag.private boolean
Can handle event flag.private boolean
Can join flag.private boolean
Can start flag. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addChildScope
(IBasicScope scope) Called just before a child scope is added.void
Calls the checkBandwidth method on the current client.checkBandwidthUp
(Object[] params) Calls the checkBandwidthUp method on the current client.boolean
connect
(IConnection conn, IScope scope, Object[] params) Called just before every connection to a scope.void
disconnect
(IConnection conn, IScope scope) Called just after the a connection is disconnected.boolean
handleEvent
(IEvent event) Handle an event.boolean
Called just before a client enters the scope.void
Called just after the client leaves the scope.void
removeChildScope
(IBasicScope scope) Called just after a child scope has been removed.boolean
serviceCall
(IConnection conn, IServiceCall call) Called when a service is called.void
setCanCallService
(boolean canCallService) Setter for can call service flagvoid
setCanConnect
(boolean canConnect) Setter for can connect flagvoid
setCanStart
(boolean canStart) Setter for can start flag.void
setJoin
(boolean canJoin) Setter for 'can join' flagboolean
Called when a scope is created for the first time.void
Called just before a scope is disposed.
-
Field Details
-
canStart
private boolean canStartCan start flag.true
if scope is ready to be activated,false
otherwise -
canConnect
private boolean canConnectCan connect flag.true
if connections to scope are allowed,false
otherwise -
canJoin
private boolean canJoinCan join flag.true
if scope may be joined by users,false
otherwise -
canCallService
private boolean canCallServiceCan call service flag.true
if remote service calls are allowed for the scope,false
otherwise -
canAddChildScope
private boolean canAddChildScopeCan add child scope flag.true
if scope is allowed to add child scopes,false
otherwise -
canHandleEvent
private boolean canHandleEventCan handle event flag.true
if events handling is allowed,false
otherwise
-
-
Constructor Details
-
AbstractScopeAdapter
public AbstractScopeAdapter()
-
-
Method Details
-
setCanStart
public void setCanStart(boolean canStart) Setter for can start flag.- Parameters:
canStart
-true
if scope is ready to be activated,false
otherwise
-
setCanCallService
public void setCanCallService(boolean canCallService) Setter for can call service flag- Parameters:
canCallService
-true
if remote service calls are allowed for the scope,false
otherwise
-
setCanConnect
public void setCanConnect(boolean canConnect) Setter for can connect flag- Parameters:
canConnect
-true
if connections to scope are allowed,false
otherwise
-
setJoin
public void setJoin(boolean canJoin) Setter for 'can join' flag- Parameters:
canJoin
-true
if scope may be joined by users,false
otherwise
-
start
Called when a scope is created for the first time.- Specified by:
start
in interfaceIScopeHandler
- Parameters:
scope
- the new scope object- Returns:
true
to allow,false
to deny
-
stop
Called just before a scope is disposed.- Specified by:
stop
in interfaceIScopeHandler
- Parameters:
scope
- Scope that id disposed
-
connect
Called just before every connection to a scope. You can pass additional params from client usingNetConnection.connect
method (see below).- Specified by:
connect
in interfaceIScopeHandler
- Parameters:
conn
- Connection objectscope
- Scope objectparams
- List of params passed from client viaNetConnection.connect
method. All parameters but the first one passed toNetConnection.connect
method are available as params array.- Returns:
true
to allow,false
to deny
-
disconnect
Called just after the a connection is disconnected.- Specified by:
disconnect
in interfaceIScopeHandler
- Parameters:
conn
- Connection objectscope
- Scope object
-
join
Called just before a client enters the scope.- Specified by:
join
in interfaceIScopeHandler
- Parameters:
client
- Client objectscope
- Scope that is joined by client- Returns:
true
to allow,false
to deny connection
-
leave
Called just after the client leaves the scope.- Specified by:
leave
in interfaceIScopeHandler
- Parameters:
client
- Client objectscope
- Scope object
-
serviceCall
Called when a service is called.- Specified by:
serviceCall
in interfaceIScopeHandler
- Parameters:
conn
- The connection objectcall
- The call object.- Returns:
true
to allow,false
to deny
-
addChildScope
Called just before a child scope is added.- Specified by:
addChildScope
in interfaceIScopeHandler
- Parameters:
scope
- Scope that will be added- Returns:
true
to allow,false
to deny
-
removeChildScope
Called just after a child scope has been removed.- Specified by:
removeChildScope
in interfaceIScopeHandler
- Parameters:
scope
- Scope that has been removed
-
handleEvent
Handle an event.- Specified by:
handleEvent
in interfaceIEventHandler
- Parameters:
event
- to handle- Returns:
- true if event was handled, false if it should bubble
-
checkBandwidth
Calls the checkBandwidth method on the current client.- Parameters:
o
- Object passed from Flash, not used at the moment
-
checkBandwidthUp
Calls the checkBandwidthUp method on the current client.- Parameters:
params
- Object passed from Flash- Returns:
- bandwidth results map
-