## org.red5.server.api.service
Class ServiceUtils

    java.lang.Object
      org.red5.server.api.service.ServiceUtils

    public class ServiceUtils

extends Object

Utility functions to invoke methods on connections.

Author:
  The Red5 Project (red5@osflash.org), Joachim Bauch (jojo@struktur.de)

Constructor Summary
`ServiceUtils()`

Method Summary
`static void` `invokeOnAllConnections(IScope scope, String method, Object[] params)` Invoke a method on all connections to a given scope.
`static void` `invokeOnAllConnections(IScope scope, String method, Object[] params, IPendingServiceCallback callback)` Invoke a method on all connections to a given scope and handle result.
`static void` `invokeOnAllConnections(String method, Object[] params)` Invoke a method on all connections to the current scope.
`static void` `invokeOnAllConnections(String method, Object[] params, IPendingServiceCallback callback)` Invoke a method on all connections to the current scope and handle result.
`static void` `invokeOnClient(IClient client, IScope scope, String method, Object[] params)` Invoke a method on all connections of a client to a given scope.
`static void` `invokeOnClient(IClient client, IScope scope, String method, Object[] params, IPendingServiceCallback callback)` Invoke a method on all connections of a client to a given scope and handle result.
`static boolean` `invokeOnConnection(IConnection conn, String method, Object[] params)` Invoke a method on a given connection.
`static boolean` `invokeOnConnection(IConnection conn, String method, Object[] params, IPendingServiceCallback callback)` Invoke a method on a given connection and handle result.
`static boolean` `invokeOnConnection(String method, Object[] params)` Invoke a method on the current connection.
`static boolean` `invokeOnConnection(String method, Object[] params, IPendingServiceCallback callback)` Invoke a method on the current connection and handle result.
`static void` `notifyOnAllConnections(IScope scope, String method, Object[] params)` Notify a method on all connections to a given scope.
`static void` `notifyOnAllConnections(String method, Object[] params)` Notify a method on all connections to the current scope.
`static void` `notifyOnClient(IClient client, IScope scope, String method, Object[] params)` Notify a method on all connections of a client to a given scope.
`static boolean` `notifyOnConnection(IConnection conn, String method, Object[] params)` Notify a method on a given connection.
`static boolean` `notifyOnConnection(String method, Object[] params)` Notify a method on the current connection.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServiceUtils

    public ServiceUtils()

Method Detail

### invokeOnConnection

    public static boolean invokeOnConnection(String method,
                                             Object[] params)

  Invoke a method on the current connection.

  Parameters:
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### invokeOnConnection

    public static boolean invokeOnConnection(String method,
                                             Object[] params,
                                             IPendingServiceCallback callback)

  Invoke a method on the current connection and handle result.

  Parameters:
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
    `callback` - object to notify when result is received
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### invokeOnConnection

    public static boolean invokeOnConnection(IConnection conn,
                                             String method,
                                             Object[] params)

  Invoke a method on a given connection.

  Parameters:
    `conn` - connection to invoke method on
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### invokeOnConnection

    public static boolean invokeOnConnection(IConnection conn,
                                             String method,
                                             Object[] params,
                                             IPendingServiceCallback callback)

  Invoke a method on a given connection and handle result.

  Parameters:
    `conn` - connection to invoke method on
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
    `callback` - object to notify when result is received
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### invokeOnAllConnections

    public static void invokeOnAllConnections(String method,
                                              Object[] params)

  Invoke a method on all connections to the current scope.

  Parameters:
    `method` - name of the method to invoke
    `params` - parameters to pass to the method

### invokeOnAllConnections

    public static void invokeOnAllConnections(String method,
                                              Object[] params,
                                              IPendingServiceCallback callback)

  Invoke a method on all connections to the current scope and handle result.

  Parameters:
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
    `callback` - object to notify when result is received

### invokeOnAllConnections

    public static void invokeOnAllConnections(IScope scope,
                                              String method,
                                              Object[] params)

  Invoke a method on all connections to a given scope.

  Parameters:
    `scope` - scope to get connections for
    `method` - name of the method to invoke
    `params` - parameters to pass to the method

### invokeOnAllConnections

    public static void invokeOnAllConnections(IScope scope,
                                              String method,
                                              Object[] params,
                                              IPendingServiceCallback callback)

  Invoke a method on all connections to a given scope and handle result.

  Parameters:
    `scope` - scope to get connections for
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
    `callback` - object to notify when result is received

### invokeOnClient

    public static void invokeOnClient(IClient client,
                                      IScope scope,
                                      String method,
                                      Object[] params)

  Invoke a method on all connections of a client to a given scope.

  Parameters:
    `client` - client to get connections for
    `scope` - scope to get connections of the client from
    `method` - name of the method to invoke
    `params` - parameters to pass to the method

### invokeOnClient

    public static void invokeOnClient(IClient client,
                                      IScope scope,
                                      String method,
                                      Object[] params,
                                      IPendingServiceCallback callback)

  Invoke a method on all connections of a client to a given scope and handle result.

  Parameters:
    `client` - client to get connections for
    `scope` - scope to get connections of the client from
    `method` - name of the method to invoke
    `params` - parameters to pass to the method
    `callback` - object to notify when result is received

### notifyOnConnection

    public static boolean notifyOnConnection(String method,
                                             Object[] params)

  Notify a method on the current connection.

  Parameters:
    `method` - name of the method to notify
    `params` - parameters to pass to the method
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### notifyOnConnection

    public static boolean notifyOnConnection(IConnection conn,
                                             String method,
                                             Object[] params)

  Notify a method on a given connection.

  Parameters:
    `conn` - connection to notify method on
    `method` - name of the method to notify
    `params` - parameters to pass to the method
  Returns:
    `true` if the connection supports method calls, otherwise `false`

### notifyOnAllConnections

    public static void notifyOnAllConnections(String method,
                                              Object[] params)

  Notify a method on all connections to the current scope.

  Parameters:
    `method` - name of the method to notify
    `params` - parameters to pass to the method

### notifyOnAllConnections

    public static void notifyOnAllConnections(IScope scope,
                                              String method,
                                              Object[] params)

  Notify a method on all connections to a given scope.

  Parameters:
    `scope` - scope to get connections for
    `method` - name of the method to notify
    `params` - parameters to pass to the method

### notifyOnClient

    public static void notifyOnClient(IClient client,
                                      IScope scope,
                                      String method,
                                      Object[] params)

  Notify a method on all connections of a client to a given scope.

  Parameters:
    `client` - client to get connections for
    `scope` - scope to get connections of the client from
    `method` - name of the method to notify
    `params` - parameters to pass to the method

Copyright © 2006-2010 The Red5 Project