Search in sources :

Example 1 with CreateMeetingRequestPayload

use of org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload in project bigbluebutton by bigbluebutton.

the class CreateMeetingRequestTest method testCreateMeetingRequest.

@Test
public void testCreateMeetingRequest() {
    String meetingId = "abc123";
    String externalId = "extabc123";
    String parentId = "";
    Boolean record = false;
    Integer durationInMinutes = 20;
    String name = "Breakout room 1";
    String voiceConfId = "851153";
    Boolean autoStartRecording = false;
    Boolean allowStartStopRecording = false;
    Boolean webcamsOnlyForModerator = false;
    Boolean isBreakout = true;
    Integer sequence = 4;
    String viewerPassword = "vp";
    String moderatorPassword = "mp";
    long createTime = System.currentTimeMillis();
    String createDate = new Date(createTime).toString();
    CreateMeetingRequestPayload payload = new CreateMeetingRequestPayload(meetingId, externalId, parentId, name, record, voiceConfId, durationInMinutes, autoStartRecording, allowStartStopRecording, webcamsOnlyForModerator, moderatorPassword, viewerPassword, createTime, createDate, isBreakout, sequence);
    CreateMeetingRequest msg = new CreateMeetingRequest(payload);
    Gson gson = new Gson();
    String json = gson.toJson(msg);
    System.out.println(json);
    CreateMeetingRequest rxMsg = gson.fromJson(json, CreateMeetingRequest.class);
    Assert.assertEquals(rxMsg.header.name, CreateMeetingRequest.NAME);
    Assert.assertEquals(rxMsg.payload.id, meetingId);
    Assert.assertEquals(rxMsg.payload.externalId, externalId);
    Assert.assertEquals(rxMsg.payload.parentId, parentId);
    Assert.assertEquals(rxMsg.payload.name, name);
    Assert.assertEquals(rxMsg.payload.voiceConfId, voiceConfId);
    Assert.assertEquals(rxMsg.payload.viewerPassword, viewerPassword);
    Assert.assertEquals(rxMsg.payload.moderatorPassword, moderatorPassword);
    Assert.assertEquals(rxMsg.payload.durationInMinutes, durationInMinutes);
    Assert.assertEquals(rxMsg.payload.isBreakout, isBreakout);
    Assert.assertEquals(rxMsg.payload.sequence, sequence);
}
Also used : CreateMeetingRequestPayload(org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload) Gson(com.google.gson.Gson) Date(java.util.Date) Test(org.junit.Test)

Example 2 with CreateMeetingRequestPayload

use of org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload in project bigbluebutton by bigbluebutton.

the class RedisMessagingService method createMeeting.

public void createMeeting(String meetingID, String externalMeetingID, String parentMeetingID, String meetingName, Boolean recorded, String voiceBridge, Integer duration, Boolean autoStartRecording, Boolean allowStartStopRecording, Boolean webcamsOnlyForModerator, String moderatorPass, String viewerPass, Long createTime, String createDate, Boolean isBreakout, Integer sequence) {
    CreateMeetingRequestPayload payload = new CreateMeetingRequestPayload(meetingID, externalMeetingID, parentMeetingID, meetingName, recorded, voiceBridge, duration, autoStartRecording, allowStartStopRecording, webcamsOnlyForModerator, moderatorPass, viewerPass, createTime, createDate, isBreakout, sequence);
    CreateMeetingRequest msg = new CreateMeetingRequest(payload);
    Gson gson = new Gson();
    String json = gson.toJson(msg);
    log.info("Sending create meeting message to bbb-apps:[{}]", json);
    sender.send(MessagingConstants.TO_MEETING_CHANNEL, json);
}
Also used : CreateMeetingRequestPayload(org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload) CreateMeetingRequest(org.bigbluebutton.messages.CreateMeetingRequest) Gson(com.google.gson.Gson)

Aggregations

Gson (com.google.gson.Gson)2 CreateMeetingRequestPayload (org.bigbluebutton.messages.CreateMeetingRequest.CreateMeetingRequestPayload)2 Date (java.util.Date)1 CreateMeetingRequest (org.bigbluebutton.messages.CreateMeetingRequest)1 Test (org.junit.Test)1