use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.
the class ConnectionInvokerService method handleDisconnectAllClientsMessage.
private void handleDisconnectAllClientsMessage(DisconnectAllClientsMessage msg) {
IScope meetingScope = getScope(msg.getMeetingId());
if (meetingScope != null) {
Set<IConnection> conns = meetingScope.getClientConnections();
for (IConnection conn : conns) {
if (conn.isConnected()) {
String connId = (String) conn.getAttribute("USERID");
log.info("Disconnecting client=[{}] from meeting=[{}]", connId, msg.getMeetingId());
conn.close();
}
}
}
}
use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.
the class ConnectionInvokerService method handlDisconnectClientMessage.
private void handlDisconnectClientMessage(DisconnectClientMessage msg) {
IScope meetingScope = getScope(msg.getMeetingId());
if (meetingScope != null) {
IConnection conn = getConnection(meetingScope, msg.getUserId());
if (conn != null) {
if (conn.isConnected()) {
log.info("Disconnecting user=[{}] from meeting=[{}]", msg.getUserId(), msg.getMeetingId());
conn.close();
}
}
}
}
use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.
the class ConnectionInvokerService method sendSharedObjectMessage.
private void sendSharedObjectMessage(SharedObjectClientMessage msg) {
System.out.println("*********** Request to send [" + msg.getMessageName() + "] using shared object.");
IScope meetingScope = getScope(msg.getMeetingID());
if (meetingScope != null) {
if (meetingScope.hasChildScope(ScopeType.SHARED_OBJECT, msg.getSharedObjectName())) {
ISharedObject so = getSharedObject(meetingScope, msg.getSharedObjectName());
if (so != null) {
System.out.println("*********** Sending [" + msg.getMessageName() + "] using shared object.");
so.sendMessage(msg.getMessageName(), msg.getMessage());
} else {
System.out.println("**** Cannot get SO for [" + msg.getSharedObjectName() + "]");
}
} else {
System.out.println("**** No SO scope for [" + msg.getSharedObjectName() + "]");
}
} else {
System.out.println("**** No Meeting scope for [" + msg.getMeetingID() + "]");
}
}
use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.
the class ConnectionInvokerService method sendDirectMessage.
private void sendDirectMessage(final DirectClientMessage msg) {
Runnable sender = new Runnable() {
public void run() {
IScope meetingScope = getScope(msg.getMeetingID());
if (meetingScope != null) {
log.debug("Found scope =[{}] for meeting=[{}]", meetingScope.getName(), msg.getMeetingID());
IConnection conn = getConnection(meetingScope, msg.getUserID());
if (conn != null) {
if (conn.isConnected()) {
List<Object> params = new ArrayList<Object>();
params.add(msg.getMessageName());
params.add(msg.getMessage());
log.debug("Sending message=[{}] to meeting=[{}]", msg.getMessageName(), msg.getMeetingID());
ServiceUtils.invokeOnConnection(conn, "onMessageFromServer", params.toArray());
} else {
log.warn("Connection not connected for userid=[{}] in meeting=[{}]", msg.getUserID(), msg.getMeetingID());
}
} else {
log.warn("No connection for userid=[{}] in meeting=[{}]", msg.getUserID(), msg.getMeetingID());
}
} else {
log.error("Failed to find scope for meeting=[{}]", msg.getMeetingID());
}
}
};
runExec.execute(sender);
}
use of org.red5.server.api.scope.IScope in project bigbluebutton by bigbluebutton.
the class ConnectionInvokerService method sendBroadcastMessage.
private void sendBroadcastMessage(final BroadcastClientMessage msg) {
Runnable sender = new Runnable() {
public void run() {
IScope meetingScope = getScope(msg.getMeetingID());
if (meetingScope != null) {
List<Object> params = new ArrayList<Object>();
params.add(msg.getMessageName());
params.add(msg.getMessage());
ServiceUtils.invokeOnAllScopeConnections(meetingScope, "onMessageFromServer", params.toArray(), null);
}
}
};
runExec.execute(sender);
}
Aggregations