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
FieldsModifier and TypeFieldDescriptionprivate booleanCan add child scope flag.private booleanCan call service flag.private booleanCan connect flag.private booleanCan handle event flag.private booleanCan join flag.private booleanCan start flag. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddChildScope(IBasicScope scope) Called just before a child scope is added.voidCalls the checkBandwidth method on the current client.checkBandwidthUp(Object[] params) Calls the checkBandwidthUp method on the current client.booleanconnect(IConnection conn, IScope scope, Object[] params) Called just before every connection to a scope.voiddisconnect(IConnection conn, IScope scope) Called just after the a connection is disconnected.booleanhandleEvent(IEvent event) Handle an event.booleanCalled just before a client enters the scope.voidCalled just after the client leaves the scope.voidremoveChildScope(IBasicScope scope) Called just after a child scope has been removed.booleanserviceCall(IConnection conn, IServiceCall call) Called when a service is called.voidsetCanCallService(boolean canCallService) Setter for can call service flagvoidsetCanConnect(boolean canConnect) Setter for can connect flagvoidsetCanStart(boolean canStart) Setter for can start flag.voidsetJoin(boolean canJoin) Setter for 'can join' flagbooleanCalled when a scope is created for the first time.voidCalled just before a scope is disposed.
-
Field Details
-
canStart
private boolean canStartCan start flag.trueif scope is ready to be activated,falseotherwise -
canConnect
private boolean canConnectCan connect flag.trueif connections to scope are allowed,falseotherwise -
canJoin
private boolean canJoinCan join flag.trueif scope may be joined by users,falseotherwise -
canCallService
private boolean canCallServiceCan call service flag.trueif remote service calls are allowed for the scope,falseotherwise -
canAddChildScope
private boolean canAddChildScopeCan add child scope flag.trueif scope is allowed to add child scopes,falseotherwise -
canHandleEvent
private boolean canHandleEventCan handle event flag.trueif events handling is allowed,falseotherwise
-
-
Constructor Details
-
AbstractScopeAdapter
public AbstractScopeAdapter()
-
-
Method Details
-
setCanStart
public void setCanStart(boolean canStart) Setter for can start flag.- Parameters:
canStart-trueif scope is ready to be activated,falseotherwise
-
setCanCallService
public void setCanCallService(boolean canCallService) Setter for can call service flag- Parameters:
canCallService-trueif remote service calls are allowed for the scope,falseotherwise
-
setCanConnect
public void setCanConnect(boolean canConnect) Setter for can connect flag- Parameters:
canConnect-trueif connections to scope are allowed,falseotherwise
-
setJoin
public void setJoin(boolean canJoin) Setter for 'can join' flag- Parameters:
canJoin-trueif scope may be joined by users,falseotherwise
-
start
Called when a scope is created for the first time.- Specified by:
startin interfaceIScopeHandler- Parameters:
scope- the new scope object- Returns:
true
to allow,false
to deny
-
stop
Called just before a scope is disposed.- Specified by:
stopin 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:
connectin 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:
disconnectin interfaceIScopeHandler- Parameters:
conn- Connection objectscope- Scope object
-
join
Called just before a client enters the scope.- Specified by:
joinin 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:
leavein interfaceIScopeHandler- Parameters:
client- Client objectscope- Scope object
-
serviceCall
Called when a service is called.- Specified by:
serviceCallin 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:
addChildScopein 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:
removeChildScopein interfaceIScopeHandler- Parameters:
scope- Scope that has been removed
-
handleEvent
Handle an event.- Specified by:
handleEventin 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
-