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, Joachim Bauch (jojo@struktur.de), Paul Gregoire (mondain@gmail.com)
  • Field Details

    • log

      private static final org.slf4j.Logger log
  • Constructor Details

    • ServiceUtils

      public ServiceUtils()
  • Method Details

    • 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

      @Deprecated 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
    • invokeOnAllScopeConnections

      public static void invokeOnAllScopeConnections(IScope scope, String method, Object[] params, IPendingServiceCallback callback)
      Invoke a method on all connections of a scope and handle result.
      Parameters:
      scope - scope to get connections from
      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

      @Deprecated 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

      @Deprecated 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
    • notifyOnAllScopeConnections

      public static void notifyOnAllScopeConnections(IScope scope, String method, Object[] params)
      Notify a method on all connections of a scope.
      Parameters:
      scope - scope to dispatch event
      method - name of the method to notify
      params - parameters to pass to the method
    • notifyOnClient

      @Deprecated 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