Search in sources :

Example 1 with PubSubPingMessagePayload

use of org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload in project bigbluebutton by bigbluebutton.

the class ToJsonEncoder method encodePubSubPongMessage.

public String encodePubSubPongMessage(String system, Long timestamp) {
    PubSubPongMessage m = new PubSubPongMessage();
    MessageHeader header = new MessageHeader();
    PubSubPingMessagePayload payload = new PubSubPingMessagePayload();
    header.name = PubSubPongMessage.PUBSUB_PONG;
    header.timestamp = System.nanoTime();
    payload.system = system;
    payload.timestamp = timestamp;
    m.header = header;
    m.payload = payload;
    Gson gson = new Gson();
    return gson.toJson(m);
}
Also used : PubSubPongMessage(org.bigbluebutton.common.messages.PubSubPongMessage) Gson(com.google.gson.Gson) MessageHeader(org.bigbluebutton.common.messages.MessageHeader) PubSubPingMessagePayload(org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload)

Example 2 with PubSubPingMessagePayload

use of org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload in project bigbluebutton by bigbluebutton.

the class ToJsonEncoder method encodePubSubPingMessage.

public String encodePubSubPingMessage(String system, Long timestamp) {
    PubSubPingMessage m = new PubSubPingMessage();
    MessageHeader header = new MessageHeader();
    PubSubPingMessagePayload payload = new PubSubPingMessagePayload();
    header.name = PubSubPingMessage.PUBSUB_PING;
    header.timestamp = System.nanoTime();
    payload.system = system;
    payload.timestamp = timestamp;
    m.header = header;
    m.payload = payload;
    Gson gson = new Gson();
    return gson.toJson(m);
}
Also used : PubSubPingMessage(org.bigbluebutton.common.messages.PubSubPingMessage) Gson(com.google.gson.Gson) MessageHeader(org.bigbluebutton.common.messages.MessageHeader) PubSubPingMessagePayload(org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload)

Aggregations

Gson (com.google.gson.Gson)2 MessageHeader (org.bigbluebutton.common.messages.MessageHeader)2 PubSubPingMessagePayload (org.bigbluebutton.common.messages.payload.PubSubPingMessagePayload)2 PubSubPingMessage (org.bigbluebutton.common.messages.PubSubPingMessage)1 PubSubPongMessage (org.bigbluebutton.common.messages.PubSubPongMessage)1