Package org.red5.server.api.service
Class ServiceUtils
java.lang.Object
org.red5.server.api.service.ServiceUtils
Utility functions to invoke methods on connections.
- Author:
- The Red5 Project, Joachim Bauch (jojo@struktur.de), Paul Gregoire (mondain@gmail.com)
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
invokeOnAllConnections
(IScope scope, String method, Object[] params) Deprecated.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
invokeOnAllScopeConnections
(IScope scope, String method, Object[] params, IPendingServiceCallback callback) Invoke a method on all connections of a 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) Deprecated.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 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 void
notifyOnAllConnections
(String method, Object[] params) Notify a method on all connections to the current scope.static void
notifyOnAllConnections
(IScope scope, String method, Object[] params) Deprecated.static void
notifyOnAllScopeConnections
(IScope scope, String method, Object[] params) Notify a method on all connections of a scope.static void
notifyOnClient
(IClient client, IScope scope, String method, Object[] params) Deprecated.static boolean
notifyOnConnection
(String method, Object[] params) Notify a method on the current connection.static boolean
notifyOnConnection
(IConnection conn, String method, Object[] params) Notify a method on a given connection.
-
Field Details
-
log
private static final org.slf4j.Logger log
-
-
Constructor Details
-
ServiceUtils
public ServiceUtils()
-
-
Method Details
-
invokeOnConnection
Invoke a method on the current connection.- Parameters:
method
- name of the method to invokeparams
- parameters to pass to the method- Returns:
true
if the connection supports method calls, otherwisefalse
-
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 invokeparams
- parameters to pass to the methodcallback
- object to notify when result is received- Returns:
true
if the connection supports method calls, otherwisefalse
-
invokeOnConnection
Invoke a method on a given connection.- Parameters:
conn
- connection to invoke method onmethod
- name of the method to invokeparams
- parameters to pass to the method- Returns:
true
if the connection supports method calls, otherwisefalse
-
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 onmethod
- name of the method to invokeparams
- parameters to pass to the methodcallback
- object to notify when result is received- Returns:
true
if the connection supports method calls, otherwisefalse
-
invokeOnAllConnections
Invoke a method on all connections to the current scope.- Parameters:
method
- name of the method to invokeparams
- 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 invokeparams
- parameters to pass to the methodcallback
- object to notify when result is received
-
invokeOnAllConnections
Deprecated.Invoke a method on all connections to a given scope.- Parameters:
scope
- scope to get connections formethod
- name of the method to invokeparams
- 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 formethod
- name of the method to invokeparams
- parameters to pass to the methodcallback
- 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 frommethod
- name of the method to invokeparams
- parameters to pass to the methodcallback
- object to notify when result is received
-
invokeOnClient
Invoke a method on all connections of a client to a given scope.- Parameters:
client
- client to get connections forscope
- scope to get connections of the client frommethod
- name of the method to invokeparams
- parameters to pass to the method
-
invokeOnClient
@Deprecated public static void invokeOnClient(IClient client, IScope scope, String method, Object[] params, IPendingServiceCallback callback) Deprecated.Invoke a method on all connections of a client to a given scope and handle result.- Parameters:
client
- client to get connections forscope
- scope to get connections of the client frommethod
- name of the method to invokeparams
- parameters to pass to the methodcallback
- object to notify when result is received
-
notifyOnConnection
Notify a method on the current connection.- Parameters:
method
- name of the method to notifyparams
- parameters to pass to the method- Returns:
true
if the connection supports method calls, otherwisefalse
-
notifyOnConnection
Notify a method on a given connection.- Parameters:
conn
- connection to notify method onmethod
- name of the method to notifyparams
- parameters to pass to the method- Returns:
true
if the connection supports method calls, otherwisefalse
-
notifyOnAllConnections
Notify a method on all connections to the current scope.- Parameters:
method
- name of the method to notifyparams
- parameters to pass to the method
-
notifyOnAllConnections
Deprecated.Notify a method on all connections to a given scope.- Parameters:
scope
- scope to get connections formethod
- name of the method to notifyparams
- parameters to pass to the method
-
notifyOnAllScopeConnections
Notify a method on all connections of a scope.- Parameters:
scope
- scope to dispatch eventmethod
- name of the method to notifyparams
- parameters to pass to the method
-
notifyOnClient
@Deprecated public static void notifyOnClient(IClient client, IScope scope, String method, Object[] params) Deprecated.Notify a method on all connections of a client to a given scope.- Parameters:
client
- client to get connections forscope
- scope to get connections of the client frommethod
- name of the method to notifyparams
- parameters to pass to the method
-
invokeOnAllScopeConnections(IScope, String, Object[], IPendingServiceCallback)
instead