use of com.google.gson.Gson in project bigbluebutton by bigbluebutton.
the class UserClientMessageSender method processUpdateBreakoutUsers.
private void processUpdateBreakoutUsers(UpdateBreakoutUsers msg) {
Map<String, Object> args = new HashMap<String, Object>();
args.put("parentMeetingId", msg.payload.parentMeetingId);
args.put("breakoutMeetingId", msg.payload.breakoutMeetingId);
args.put("users", msg.payload.users);
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(args));
BroadcastClientMessage m = new BroadcastClientMessage(msg.payload.parentMeetingId, "updateBreakoutUsers", message);
service.sendMessage(m);
}
use of com.google.gson.Gson in project bigbluebutton by bigbluebutton.
the class AbstractService method addHeaderToMessage.
public String addHeaderToMessage(String jsonMessage, String messageName) {
JsonObject payload = JsonEncoderUtil.buildPayload(jsonMessage);
JsonObject header = JsonEncoderUtil.addMessageHeader(messageName);
return new Gson().toJson(JsonEncoderUtil.headerAndPayload(header, payload));
}
use of com.google.gson.Gson in project bigbluebutton by bigbluebutton.
the class BigBlueButtonApplication method roomDisconnect.
@Override
public void roomDisconnect(IConnection conn) {
String remoteHost = Red5.getConnectionLocal().getRemoteAddress();
int remotePort = Red5.getConnectionLocal().getRemotePort();
BigBlueButtonSession bbbSession = (BigBlueButtonSession) Red5.getConnectionLocal().getAttribute(Constants.SESSION);
String meetingId = bbbSession.getRoom();
String userId = bbbSession.getInternalUserID();
String connType = getConnectionType(Red5.getConnectionLocal().getType());
String userFullname = bbbSession.getUsername();
String connId = Red5.getConnectionLocal().getSessionId();
String clientId = Red5.getConnectionLocal().getClient().getId();
String sessionId = CONN + userId;
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("meetingId", meetingId);
logData.put("connType", connType);
logData.put("connId", connId);
logData.put("clientId", clientId);
logData.put("remoteAddress", remoteHost + ":" + remotePort);
logData.put("sessionId", sessionId);
logData.put("userId", userId);
logData.put("username", userFullname);
logData.put("event", "user_leaving_bbb_apps");
logData.put("description", "User leaving BBB Apps.");
Gson gson = new Gson();
String logStr = gson.toJson(logData);
boolean removeUser = userConnections.userDisconnected(userId, connId);
if (removeUser) {
log.info("User leaving bbb-apps: data={}", logStr);
red5InGW.userLeft(bbbSession.getRoom(), getBbbSession().getInternalUserID(), sessionId);
} else {
log.info("User not leaving bbb-apps but just disconnected: data={}", logStr);
}
super.roomDisconnect(conn);
}
use of com.google.gson.Gson in project bigbluebutton by bigbluebutton.
the class BigBlueButtonApplication method getHeapStatsHelper.
private void getHeapStatsHelper() {
int mb = 1024 * 1024;
// Getting the runtime reference from system
Runtime runtime = Runtime.getRuntime();
long usedMemory = (runtime.totalMemory() - runtime.freeMemory()) / mb;
long freeMemory = runtime.freeMemory() / mb;
long totalMemory = runtime.totalMemory() / mb;
long maxMemory = runtime.maxMemory() / mb;
Map<String, Object> logData = new HashMap<String, Object>();
logData.put("used", usedMemory);
logData.put("free", freeMemory);
logData.put("total", totalMemory);
logData.put("max", maxMemory);
Gson gson = new Gson();
String logStr = gson.toJson(logData);
log.info("JVM Heap [MB] data={}", logStr);
}
use of com.google.gson.Gson in project bigbluebutton by bigbluebutton.
the class CaptionClientMessageSender method processSendCaptionHistoryReplyMessage.
private void processSendCaptionHistoryReplyMessage(SendCaptionHistoryReplyMessage msg) {
Map<String, Object> message = new HashMap<String, Object>();
Gson gson = new Gson();
message.put("msg", gson.toJson(msg.captionHistory));
DirectClientMessage m = new DirectClientMessage(msg.meetingID, msg.requesterID, "sendCaptionHistoryReply", message);
service.sendMessage(m);
}
Aggregations