javadoc recorder module - logs updated to java code, playback-web update and playback-client update
This commit is contained in:
parent
fc05379396
commit
2f69b4e48b
@ -77,22 +77,22 @@ private static Logger log = Red5LoggerFactory.getLogger( ChatEventRecorder.class
|
||||
private String parseChatToJSON(String message){
|
||||
String json="{ ";
|
||||
int idx_ini=message.indexOf("color=")+7;
|
||||
int idx_end=message.indexOf("\">", idx_ini)-1;
|
||||
int idx_end=message.indexOf("\">", idx_ini);
|
||||
String color=message.substring(idx_ini, idx_end);
|
||||
|
||||
idx_ini=message.indexOf("<b>")+4;
|
||||
idx_end=message.indexOf("</b>", idx_ini)-14;
|
||||
idx_end=message.indexOf("</b>", idx_ini)-13;
|
||||
String user=message.substring(idx_ini,idx_end);
|
||||
|
||||
idx_ini=message.indexOf("</b>")+4;
|
||||
idx_end=message.indexOf("</font>", idx_ini)-1;
|
||||
idx_end=message.indexOf("</font>", idx_ini);
|
||||
String text=message.substring(idx_ini,idx_end);
|
||||
|
||||
json+="\"event\":\"CHAT\" }";
|
||||
json+="\"color\":\""+color+"\", ";
|
||||
json+="\"user\":\""+user+"\", ";
|
||||
json+="\"text\":\""+text+"\", ";
|
||||
json+="\"version\":\"0.1\", ";
|
||||
json+="\"module\":\"chat\", ";
|
||||
json+="\"event\":\"new_message\", ";
|
||||
json+="\"user\":\""+user.trim()+"\", ";
|
||||
json+="\"text\":\""+text.trim()+"\", ";
|
||||
json+="\"color\":\""+color.trim()+"\" }";
|
||||
|
||||
return json;
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ public class ChatHandler extends ApplicationAdapter implements IApplication{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log.error("Failed to start room ", scope.getName());
|
||||
log.error("Failed to start room {}", scope.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public class ChatRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IChatRoomListener listener = (IChatRoomListener) iter.next();
|
||||
log.debug("calling newChatMessage on listener ${listener.getName()}");
|
||||
log.debug("calling newChatMessage on listener {}",listener.getName());
|
||||
listener.newChatMessage(msg);
|
||||
}
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ public class ParticipantsApplication {
|
||||
roomsManager.addRoomListener(room, listener);
|
||||
return true;
|
||||
}
|
||||
log.warn("Adding listener to a non-existant room ${room}");
|
||||
log.warn("Adding listener to a non-existant room {}",room);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -65,9 +65,9 @@ public class ParticipantsApplication {
|
||||
}
|
||||
|
||||
public Map getParticipants(String roomName) {
|
||||
log.debug("${APP}:getParticipants - ${roomName}");
|
||||
log.debug(APP+":getParticipants - "+roomName);
|
||||
if (! roomsManager.hasRoom(roomName)) {
|
||||
log.warn("Could not find room ${roomName}");
|
||||
log.warn("Could not find room "+roomName);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -75,10 +75,10 @@ public class ParticipantsApplication {
|
||||
}
|
||||
|
||||
public boolean participantLeft(String roomName, Long userid) {
|
||||
log.debug("Participant $userid leaving room $roomName");
|
||||
log.debug("Participant "+userid+" leaving room "+roomName);
|
||||
if (roomsManager.hasRoom(roomName)) {
|
||||
Room room = roomsManager.getRoom(roomName);
|
||||
log.debug("Removing $userid from room $roomName");
|
||||
log.debug("Removing "+userid+" from room "+roomName);
|
||||
room.removeParticipant(userid);
|
||||
return true;
|
||||
}
|
||||
@ -88,15 +88,15 @@ public class ParticipantsApplication {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean participantJoin(String roomName, Long userid, String username, String role, String externUserID, Map status) {
|
||||
log.debug("${APP}:participant joining room ${roomName}");
|
||||
log.debug(APP+":participant joining room "+roomName);
|
||||
if (roomsManager.hasRoom(roomName)) {
|
||||
Participant p = new Participant(userid, username, role, externUserID, status);
|
||||
Room room = roomsManager.getRoom(roomName);
|
||||
room.addParticipant(p);
|
||||
log.debug("${APP}:participant joined room ${roomName}");
|
||||
log.debug(APP+":participant joined room "+roomName);
|
||||
return true;
|
||||
}
|
||||
log.debug("${APP}:participant failed to join room ${roomName}");
|
||||
log.debug(APP+":participant failed to join room"+roomName);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,12 @@ public class ParticipantsEventRecorder implements IEventRecorder, IRoomListener
|
||||
|
||||
String name = "PARTICIPANT";
|
||||
|
||||
private final String RECORD_EVENT_JOIN="join";
|
||||
private final String RECORD_EVENT_LEAVE="leave";
|
||||
private final String RECORD_EVENT_STATUS_CHANGE="status_change";
|
||||
private final String RECORD_EVENT_LEAVE_ALL="leave_all";
|
||||
|
||||
|
||||
public ParticipantsEventRecorder(ISharedObject so, Boolean record) {
|
||||
this.so = so;
|
||||
this.record = record;
|
||||
@ -68,17 +74,18 @@ public class ParticipantsEventRecorder implements IEventRecorder, IRoomListener
|
||||
@Override
|
||||
public void endAndKickAll() {
|
||||
so.sendMessage("logout", new ArrayList());
|
||||
recordEvent(parseParticipantsToJSON(new ArrayList(), this.RECORD_EVENT_LEAVE_ALL));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void participantJoined(Participant p) {
|
||||
log.debug("A participant has joined ${p.userid}.");
|
||||
log.debug("A participant has joined {}.",p.getUserid());
|
||||
ArrayList args = new ArrayList();
|
||||
args.add(p.toMap());
|
||||
log.debug("Sending participantJoined ${p.userid} to client.");
|
||||
log.debug("Sending participantJoined {} to client.",p.getUserid());
|
||||
so.sendMessage("participantJoined", args);
|
||||
recordEvent(parseParticipantsToJSON(args, "JOIN"));
|
||||
recordEvent(parseParticipantsToJSON(args, this.RECORD_EVENT_JOIN));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -87,41 +94,46 @@ public class ParticipantsEventRecorder implements IEventRecorder, IRoomListener
|
||||
ArrayList args = new ArrayList();
|
||||
args.add(userid);
|
||||
so.sendMessage("participantLeft", args);
|
||||
recordEvent(parseParticipantsToJSON(args, "LEAVE"));
|
||||
recordEvent(parseParticipantsToJSON(args, this.RECORD_EVENT_LEAVE));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void participantStatusChange(Long userid, String status, Object value) {
|
||||
log.debug("A participant's status has changed ${userid} $status $value.");
|
||||
log.debug("A participant's status has changed "+userid+" "+status+" "+value);
|
||||
ArrayList args = new ArrayList();
|
||||
args.add(userid);
|
||||
args.add(status);
|
||||
args.add(value);
|
||||
so.sendMessage("participantStatusChange", args);
|
||||
recordEvent(parseParticipantsToJSON(args, "STATUS_CHANGE"));
|
||||
recordEvent(parseParticipantsToJSON(args, this.RECORD_EVENT_STATUS_CHANGE));
|
||||
}
|
||||
|
||||
/****** parse method ********/
|
||||
private String parseParticipantsToJSON(ArrayList list, String type){
|
||||
String json="{ ";
|
||||
if(type.equalsIgnoreCase("STATUS_CHANGE")){
|
||||
json+="\"event\":\"STATUS_CHANGE\", ";
|
||||
|
||||
json+="\"module\":\"participants\", ";
|
||||
if(type.equalsIgnoreCase(this.RECORD_EVENT_STATUS_CHANGE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_STATUS_CHANGE+"\", ";
|
||||
json+="\"userid\":\""+list.get(0)+"\", ";
|
||||
json+="\"status\":\""+list.get(1)+"\", ";
|
||||
json+="\"value\":\""+list.get(2)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase("JOIN")){
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_JOIN)){
|
||||
Map map=(Map) list.get(0);
|
||||
json+="\"event\":\"JOIN\", ";
|
||||
json+="\"event\":\""+this.RECORD_EVENT_JOIN+"\", ";
|
||||
json+="\"userid\":\""+map.get("userid")+"\", ";
|
||||
json+="\"name\":\""+map.get("name")+"\", ";
|
||||
json+="\"role\":\""+map.get("role")+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase("LEAVE")){
|
||||
json+="\"event\":\"LEAVE\", ";
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_LEAVE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_LEAVE+"\", ";
|
||||
json+="\"userid\":\""+list.get(0)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_LEAVE_ALL)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_LEAVE_ALL+"\" ";
|
||||
}
|
||||
json+="}";
|
||||
return json;
|
||||
}
|
||||
|
@ -47,47 +47,47 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@Override
|
||||
public boolean appConnect(IConnection conn, Object[] params) {
|
||||
log.debug("${APP}:appConnect");
|
||||
log.debug(APP+":appConnect");
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appDisconnect(IConnection conn) {
|
||||
log.debug( "${APP}:appDisconnect");
|
||||
log.debug( APP+":appDisconnect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appJoin(IClient client, IScope scope) {
|
||||
log.debug( "${APP}:appJoin ${scope.name}");
|
||||
log.debug( APP+":appJoin "+scope.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appLeave(IClient client, IScope scope) {
|
||||
log.debug("${APP}:appLeave ${scope.name}");
|
||||
log.debug(APP+":appLeave "+scope.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appStart(IScope scope) {
|
||||
log.debug("${APP}:appStart ${scope.name}");
|
||||
log.debug(APP+":appStart "+scope.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appStop(IScope scope) {
|
||||
log.debug("${APP}:appStop ${scope.name}");
|
||||
log.debug(APP+":appStop "+scope.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean roomConnect(IConnection connection, Object[] params) {
|
||||
log.debug("${APP}:roomConnect");
|
||||
log.debug(APP+":roomConnect");
|
||||
|
||||
log.debug("In live mode");
|
||||
ISharedObject so = getSharedObject(connection.getScope(), PARTICIPANTS_SO);
|
||||
|
||||
//log.debug("Setting up recorder with recording {}", getBbbSession().getRecord())
|
||||
ParticipantsEventRecorder recorder = new ParticipantsEventRecorder(so, getBbbSession().getRecord());
|
||||
log.debug("adding event recorder to ${connection.scope.name}");
|
||||
log.debug("adding event recorder to {}",connection.getScope().getName());
|
||||
recorderApplication.addEventRecorder(connection.getScope().getName(), recorder);
|
||||
|
||||
log.debug("Adding room listener");
|
||||
@ -98,19 +98,19 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@Override
|
||||
public void roomDisconnect(IConnection connection) {
|
||||
log.debug("${APP}:roomDisconnect");
|
||||
log.debug(APP+":roomDisconnect");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean roomJoin(IClient client, IScope scope) {
|
||||
log.debug("${APP}:roomJoin ${scope.name} - ${scope.parent.name}");
|
||||
log.debug(APP+":roomJoin "+scope.getName()+" - "+scope.getParent().getName());
|
||||
participantJoin();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomLeave(IClient client, IScope scope) {
|
||||
log.debug("${APP}:roomLeave ${scope.name}");
|
||||
log.debug(APP+":roomLeave "+scope.getName());
|
||||
BigBlueButtonSession bbbSession = getBbbSession();
|
||||
if (bbbSession == null) {
|
||||
log.debug("roomLeave - session is null");
|
||||
@ -123,20 +123,20 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@Override
|
||||
public boolean roomStart(IScope scope) {
|
||||
log.debug("${APP} - roomStart ${scope.name}");
|
||||
log.debug(APP+" - roomStart "+scope.getName());
|
||||
// create ParticipantSO if it is not already created
|
||||
if (!hasSharedObject(scope, PARTICIPANTS_SO)) {
|
||||
if (createSharedObject(scope, PARTICIPANTS_SO, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log.error("Failed to start room ${scope.name}");
|
||||
log.error("Failed to start room {}",scope.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomStop(IScope scope) {
|
||||
log.debug("${APP}:roomStop ${scope.name}");
|
||||
log.debug(APP+":roomStop "+scope.getName());
|
||||
if (!hasSharedObject(scope, PARTICIPANTS_SO)) {
|
||||
clearSharedObjects(scope, PARTICIPANTS_SO);
|
||||
}
|
||||
@ -144,30 +144,30 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean participantJoin() {
|
||||
log.debug("${APP}:participantJoin - getting userid");
|
||||
log.debug(APP+":participantJoin - getting userid");
|
||||
BigBlueButtonSession bbbSession = getBbbSession();
|
||||
if (bbbSession == null) {
|
||||
log.warn("bbb session is null");
|
||||
}
|
||||
|
||||
Long userid = bbbSession.getUserid();
|
||||
log.debug("${APP}:participantJoin - userid $userid");
|
||||
log.debug(APP+":participantJoin - userid "+userid);
|
||||
String username = bbbSession.getUsername();
|
||||
log.debug("${APP}:participantJoin - username $username");
|
||||
log.debug(APP+":participantJoin - username "+username);
|
||||
String role = bbbSession.getRole();
|
||||
log.debug("${APP}:participantJoin - role $role");
|
||||
log.debug(APP+":participantJoin - role "+role);
|
||||
String room = bbbSession.getRoom();
|
||||
log.debug("${APP}:participantJoin - room $room");
|
||||
log.debug(APP+":participantJoin - room "+room);
|
||||
|
||||
String externUserID = bbbSession.getExternUserID();
|
||||
|
||||
log.debug("${APP}:participantJoin");
|
||||
log.debug(APP+":participantJoin");
|
||||
Map status = new HashMap();
|
||||
status.put("raiseHand", false);
|
||||
status.put("presenter", false);
|
||||
status.put("hasStream", false);
|
||||
|
||||
log.debug("${APP}:participantJoin setting status");
|
||||
log.debug(APP+":participantJoin setting status");
|
||||
return participantsApplication.participantJoin(room, userid, username, role, externUserID, status);
|
||||
}
|
||||
|
||||
@ -177,7 +177,7 @@ public class ParticipantsHandler extends ApplicationAdapter implements IApplicat
|
||||
}
|
||||
|
||||
public void setRecorderApplication(RecorderApplication a) {
|
||||
log.debug("Setting archive application");
|
||||
log.debug("Setting recorder application");
|
||||
recorderApplication = a;
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,9 @@ public class ParticipantsService {
|
||||
@SuppressWarnings("unchecked")
|
||||
public Map getParticipants() {
|
||||
String roomName = Red5.getConnectionLocal().getScope().getName();
|
||||
log.debug("getting participants for ${roomName}");
|
||||
log.debug("getting participants for {}",roomName);
|
||||
Map p = application.getParticipants(roomName);
|
||||
log.debug("getting participants for ${roomName}");
|
||||
log.debug("getting participants for {}",roomName);
|
||||
Map participants = new HashMap();
|
||||
if (p == null) {
|
||||
participants.put("count", 0);
|
||||
@ -67,7 +67,7 @@ public class ParticipantsService {
|
||||
|
||||
public void setParticipantStatus(Long userid, String status, Object value) {
|
||||
String roomName = Red5.getConnectionLocal().getScope().getName();
|
||||
log.debug("Setting participant status $roomName $userid $status $value");
|
||||
log.debug("Setting participant status "+roomName+" "+userid+" "+status+" "+value);
|
||||
application.setParticipantStatus(roomName, userid, status, value);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ public class ConversionUpdatesMessageListener implements MessageListener{
|
||||
message.put("presentationName", presentationName);
|
||||
message.put("messageKey", messageKey);
|
||||
|
||||
log.debug("JMS: ${messageKey}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",messageKey,presentationName);
|
||||
|
||||
if(messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_SUCCESS_KEY)||
|
||||
messageKey.equalsIgnoreCase(OFFICE_DOC_CONVERSION_FAILED_KEY)||
|
||||
@ -83,11 +83,11 @@ public class ConversionUpdatesMessageListener implements MessageListener{
|
||||
messageKey.equalsIgnoreCase(GENERATING_THUMBNAIL_KEY)||
|
||||
messageKey.equalsIgnoreCase(GENERATED_THUMBNAIL_KEY)||
|
||||
messageKey.equalsIgnoreCase(PAGE_COUNT_FAILED_KEY)){
|
||||
log.debug("JMS: ${messageKey}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",messageKey,presentationName);
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else if(messageKey.equalsIgnoreCase(PAGE_COUNT_EXCEEDED_KEY)){
|
||||
log.debug("JMS: ${messageKey}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",messageKey,presentationName);
|
||||
int numberOfPages = mapMessage.getInt("numberOfPages");
|
||||
int maxNumberPages = mapMessage.getInt("maxNumberPages");
|
||||
message.put("numberOfPages", numberOfPages);
|
||||
@ -100,13 +100,13 @@ public class ConversionUpdatesMessageListener implements MessageListener{
|
||||
message.put("numberOfPages", numberOfPages);
|
||||
message.put("pagesCompleted", pagesCompleted);
|
||||
|
||||
log.debug("JMS: ${messageKey}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",messageKey,presentationName);
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){
|
||||
String slidesInfo = mapMessage.getString("slidesInfo");
|
||||
message.put("slidesInfo", slidesInfo);
|
||||
log.debug("JMS: ${messageKey}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",messageKey,presentationName);
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else{
|
||||
|
@ -89,14 +89,14 @@ public class ConversionUpdatesReceiverImp implements ConversionUpdatesReceiver {
|
||||
message.put("code", code);
|
||||
message.put("presentationName", presentationName);
|
||||
|
||||
log.debug("JMS: ${code}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",code,presentationName);
|
||||
if(code.equalsIgnoreCase("SUCCESS")){
|
||||
log.debug("JMS: SUCCESS[$presentationName]");
|
||||
log.debug("JMS: SUCCESS[{}]",presentationName);
|
||||
message.put("message", mapMessage.getStringProperty("message"));
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else if(code.equalsIgnoreCase("THUMBNAILS")){
|
||||
log.debug("JMS: THUMBNAILS[$presentationName]");
|
||||
log.debug("JMS: THUMBNAILS[{}]",presentationName);
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else if(code.equalsIgnoreCase("FAILED_CONVERT_FORMAT")||
|
||||
@ -108,11 +108,11 @@ public class ConversionUpdatesReceiverImp implements ConversionUpdatesReceiver {
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_SWF_IMAGE")||
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_SWF_PDF")||
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_THUMBNAIL")){
|
||||
log.debug("JMS: ${code}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",code,presentationName);
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else if(code.equalsIgnoreCase("FAILED_CONVERT")){
|
||||
log.debug("JMS: FAILED_CONVERT[$presentationName]");
|
||||
log.debug("JMS: FAILED_CONVERT[{}]",presentationName);
|
||||
message.put("message", mapMessage.getStringProperty("message"));
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class ConversionUpdatesReceiverImp implements ConversionUpdatesReceiver {
|
||||
message.put("totalSlides", totalSlides);
|
||||
message.put("completedSlides", completedSlides);
|
||||
|
||||
log.debug("JMS: CONVERT[$presentationName, $completedSlides, $totalSlides]");
|
||||
log.debug("JMS: CONVERT["+presentationName+", "+completedSlides+", "+totalSlides+"]");
|
||||
conversionUpdatesProcessor.process(message);
|
||||
}
|
||||
else{
|
||||
|
@ -52,12 +52,12 @@ public class ConversionUpdatesService {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
log.info("${APP} - Will wait for document conversion updates messages.");
|
||||
log.info("{} - Will wait for document conversion updates messages.",APP);
|
||||
|
||||
while (waitForMessage) {
|
||||
Message jmsMessage = template.receive(destination);
|
||||
|
||||
log.debug("${APP} - Got JMS message.");
|
||||
log.debug("{} - Got JMS message.",APP);
|
||||
|
||||
if (jmsMessage instanceof MapMessage) {
|
||||
try {
|
||||
@ -72,7 +72,7 @@ public class ConversionUpdatesService {
|
||||
message.put("code", code);
|
||||
message.put("presentationName", presentationName);
|
||||
if(code.equalsIgnoreCase("SUCCESS")){
|
||||
log.debug("JMS: SUCCESS[$presentationName]");
|
||||
log.debug("JMS: SUCCESS[{}]",presentationName);
|
||||
message.put("message", mapMessage.getStringProperty("message"));
|
||||
presentationApplication.sendUpdateMessage(message);
|
||||
}
|
||||
@ -85,12 +85,12 @@ public class ConversionUpdatesService {
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_SWF_IMAGE")||
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_SWF_PDF")||
|
||||
code.equalsIgnoreCase("FAILED_CONVERT_THUMBNAIL")){
|
||||
log.debug("JMS: ${code}[$presentationName]");
|
||||
log.debug("JMS: {}[{}]",code,presentationName);
|
||||
presentationApplication.sendUpdateMessage(message);
|
||||
}
|
||||
else if(code.equalsIgnoreCase("FAILED")||
|
||||
code.equalsIgnoreCase("FAILED_CONVERT")){
|
||||
log.debug("JMS: FAILED[$presentationName]");
|
||||
log.debug("JMS: FAILED[{}]",presentationName);
|
||||
message.put("message", mapMessage.getStringProperty("message"));
|
||||
presentationApplication.sendUpdateMessage(message);
|
||||
}
|
||||
@ -101,7 +101,7 @@ public class ConversionUpdatesService {
|
||||
message.put("totalSlides", totalSlides);
|
||||
message.put("completedSlides", completedSlides);
|
||||
|
||||
log.debug("JMS: CONVERT[$presentationName, $completedSlides, $totalSlides]");
|
||||
log.debug("JMS: CONVERT["+presentationName+", "+completedSlides+", "+totalSlides+"]");
|
||||
presentationApplication.sendUpdateMessage(message);
|
||||
}
|
||||
else{
|
||||
|
@ -54,7 +54,7 @@ public class PresentationApplication {
|
||||
roomsManager.addRoomListener(room, listener);
|
||||
return true;
|
||||
}
|
||||
log.warn("Adding listener to a non-existant room ${room}");
|
||||
log.warn("Adding listener to a non-existant room {}",room);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -65,14 +65,14 @@ public class PresentationApplication {
|
||||
roomsManager.sendUpdateMessage(message);
|
||||
return;
|
||||
}
|
||||
log.warn("Sending update message to a non-existant room ${room}");
|
||||
log.warn("Sending update message to a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public ArrayList getCurrentPresenter(String room){
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getCurrentPresenter(room);
|
||||
}
|
||||
log.warn("Getting presenter on a non-existant room ${room}");
|
||||
log.warn("Getting presenter on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getPresentations(room);
|
||||
}
|
||||
log.warn("Getting presentations on a non-existant room ${room}");
|
||||
log.warn("Getting presentations on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
roomsManager.removePresentation(room, name);
|
||||
}
|
||||
log.warn("Removing presentation from a non-existant room ${room}");
|
||||
log.warn("Removing presentation from a non-existant room {}",room);
|
||||
|
||||
}
|
||||
|
||||
@ -96,7 +96,7 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getCurrentSlide(room);
|
||||
}
|
||||
log.warn("Getting slide on a non-existant room ${room}");
|
||||
log.warn("Getting slide on a non-existant room {}",room);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getCurrentPresentation(room);
|
||||
}
|
||||
log.warn("Getting current presentation on a non-existant room ${room}");
|
||||
log.warn("Getting current presentation on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -112,7 +112,7 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getPresenterSettings(room);
|
||||
}
|
||||
log.warn("Getting settings information on a non-existant room ${room}");
|
||||
log.warn("Getting settings information on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -120,17 +120,17 @@ public class PresentationApplication {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
return roomsManager.getSharingPresentation(room);
|
||||
}
|
||||
log.warn("Getting share information on a non-existant room ${room}");
|
||||
log.warn("Getting share information on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
public void resizeAndMoveSlide(String room, Long xOffset,Long yOffset,Long widthRatio,Long heightRatio) {
|
||||
if (roomsManager.hasRoom(room)){
|
||||
log.debug("Request to resize and move slide[$xOffset,$yOffset,$widthRatio,$heightRatio]");
|
||||
log.debug("Request to resize and move slide["+xOffset+","+yOffset+","+widthRatio+","+heightRatio+"]");
|
||||
roomsManager.resizeAndMoveSlide(room, xOffset, yOffset, widthRatio, heightRatio);
|
||||
return;
|
||||
}
|
||||
log.warn("resizeAndMoveSlide on a non-existant room ${room}");
|
||||
log.warn("resizeAndMoveSlide on a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public void assignPresenter(String room, ArrayList presenter){
|
||||
@ -138,25 +138,25 @@ public class PresentationApplication {
|
||||
roomsManager.assignPresenter(room, presenter);
|
||||
return;
|
||||
}
|
||||
log.warn("Assigning presenter on a non-existant room ${room}");
|
||||
log.warn("Assigning presenter on a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public void gotoSlide(String room, int slide){
|
||||
if (roomsManager.hasRoom(room)){
|
||||
log.debug("Request to go to slide $slide for room $room");
|
||||
log.debug("Request to go to slide {} for room {}",slide,room);
|
||||
roomsManager.gotoSlide(room, slide);
|
||||
return;
|
||||
}
|
||||
log.warn("Changing slide on a non-existant room ${room}");
|
||||
log.warn("Changing slide on a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public void sharePresentation(String room, String presentationName, Boolean share){
|
||||
if (roomsManager.hasRoom(room)){
|
||||
log.debug("Request to share presentation $presentationName $share for room $room");
|
||||
log.debug("Request to share presentation "+presentationName+" "+share+" for room "+room);
|
||||
roomsManager.sharePresentation(room, presentationName, share);
|
||||
return;
|
||||
}
|
||||
log.warn("Sharing presentation on a non-existant room ${room}");
|
||||
log.warn("Sharing presentation on a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public void setRoomsManager(PresentationRoomsManager r) {
|
||||
|
@ -47,6 +47,16 @@ public class PresentationEventRecorder implements IEventRecorder, IPresentationR
|
||||
|
||||
String APP_NAME = "PRESENTATION";
|
||||
|
||||
private final String RECORD_EVENT_SHARE_PRESENTATION="share_presentation";
|
||||
private final String RECORD_EVENT_ASSIGN_PRESENTER="assign_presenter";
|
||||
private final String RECORD_EVENT_REMOVE_PRESENTATION="remove_presentation";
|
||||
private final String RECORD_EVENT_RESIZE_MOVE_SLIDE="resize_move_slide";
|
||||
private final String RECORD_EVENT_UPDATE_SLIDE="update_slide";
|
||||
private final String RECORD_EVENT_CONVERSION_STATUS="conversion_status";
|
||||
private final String RECORD_EVENT_PAGE_COUNT_EXCEEDED="page_count_exceeded";
|
||||
private final String RECORD_EVENT_GENERATED_SLIDE="generated_slide";
|
||||
private final String RECORD_EVENT_CONVERSION_COMPLETE="conversion_complete";
|
||||
|
||||
public void acceptRecorder(IRecorder recorder){
|
||||
log.debug("Accepting IRecorder");
|
||||
this.recorder = recorder;
|
||||
@ -94,30 +104,30 @@ public class PresentationEventRecorder implements IEventRecorder, IPresentationR
|
||||
messageKey.equalsIgnoreCase(GENERATING_THUMBNAIL_KEY)||
|
||||
messageKey.equalsIgnoreCase(GENERATED_THUMBNAIL_KEY)||
|
||||
messageKey.equalsIgnoreCase(PAGE_COUNT_FAILED_KEY)){
|
||||
log.debug("${messageKey}[$presentationName]");
|
||||
log.debug("{}[{}]",messageKey,presentationName);
|
||||
// no extra data to send
|
||||
so.sendMessage("conversionUpdateMessageCallback", list);
|
||||
//recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_CONVERSION_STATUS));
|
||||
}
|
||||
else if(messageKey.equalsIgnoreCase(PAGE_COUNT_EXCEEDED_KEY)){
|
||||
log.debug("${messageKey}[$presentationName]");
|
||||
log.debug("{}[{}]",messageKey,presentationName);
|
||||
list.add(message.get("numberOfPages"));
|
||||
list.add(message.get("maxNumberPages"));
|
||||
so.sendMessage("pageCountExceededUpdateMessageCallback", list);
|
||||
//recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_PAGE_COUNT_EXCEEDED));
|
||||
}
|
||||
else if(messageKey.equalsIgnoreCase(GENERATED_SLIDE_KEY)){
|
||||
log.debug("${messageKey}[$presentationName]");
|
||||
log.debug("{}[{}]",messageKey,presentationName);
|
||||
list.add(message.get("numberOfPages"));
|
||||
list.add(message.get("pagesCompleted"));
|
||||
so.sendMessage("generatedSlideUpdateMessageCallback", list);
|
||||
//recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_GENERATED_SLIDE));
|
||||
}
|
||||
else if(messageKey.equalsIgnoreCase(CONVERSION_COMPLETED_KEY)){
|
||||
log.debug("${messageKey}[$presentationName]");
|
||||
log.debug("{}[{}]",messageKey,presentationName);
|
||||
list.add(message.get("slidesInfo"));
|
||||
so.sendMessage("conversionCompletedUpdateMessageCallback", list);
|
||||
//recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_CONVERSION_COMPLETE));
|
||||
}
|
||||
else{
|
||||
log.error("Cannot handle recieved message.");
|
||||
@ -127,57 +137,114 @@ public class PresentationEventRecorder implements IEventRecorder, IPresentationR
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void removePresentation(String name){
|
||||
log.debug("calling removePresentationCallback $name");
|
||||
log.debug("calling removePresentationCallback {}",name);
|
||||
ArrayList list=new ArrayList();
|
||||
list.add(name);
|
||||
so.sendMessage("removePresentationCallback", list);
|
||||
recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_REMOVE_PRESENTATION));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void gotoSlide(int slide){
|
||||
log.debug("calling gotoSlideCallback $slide");
|
||||
log.debug("calling gotoSlideCallback {}",slide);
|
||||
ArrayList list=new ArrayList();
|
||||
list.add(slide);
|
||||
so.sendMessage("gotoSlideCallback", list);
|
||||
recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_UPDATE_SLIDE));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void sharePresentation(String presentationName, Boolean share){
|
||||
log.debug("calling sharePresentationCallback $presentationName $share");
|
||||
log.debug("calling sharePresentationCallback {} {}",presentationName,share);
|
||||
ArrayList list=new ArrayList();
|
||||
list.add(presentationName);
|
||||
list.add(share);
|
||||
so.sendMessage("sharePresentationCallback", list);
|
||||
recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_SHARE_PRESENTATION));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void assignPresenter(ArrayList presenter) {
|
||||
log.debug("calling assignPresenterCallback $userid, $name $assignedBy");
|
||||
log.debug("calling assignPresenterCallback "+presenter.get(0)+", "+presenter.get(1)+" "+presenter.get(2));
|
||||
so.sendMessage("assignPresenterCallback", presenter);
|
||||
recordEvent(presenter.toString());
|
||||
recordEvent(parsePresentationToJSON(presenter, this.RECORD_EVENT_ASSIGN_PRESENTER));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void resizeAndMoveSlide(Long xOffset, Long yOffset, Long widthRatio,
|
||||
Long heightRatio) {
|
||||
log.debug("calling moveCallback[$xOffset,$yOffset,$widthRatio,$heightRatio]");
|
||||
log.debug("calling moveCallback["+xOffset+","+yOffset+","+widthRatio+","+heightRatio+"]");
|
||||
ArrayList list=new ArrayList();
|
||||
list.add(xOffset);
|
||||
list.add(yOffset);
|
||||
list.add(widthRatio);
|
||||
list.add(heightRatio);
|
||||
so.sendMessage("moveCallback", list);
|
||||
recordEvent(list.toString());
|
||||
recordEvent(parsePresentationToJSON(list, this.RECORD_EVENT_RESIZE_MOVE_SLIDE));
|
||||
}
|
||||
|
||||
private String parsePresentationToJSON(ArrayList list, String type){
|
||||
String json="{ ";
|
||||
json+="\"module\":\"presentation\", ";
|
||||
|
||||
if(type.equalsIgnoreCase(this.RECORD_EVENT_ASSIGN_PRESENTER)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_ASSIGN_PRESENTER+"\", ";
|
||||
json+="\"userid\":\""+list.get(0)+"\", ";
|
||||
json+="\"name\":\""+list.get(1)+"\", ";
|
||||
json+="\"assignedBy\":\""+list.get(2)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_REMOVE_PRESENTATION)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_REMOVE_PRESENTATION+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(0)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_RESIZE_MOVE_SLIDE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_RESIZE_MOVE_SLIDE+"\", ";
|
||||
json+="\"xOffset\":\""+list.get(0)+"\", ";
|
||||
json+="\"yOffset\":\""+list.get(1)+"\", ";
|
||||
json+="\"widthRatio\":\""+list.get(2)+"\", ";
|
||||
json+="\"heightRatio\":\""+list.get(3)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_SHARE_PRESENTATION)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_SHARE_PRESENTATION+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(0)+"\", ";
|
||||
json+="\"share\":\""+list.get(1)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_UPDATE_SLIDE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_UPDATE_SLIDE+"\", ";
|
||||
json+="\"slide\":\""+list.get(0)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_CONVERSION_STATUS)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_CONVERSION_STATUS+"\", ";
|
||||
json+="\"code\":\""+list.get(2)+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(3)+"\", ";
|
||||
json+="\"messageKey\":\""+list.get(4)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_PAGE_COUNT_EXCEEDED)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_PAGE_COUNT_EXCEEDED+"\", ";
|
||||
json+="\"code\":\""+list.get(2)+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(3)+"\", ";
|
||||
json+="\"messageKey\":\""+list.get(4)+"\", ";
|
||||
json+="\"numberOfPages\":\""+list.get(5)+"\", ";
|
||||
json+="\"maxNumberPages\":\""+list.get(6)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_GENERATED_SLIDE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_GENERATED_SLIDE+"\", ";
|
||||
json+="\"code\":\""+list.get(2)+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(3)+"\", ";
|
||||
json+="\"messageKey\":\""+list.get(4)+"\", ";
|
||||
json+="\"numberOfPages\":\""+list.get(5)+"\", ";
|
||||
json+="\"pagesCompleted\":\""+list.get(6)+"\" ";
|
||||
}
|
||||
else if(type.equalsIgnoreCase(this.RECORD_EVENT_CONVERSION_COMPLETE)){
|
||||
json+="\"event\":\""+this.RECORD_EVENT_CONVERSION_COMPLETE+"\", ";
|
||||
json+="\"code\":\""+list.get(2)+"\", ";
|
||||
json+="\"presentationName\":\""+list.get(3)+"\", ";
|
||||
json+="\"messageKey\":\""+list.get(4)+"\", ";
|
||||
json+="\"slidesInfo\":\""+list.get(5)+"\" ";
|
||||
}
|
||||
|
||||
json+="}";
|
||||
return json;
|
||||
|
@ -44,50 +44,50 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@Override
|
||||
public boolean appConnect(IConnection conn, Object[] params) {
|
||||
log.debug("${APP}:appConnect");
|
||||
log.debug("{}:appConnect",APP);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appDisconnect(IConnection conn) {
|
||||
log.debug( "${APP}:appDisconnect");
|
||||
log.debug( "{}:appDisconnect",APP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appJoin(IClient client, IScope scope) {
|
||||
log.debug( "${APP}:appJoin ${scope.name}");
|
||||
log.debug( "{}:appJoin {}",APP,scope.getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appLeave(IClient client, IScope scope) {
|
||||
log.debug("${APP}:appLeave ${scope.name}");
|
||||
log.debug("{}:appLeave {}",APP,scope.getName());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean appStart(IScope scope) {
|
||||
log.debug("${APP}:appStart ${scope.name}");
|
||||
log.debug("{}:appStart {}",APP,scope.getName());
|
||||
conversionUpdatesMessageListener.start();
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void appStop(IScope scope) {
|
||||
log.debug("${APP}:appStop ${scope.name}");
|
||||
log.debug("{}:appStop {}",APP,scope.getName());
|
||||
conversionUpdatesMessageListener.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean roomConnect(IConnection connection, Object[] params) {
|
||||
log.debug("${APP}:roomConnect");
|
||||
log.debug("{}:roomConnect",APP);
|
||||
|
||||
log.debug("In live mode");
|
||||
ISharedObject so = getSharedObject(connection.getScope(), PRESENTATION_SO);
|
||||
|
||||
log.debug("Setting up recorder");
|
||||
PresentationEventRecorder recorder = new PresentationEventRecorder(so, getBbbSession().getRecord());
|
||||
log.debug("adding event recorder to ${connection.scope.name}");
|
||||
log.debug("adding event recorder to {}",connection.getScope().getName());
|
||||
recorderApplication.addEventRecorder(connection.getScope().getName(), recorder);
|
||||
|
||||
log.debug("Adding room listener");
|
||||
@ -98,37 +98,37 @@ public class PresentationHandler extends ApplicationAdapter implements IApplicat
|
||||
|
||||
@Override
|
||||
public void roomDisconnect(IConnection connection) {
|
||||
log.debug("${APP}:roomDisconnect");
|
||||
log.debug("{}:roomDisconnect",APP);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean roomJoin(IClient client, IScope scope) {
|
||||
log.debug("${APP}:roomJoin ${scope.name} - ${scope.parent.name}");
|
||||
log.debug(APP+":roomJoin "+scope.getName()+" - "+scope.getParent().getName());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomLeave(IClient client, IScope scope) {
|
||||
log.debug("${APP}:roomLeave ${scope.name}");
|
||||
log.debug("{}:roomLeave {}",APP,scope.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean roomStart(IScope scope) {
|
||||
log.debug("${APP} - roomStart ${scope.name}");
|
||||
log.debug("{} - roomStart {}",APP,scope.getName());
|
||||
presentationApplication.createRoom(scope.getName());
|
||||
if (!hasSharedObject(scope, PRESENTATION_SO)) {
|
||||
if (createSharedObject(scope, PRESENTATION_SO, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
log.error("Failed to start room ${scope.name}");
|
||||
log.error("Failed to start room {}",scope.getName());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void roomStop(IScope scope) {
|
||||
log.debug("${APP}:roomStop ${scope.name}");
|
||||
log.debug("{}:roomStop {}",APP,scope.getName());
|
||||
presentationApplication.destroyRoom(scope.getName());
|
||||
if (!hasSharedObject(scope, PRESENTATION_SO)) {
|
||||
clearSharedObjects(scope, PRESENTATION_SO);
|
||||
|
@ -76,7 +76,7 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling sendUpdateMessage on listener ${listener.getName()}");
|
||||
log.debug("calling sendUpdateMessage on listener {}",listener.getName());
|
||||
listener.sendUpdateMessage(message);
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ public class PresentationRoom {
|
||||
String messageKey = (String) message.get("messageKey");
|
||||
|
||||
if (messageKey.equalsIgnoreCase("CONVERSION_COMPLETED")) {
|
||||
log.debug("${messageKey}[$presentationName]");
|
||||
log.debug("{}[{}]",messageKey,presentationName);
|
||||
presentationNames.add(presentationName);
|
||||
}
|
||||
}
|
||||
@ -103,7 +103,7 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling sendUpdateMessage on listener ${listener.getName()}");
|
||||
log.debug("calling sendUpdateMessage on listener {}",listener.getName());
|
||||
listener.resizeAndMoveSlide(xOffset, yOffset, widthRatio, heightRatio);
|
||||
}
|
||||
}
|
||||
@ -113,7 +113,7 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling sendUpdateMessage on listener ${listener.getName()}");
|
||||
log.debug("calling sendUpdateMessage on listener {}",listener.getName());
|
||||
listener.assignPresenter(presenter);
|
||||
}
|
||||
}
|
||||
@ -125,14 +125,14 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling sendUpdateMessage on listener ${listener.getName()}");
|
||||
log.debug("calling sendUpdateMessage on listener {}",listener.getName());
|
||||
listener.gotoSlide(curslide);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void sharePresentation(String presentationName, Boolean share){
|
||||
log.debug("Request share presentation $presentationName $share for room $name");
|
||||
log.debug("Request share presentation "+presentationName+" "+share+" for room "+name);
|
||||
sharing = share;
|
||||
if (share) {
|
||||
currentPresentation = presentationName;
|
||||
@ -143,17 +143,17 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling sharePresentation on listener ${listener.getName()}");
|
||||
log.debug("calling sharePresentation on listener {}",listener.getName());
|
||||
listener.sharePresentation(presentationName, share);
|
||||
}
|
||||
}
|
||||
|
||||
public void removePresentation(String presentationName){
|
||||
log.debug("Request remove presentation $presentationName");
|
||||
log.debug("Request remove presentation {}",presentationName);
|
||||
int index = presentationNames.indexOf(presentationName);
|
||||
|
||||
if (index < 0) {
|
||||
log.warn("Request remove presentation $presentationName. Presentation not found.");
|
||||
log.warn("Request remove presentation {}. Presentation not found.",presentationName);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class PresentationRoom {
|
||||
for (Iterator iter = listeners.values().iterator(); iter.hasNext();) {
|
||||
log.debug("calling on listener");
|
||||
IPresentationRoomListener listener = (IPresentationRoomListener) iter.next();
|
||||
log.debug("calling removePresentation on listener ${listener.getName()}");
|
||||
log.debug("calling removePresentation on listener {}",listener.getName());
|
||||
listener.removePresentation(presentationName);
|
||||
}
|
||||
|
||||
|
@ -44,17 +44,17 @@ public class PresentationRoomsManager {
|
||||
}
|
||||
|
||||
public void addRoom(PresentationRoom room) {
|
||||
log.debug("In PresentationRoomsManager adding room ${room.name}");
|
||||
log.debug("In PresentationRoomsManager adding room {}",room.getName());
|
||||
rooms.put(room.getName(), room);
|
||||
}
|
||||
|
||||
public void removeRoom(String name) {
|
||||
log.debug("In PresentationRoomsManager remove room ${name}");
|
||||
log.debug("In PresentationRoomsManager remove room {}",name);
|
||||
rooms.remove(name);
|
||||
}
|
||||
|
||||
public boolean hasRoom(String name) {
|
||||
log.debug("In PresentationRoomsManager has Room ${name}");
|
||||
log.debug("In PresentationRoomsManager has Room {}",name);
|
||||
return rooms.containsKey(name);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ public class PresentationRoomsManager {
|
||||
* Keeping getRoom private so that all access to ChatRoom goes through here.
|
||||
*/
|
||||
private PresentationRoom getRoom(String name) {
|
||||
log.debug("In PresentationRoomsManager get room ${name}");
|
||||
log.debug("In PresentationRoomsManager get room {}",name);
|
||||
return rooms.get(name);
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public class PresentationRoomsManager {
|
||||
r.addRoomListener(listener);
|
||||
return;
|
||||
}
|
||||
log.warn("Adding listener to a non-existing room ${roomName}");
|
||||
log.warn("Adding listener to a non-existing room {}",roomName);
|
||||
}
|
||||
//TODO: where is roomName???
|
||||
/*public void removeRoomListener(IPresentationRoomListener listener) {
|
||||
@ -92,7 +92,7 @@ public class PresentationRoomsManager {
|
||||
r.sendUpdateMessage(message);
|
||||
return;
|
||||
}
|
||||
log.warn("Sending update message to a non-existing room $room");
|
||||
log.warn("Sending update message to a non-existing room {}",room);
|
||||
}
|
||||
|
||||
public ArrayList getCurrentPresenter( String room){
|
||||
@ -100,7 +100,7 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
return r.getCurrentPresenter();
|
||||
}
|
||||
log.warn("Getting presenter from a non-existing room $room");
|
||||
log.warn("Getting presenter from a non-existing room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
return r.getSharing();
|
||||
}
|
||||
log.warn("Getting sharing from a non-existing room $room");
|
||||
log.warn("Getting sharing from a non-existing room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public class PresentationRoomsManager {
|
||||
r.assignPresenter(presenter);
|
||||
return;
|
||||
}
|
||||
log.warn("Assigning presenter to a non-existing room $room");
|
||||
log.warn("Assigning presenter to a non-existing room {}",room);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -133,38 +133,38 @@ public class PresentationRoomsManager {
|
||||
settings.put("heightRatio", r.getHeightRatio());
|
||||
return settings;
|
||||
}
|
||||
log.warn("Getting settings information on a non-existant room ${room}");
|
||||
log.warn("Getting settings information on a non-existant room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
public void resizeAndMoveSlide(String room, Long xOffset, Long yOffset, Long widthRatio, Long heightRatio) {
|
||||
PresentationRoom r = getRoom(room);
|
||||
if (r != null){
|
||||
log.debug("Request to resize and move slide[$xOffset,$yOffset,$widthRatio,$heightRatio]");
|
||||
log.debug("Request to resize and move slide["+xOffset+","+yOffset+","+widthRatio+","+heightRatio+"]");
|
||||
r.resizeAndMoveSlide(xOffset, yOffset, widthRatio, heightRatio);
|
||||
return;
|
||||
}
|
||||
log.warn("resizeAndMoveSlide on a non-existant room ${room}");
|
||||
log.warn("resizeAndMoveSlide on a non-existant room {}",room);
|
||||
}
|
||||
|
||||
public void gotoSlide(String room, int slide){
|
||||
PresentationRoom r = getRoom(room);
|
||||
if (r != null) {
|
||||
log.debug("Request to go to slide $slide for room $room");
|
||||
log.debug("Request to go to slide {} for room {}",slide,room);
|
||||
r.gotoSlide(slide);
|
||||
return;
|
||||
}
|
||||
log.warn("Changing slide on a non-existing room $room");
|
||||
log.warn("Changing slide on a non-existing room {}",room);
|
||||
}
|
||||
|
||||
public void sharePresentation(String room, String presentationName, Boolean share){
|
||||
PresentationRoom r = getRoom(room);
|
||||
if (r != null) {
|
||||
log.debug("Request share presentation $presentationName $share for room $room");
|
||||
log.debug("Request share presentation "+presentationName+" "+share+" for room "+room);
|
||||
r.sharePresentation(presentationName, share);
|
||||
return;
|
||||
}
|
||||
log.warn("Sharing presentation on a non-existing room $room");
|
||||
log.warn("Sharing presentation on a non-existing room {}",room);
|
||||
}
|
||||
|
||||
public int getCurrentSlide(String room){
|
||||
@ -172,7 +172,7 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
return r.getCurrentSlide();
|
||||
}
|
||||
log.warn("Getting slide on a non-existing room $room");
|
||||
log.warn("Getting slide on a non-existing room {}",room);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -181,7 +181,7 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
return r.getCurrentPresentation();
|
||||
}
|
||||
log.warn("Getting current presentation on a non-existing room $room");
|
||||
log.warn("Getting current presentation on a non-existing room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -190,7 +190,7 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
return r.getPresentationNames();
|
||||
}
|
||||
log.warn("Getting current presentation on a non-existing room $room");
|
||||
log.warn("Getting current presentation on a non-existing room {}",room);
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -199,6 +199,6 @@ public class PresentationRoomsManager {
|
||||
if (r != null) {
|
||||
r.removePresentation(name);
|
||||
}
|
||||
log.warn("Removing presentation from a non-existing room $room");
|
||||
log.warn("Removing presentation from a non-existing room {}",room);
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ public class PresentationService {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void assignPresenter(Long userid, String name, Long assignedBy) {
|
||||
log.debug("assignPresenter $userid $name $assignedBy");
|
||||
log.debug("assignPresenter "+userid+" "+name+" "+assignedBy);
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
ArrayList presenter = new ArrayList();
|
||||
presenter.add(userid);
|
||||
@ -48,7 +48,7 @@ public class PresentationService {
|
||||
if (curPresenter != null){
|
||||
long curUserid=(Long) curPresenter.get(0);
|
||||
if( curUserid!= userid){
|
||||
log.debug("Changing presenter from ${curPresenter[0]} to $userid");
|
||||
log.debug("Changing presenter from {} to {}",curPresenter.get(0),userid);
|
||||
participantsApplication.setParticipantStatus(scope.getName(), (Long)curPresenter.get(0), "presenter", false);
|
||||
}
|
||||
}
|
||||
@ -56,7 +56,7 @@ public class PresentationService {
|
||||
}
|
||||
|
||||
public void removePresentation(String name) {
|
||||
log.debug("removePresentation $name");
|
||||
log.debug("removePresentation {}",name);
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
presentationApplication.removePresentation(scope.getName(), name);
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class PresentationService {
|
||||
presenter.put("user", curPresenter.get(0));
|
||||
presenter.put("name", curPresenter.get(1));
|
||||
presenter.put("assignedBy",curPresenter.get(2));
|
||||
log.debug("Presenter: ${curPresenter[0]} ${curPresenter[1]} ${curPresenter[2]}");
|
||||
log.debug("Presenter: "+curPresenter.get(0)+" "+curPresenter.get(1)+" "+curPresenter.get(2));
|
||||
} else {
|
||||
presenter.put("hasPresenter", false);
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class PresentationService {
|
||||
presentation.put("widthRatio", presentersSettings.get("widthRatio"));
|
||||
presentation.put("heightRatio", presentersSettings.get("heightRatio"));
|
||||
}
|
||||
log.debug("Presentation: presentation= $currentPresentation slide= $curSlide");
|
||||
log.debug("Presentation: presentation={} slide={}",currentPresentation,curSlide);
|
||||
} else {
|
||||
presentation.put("sharing", false);
|
||||
}
|
||||
@ -109,19 +109,19 @@ public class PresentationService {
|
||||
}
|
||||
|
||||
public void gotoSlide(int slideNum) {
|
||||
log.debug("Request to go to slide $slideNum");
|
||||
log.debug("Request to go to slide {}",slideNum);
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
presentationApplication.gotoSlide(scope.getName(), slideNum);
|
||||
}
|
||||
|
||||
public void sharePresentation(String presentationName, Boolean share) {
|
||||
log.debug("Request to go to sharePresentation $presentationName $share");
|
||||
log.debug("Request to go to sharePresentation {} {}",presentationName,share);
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
presentationApplication.sharePresentation(scope.getName(), presentationName, share);
|
||||
}
|
||||
|
||||
public void resizeAndMoveSlide(Long xOffset,Long yOffset,Long widthRatio,Long heightRatio) {
|
||||
log.debug("Request to resize and move slide[$xOffset,$yOffset,$widthRatio,$heightRatio]");
|
||||
log.debug("Request to resize and move slide["+xOffset+","+yOffset+","+widthRatio+","+heightRatio);
|
||||
IScope scope = Red5.getConnectionLocal().getScope();
|
||||
presentationApplication.resizeAndMoveSlide(scope.getName(), xOffset, yOffset, widthRatio, heightRatio);
|
||||
}
|
||||
|
@ -1,7 +1,47 @@
|
||||
package org.bigbluebutton.conference.service.recorder;
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* The IEventRecorder interface define all the methods for set a recorder
|
||||
* to each module.
|
||||
*
|
||||
* */
|
||||
public interface IEventRecorder {
|
||||
/**
|
||||
* Sets a RecorderEventDispatcher to the modules.
|
||||
* @param recorder a recorder dispatcher
|
||||
* @see IRecorder
|
||||
*/
|
||||
public void acceptRecorder(IRecorder recorder);
|
||||
|
||||
/**
|
||||
* Receive a event message and send to a RecorderEventDispatcher.
|
||||
* @param message a JSON String message with the attributes of an event
|
||||
*/
|
||||
public void recordEvent(String message);
|
||||
|
||||
/**
|
||||
* Return the name.
|
||||
* @return a String with the name
|
||||
*/
|
||||
public String getName();
|
||||
}
|
||||
|
@ -1,7 +1,36 @@
|
||||
package org.bigbluebutton.conference.service.recorder;
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* The IRecorder interface define all the neccesary methods to implement for
|
||||
* dispatch events to a JMS queue
|
||||
*
|
||||
* */
|
||||
public interface IRecorder {
|
||||
|
||||
/**
|
||||
* Receive the messages from the bigbluebutton modules and send
|
||||
* them to a JMS queue. These messages are the events generated in a conference.
|
||||
* @param message a JSON String message with the attributes of an event
|
||||
*/
|
||||
public void recordEvent(String message);
|
||||
|
||||
}
|
||||
|
@ -20,29 +20,43 @@ package org.bigbluebutton.conference.service.recorder;
|
||||
*/
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
*
|
||||
* The RecorderApplication class is used for setting the record module
|
||||
* in BigBlueButton for send events messages to a JMS queue.
|
||||
* The class follows the same standard as the others modules of BigBlueButton Apps.
|
||||
*/
|
||||
public class RecorderApplication {
|
||||
|
||||
/** A log instance */
|
||||
private static Logger log = Red5LoggerFactory.getLogger(RecorderApplication.class, "bigbluebutton");
|
||||
|
||||
/** A JmsTemplate from the spring framework */
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
/** A Hashmap with all the BigBlueButton sessions */
|
||||
private final Map<String, RecorderSession> recordSessions;
|
||||
|
||||
|
||||
/**
|
||||
* Default constructor for RecorderApplication
|
||||
* It sets the session hashmap.
|
||||
* @see RecorderSession
|
||||
* */
|
||||
public RecorderApplication() {
|
||||
recordSessions = new ConcurrentHashMap<String, RecorderSession>();
|
||||
log.debug("Instantiated ArchiveApplication");
|
||||
}
|
||||
|
||||
/*
|
||||
* Should be used?
|
||||
*
|
||||
* */
|
||||
/**
|
||||
* Destroy a Record Session
|
||||
* @param sessionName a bigbluebutton session
|
||||
*/
|
||||
public void destroyRecordSession(String sessionName) {
|
||||
RecorderSession s = recordSessions.remove(sessionName);
|
||||
/*
|
||||
@ -51,18 +65,21 @@ public class RecorderApplication {
|
||||
if (s != null) {
|
||||
log.debug("Removed record session");
|
||||
} else {
|
||||
log.debug("Could not find record session $sessionName");
|
||||
log.debug("Could not find record session {}",sessionName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a record session if there wasn't one created already.
|
||||
* @param conference name of a BigBlueButton conference
|
||||
* @param room name of a room
|
||||
* @param sessionName name of a session
|
||||
*/
|
||||
public void createRecordSession(String conference, String room, String sessionName) {
|
||||
RecorderSession session;
|
||||
RecorderEventDispatcher recorder=null;
|
||||
boolean createdSession = false;
|
||||
log.debug("Trying to create a record session for $sessionName");
|
||||
log.debug("Trying to create a record session for {}",sessionName);
|
||||
synchronized (this) {
|
||||
log.debug("Checking if record session $sessionName is already present.");
|
||||
if (recordSessions == null) {
|
||||
@ -72,16 +89,16 @@ public class RecorderApplication {
|
||||
}
|
||||
|
||||
if (! recordSessions.containsKey(sessionName)) {
|
||||
log.debug("Creating jms recorder for $conference $room");
|
||||
log.debug("Creating jms recorder for "+conference+" "+room);
|
||||
recorder = new RecorderEventDispatcher(conference, room);
|
||||
log.debug("Creating record session for $sessionName");
|
||||
log.debug("Creating record session for {}",sessionName);
|
||||
session = new RecorderSession(conference, room);
|
||||
log.debug("Adding record session $sessionName to record sessions");
|
||||
log.debug("Adding record session {} to record sessions",sessionName);
|
||||
recordSessions.put(session.getName(), session);
|
||||
log.debug("Setting recorder to record session $sessionName");
|
||||
log.debug("Setting recorder to record session {}",sessionName);
|
||||
session.setRecorder(recorder);
|
||||
createdSession = true;
|
||||
log.debug("Created record session ${session.name}");
|
||||
log.debug("Created record session {}",session.getName());
|
||||
} else {
|
||||
log.debug("Not creating record session");
|
||||
}
|
||||
@ -91,16 +108,26 @@ public class RecorderApplication {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a recorder type. this can be a chat, presentation, participants event recorder
|
||||
* @param sessionName session name
|
||||
* @param recorder a event recorder
|
||||
* @see IEventRecorder
|
||||
*/
|
||||
public void addEventRecorder(String sessionName, IEventRecorder recorder) {
|
||||
if (recordSessions.containsKey(sessionName)) {
|
||||
log.debug("Adding event recorder to session $sessionName.");
|
||||
log.debug("Adding event recorder to session {}.",sessionName);
|
||||
RecorderSession session = recordSessions.get(sessionName);
|
||||
session.addEventRecorder(recorder);
|
||||
} else {
|
||||
log.debug("Not adding event recorder to session $sessionName.");
|
||||
log.debug("Not adding event recorder to session {}.",sessionName);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a jms template for the queue of events generated. This method is used in the bbb-apps.xml.
|
||||
* @param jmsTemplate the JMS Template
|
||||
*/
|
||||
public void setJmsTemplate(JmsTemplate jmsTemplate){
|
||||
log.debug("Setting JmsTemplate");
|
||||
this.jmsTemplate = jmsTemplate;
|
||||
|
@ -1,4 +1,23 @@
|
||||
package org.bigbluebutton.conference.service.recorder;
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
|
||||
import javax.jms.JMSException;
|
||||
import javax.jms.Message;
|
||||
@ -11,20 +30,42 @@ import org.slf4j.Logger;
|
||||
import org.springframework.jms.core.JmsTemplate;
|
||||
import org.springframework.jms.core.MessageCreator;
|
||||
|
||||
/**
|
||||
*
|
||||
* The RecorderEventDispatcher class creates a object message and implements
|
||||
* the sender method for sending events to the JMS queue
|
||||
*
|
||||
**/
|
||||
public class RecorderEventDispatcher implements IRecorder {
|
||||
|
||||
/** A log instance */
|
||||
private static Logger log = Red5LoggerFactory.getLogger( RecorderEventDispatcher.class, "bigbluebutton" );
|
||||
|
||||
/** TODO conference attribute is unused */
|
||||
private final String conference;
|
||||
|
||||
/** Conference Name */
|
||||
private final String room;
|
||||
|
||||
/** A JmsTemplate instance */
|
||||
private JmsTemplate jmsTemplate;
|
||||
|
||||
/**
|
||||
* RecorderEventDispatcher constructor.
|
||||
* @param conference the conference name
|
||||
* @param room the room name
|
||||
* @return RecorderEventDispatcher
|
||||
*/
|
||||
public RecorderEventDispatcher(String conference, String room) {
|
||||
this.conference = conference;
|
||||
this.room = room;
|
||||
log.debug("create an instance of RecorderEventDispatcher");
|
||||
}
|
||||
|
||||
/**
|
||||
* The method creates a object message for sending to the jms queue.
|
||||
* @param event receive a IEventMessage object from bbb-common-messages
|
||||
*/
|
||||
public void sendEvents(final IEventMessage event) {
|
||||
jmsTemplate.send(new MessageCreator() {
|
||||
public Message createMessage(Session sn) throws JMSException {
|
||||
@ -32,8 +73,15 @@ public class RecorderEventDispatcher implements IRecorder {
|
||||
return msg;
|
||||
}
|
||||
});
|
||||
log.debug("create and send object message");
|
||||
}
|
||||
|
||||
/**
|
||||
* The method implements recordEvent from IRecoder. It sets the EventMessage
|
||||
* from bbb-common-messages with the room name, timestamp and message-event.
|
||||
* @param message this is a event-message sent by the BigBlueButton modules.
|
||||
* @see IRecorder
|
||||
*/
|
||||
@Override
|
||||
public void recordEvent(String message) {
|
||||
EventMessage event=new EventMessage();
|
||||
@ -41,10 +89,16 @@ public class RecorderEventDispatcher implements IRecorder {
|
||||
event.setMessage(message);
|
||||
event.setTimeStamp(System.currentTimeMillis());
|
||||
sendEvents(event);
|
||||
log.debug("event-message: {}",message);
|
||||
}
|
||||
|
||||
/**
|
||||
* The method sets a Jms Template.
|
||||
* @param jmsTemplate a JmsTemplate.
|
||||
*/
|
||||
public void setJmsTemplate(JmsTemplate jmsTemplate){
|
||||
this.jmsTemplate=jmsTemplate;
|
||||
log.debug("set jms template");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,4 +1,23 @@
|
||||
package org.bigbluebutton.conference.service.recorder;
|
||||
/*
|
||||
* BigBlueButton - http://www.bigbluebutton.org
|
||||
*
|
||||
* Copyright (c) 2008-2009 by respective authors (see below). All rights reserved.
|
||||
*
|
||||
* BigBlueButton is free software; you can redistribute it and/or modify it under the
|
||||
* terms of the GNU Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 3 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* BigBlueButton is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License along
|
||||
* with BigBlueButton; if not, If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* $Id: $
|
||||
*/
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@ -6,37 +25,73 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.red5.logging.Red5LoggerFactory;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
* The RecorderSession class handles a BigBlueButton recorder session.
|
||||
*
|
||||
* */
|
||||
public class RecorderSession {
|
||||
|
||||
/** A log instance */
|
||||
private static Logger log = Red5LoggerFactory.getLogger( RecorderSession.class, "bigbluebutton" );
|
||||
|
||||
/** room name */
|
||||
private final String name;
|
||||
|
||||
/** TODO conference attribute is unused */
|
||||
private final String conference;
|
||||
|
||||
/** A IRecorder instance */
|
||||
private IRecorder recorder;
|
||||
|
||||
/** A hashmap with the recorders of all modules */
|
||||
private Map<String, IEventRecorder> recorders;
|
||||
|
||||
/**
|
||||
* Default constructor for RecorderSession
|
||||
* It sets a recorder session.
|
||||
* @param conference name of a conference
|
||||
* @param room name of a room
|
||||
* */
|
||||
public RecorderSession(String conference, String room) {
|
||||
name = room;
|
||||
this.conference = conference;
|
||||
recorders = new ConcurrentHashMap<String, IEventRecorder>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the conference room
|
||||
* @return room name
|
||||
* */
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* The method adds an instance of a RecorderEventDispatcher to each module through the acceptRecorder method.
|
||||
* @param r a IEventRecorder from each module to record.
|
||||
* @see IEventRecorder
|
||||
* @see IRecorder
|
||||
* @see RecorderEventDispatcher
|
||||
*/
|
||||
public void addEventRecorder(IEventRecorder r) {
|
||||
synchronized (this) {
|
||||
if (! recorders.containsKey(r.getName())) {
|
||||
r.acceptRecorder(recorder);
|
||||
recorders.put(r.getName(), r);
|
||||
log.debug("Added event recorder $r.name");
|
||||
log.debug("Added event recorder {}",r.getName());
|
||||
} else {
|
||||
log.debug("Did not add recorder as it's already there.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a recorder event dispatcher to the BigBlueButton Session.
|
||||
* @param recorder an interface of a IRecorder.
|
||||
* @see IRecorder
|
||||
* @see RecorderEventDispatcher
|
||||
*/
|
||||
public void setRecorder(IRecorder recorder) {
|
||||
this.recorder = recorder;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ ami.password=secret
|
||||
|
||||
# These settings enable bbb-apps to connect to the Freeswitch conference server
|
||||
# These should match with the freeswitch event_socket_client config
|
||||
esl.host=192.168.0.166
|
||||
esl.host=192.168.2.103
|
||||
esl.port=8021
|
||||
esl.password=ClueCon
|
||||
|
||||
|
@ -4,7 +4,7 @@ package org.bbb.playback.models
|
||||
{
|
||||
public static const PLAYBACK_CHAT:String="chat";
|
||||
public static const PLAYBACK_PRESENT:String="presentation";
|
||||
public static const PLAYBACK_JOIN:String="join";
|
||||
public static const PLAYBACK_JOIN:String="participants";
|
||||
public static const PLAY_FORWARD:String="forward";
|
||||
public static const PLAY_REVERSE:String="reverse";
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
public function updateChatMessages(event:PlaybackEvent):void{
|
||||
var xmlobj:XML= event.attributes as XML;
|
||||
var date:Date=new Date(xmlobj.attribute("time"));
|
||||
var date:Date=new Date(xmlobj.attribute("timestamp"));
|
||||
var message:String="("+date.toTimeString()+") "+xmlobj.attribute("user")+": "+xmlobj.text()+"\n";
|
||||
if(event.playtype==PlaybackConstants.PLAY_FORWARD)
|
||||
chat=chat+message;
|
||||
|
@ -1,5 +1,5 @@
|
||||
#utf-8
|
||||
#Mon Jul 12 21:24:27 UTC 2010
|
||||
#Sat Aug 14 13:50:31 UTC 2010
|
||||
app.version=0.1
|
||||
app.servlet.version=2.4
|
||||
app.grails.version=1.1.1
|
||||
|
@ -1,8 +1,8 @@
|
||||
dataSource {
|
||||
pooled = true
|
||||
driverClassName = "com.mysql.jdbc.Driver"
|
||||
username = "root"
|
||||
password = "root"
|
||||
username = "bbb"
|
||||
password = "secret"
|
||||
}
|
||||
hibernate {
|
||||
cache.use_second_level_cache=true
|
||||
@ -14,19 +14,19 @@ environments {
|
||||
development {
|
||||
dataSource {
|
||||
dbCreate = "update" // one of 'create', 'create-drop','update'
|
||||
url = "jdbc:mysql://localhost:3306/BigBlueButtonDB"
|
||||
url = "jdbc:mysql://localhost:3306/bigbluebutton_dev"
|
||||
}
|
||||
}
|
||||
test {
|
||||
dataSource {
|
||||
dbCreate = "update"
|
||||
url = "jdbc:mysql://localhost:3306/BigBlueButtonDB"
|
||||
url = "jdbc:mysql://localhost:3306/bigbluebutton_dev"
|
||||
}
|
||||
}
|
||||
production {
|
||||
dataSource {
|
||||
dbCreate = "update"
|
||||
url = "jdbc:mysql://localhost:3306/BigBlueButtonDB"
|
||||
url = "jdbc:mysql://localhost:3306/bigbluebutton_dev"
|
||||
}
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ class EventController {
|
||||
{
|
||||
def json_data=evt.message //as JSON
|
||||
JSONObject json_obj=JSON.parse(json_data)
|
||||
String event_str=json_obj.remove("event")
|
||||
String event_str=json_obj.remove("module")
|
||||
"${evt.tsevent}"{
|
||||
"${event_str}"(json_obj)
|
||||
}
|
||||
@ -63,7 +63,7 @@ class EventController {
|
||||
{
|
||||
def json_data=evt.message //as JSON
|
||||
JSONObject json_obj=JSON.parse(json_data)
|
||||
String event_str=json_obj.remove("event")
|
||||
String event_str=json_obj.remove("module")
|
||||
json_obj.put("timestamp",evt.tsevent)
|
||||
|
||||
ArrayList attribs=new ArrayList(json_obj.keySet())
|
||||
|
Loading…
Reference in New Issue
Block a user