## org.red5.server.api
Interface IScopeHandler

All Superinterfaces:
  IEventHandler

All Known Subinterfaces:
  IStreamAwareScopeHandler

All Known Implementing Classes:
  AbstractScopeAdapter, ApplicationAdapter, CoreHandler, MultiThreadedApplicationAdapter, StatefulScopeWrappingAdapter

    public interface IScopeHandler

extends IEventHandler

The scope handler controls actions performed against a scope object, and also is notified of all events. Gives fine grained control over what actions can be performed with the can* methods. Allows for detailed reporting on what is happening within the scope with the on* methods. This is the core interface users implement to create applications. The thread local connection is always available via the Red5 object within these methods

Author:
  The Red5 Project (red5@osflash.org), Luke Hubbard (luke@codegent.com)

Method Summary
`boolean` `addChildScope(IBasicScope scope)` Called just before a child scope is added.
`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` `join(IClient client, IScope scope)` Called just before a client enters the scope.
`void` `leave(IClient client, IScope scope)` 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.
`boolean` `start(IScope scope)` Called when a scope is created for the first time.
`void` `stop(IScope scope)` Called just before a scope is disposed.

Methods inherited from interface org.red5.server.api.event.IEventHandler
`handleEvent`

Method Detail

### start

    boolean start(IScope scope)

  Called when a scope is created for the first time.

  Parameters:
    `scope` - the new scope object
  Returns:
    `true` to allow, `false` to deny

### stop

    void stop(IScope scope)

  Called just before a scope is disposed.

  Parameters:
    `scope` - Scope that id disposed

### connect

    boolean connect(IConnection conn,
                    IScope scope,
                    Object[] params)

  Called just before every connection to a scope. You can pass additional params from client using `NetConnection.connect` method (see below).

  Parameters:
    `conn` - Connection object
    `params` - List of params passed from client via `NetConnection.connect` method. All parameters but the first one passed to `NetConnection.connect` method are available as params array.
    `scope` - Scope object
  Returns:
    `true` to allow, `false` to deny

### disconnect

    void disconnect(IConnection conn,
                    IScope scope)

  Called just after the a connection is disconnected.

  Parameters:
    `conn` - Connection object
    `scope` - Scope object

### addChildScope

    boolean addChildScope(IBasicScope scope)

  Called just before a child scope is added.

  Parameters:
    `scope` - Scope that will be added
  Returns:
    `true` to allow, `false` to deny

### removeChildScope

    void removeChildScope(IBasicScope scope)

  Called just after a child scope has been removed.

  Parameters:
    `scope` - Scope that has been removed

### join

    boolean join(IClient client,
                 IScope scope)

  Called just before a client enters the scope.

  Parameters:
    `client` - Client object
    `scope` - Scope that is joined by client
  Returns:
    `true` to allow, `false` to deny connection

### leave

    void leave(IClient client,
               IScope scope)

  Called just after the client leaves the scope.

  Parameters:
    `client` - Client object
    `scope` - Scope object

### serviceCall

    boolean serviceCall(IConnection conn,
                        IServiceCall call)

  Called when a service is called.

  Parameters:
    `conn` - The connection object
    `call` - The call object.
  Returns:
    `true` to allow, `false` to deny

Copyright © 2006-2010 The Red5 Project