From 49855b4c80403ce9992a32106781b350f2bfac81 Mon Sep 17 00:00:00 2001 From: Pedro Beschorner Marin Date: Fri, 31 Mar 2017 12:18:33 +0000 Subject: [PATCH] Removed some callback API methods from bigbluebutton web that were missed on merge --- .../web/controllers/ApiController.groovy | 243 ------------------ .../org/bigbluebutton/api/MeetingService.java | 15 -- 2 files changed, 258 deletions(-) diff --git a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy index a05b8695f4..1fb797e337 100755 --- a/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy +++ b/bigbluebutton-web/grails-app/controllers/org/bigbluebutton/web/controllers/ApiController.groovy @@ -1177,245 +1177,6 @@ class ApiController { } } - /*********************************************** - * CALLBACK API - ***********************************************/ - def subscribeEvent = { - String API_CALL = "subscribeEvent" - log.debug CONTROLLER_NAME + "#${API_CALL}" - - if (StringUtils.isEmpty(params.checksum)) { - invalid("checksumError", "You did not pass the checksum security check") - return - } - - if (StringUtils.isEmpty(params.callbackURL)) { - invalid("missingParamCallbackURL", "You must specify a callbackURL for subscribing"); - return - } - - if(!StringUtils.isEmpty(params.meetingID)) { - params.meetingID = StringUtils.strip(params.meetingID); - if (StringUtils.isEmpty(params.meetingID)) { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - } else { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - - String internalMeetingId = paramsProcessorUtil.convertToInternalMeetingId(params.meetingID); - Meeting meeting = meetingService.getMeeting(internalMeetingId); - if (meeting == null) { - // BEGIN - backward compatibility - invalid("invalidMeetingIdentifier", "The meeting ID that you supplied did not match any existing meetings"); - return; - // END - backward compatibility - - errors.invalidMeetingIdError(); - respondWithErrors(errors) - return; - } - - if (! paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) { - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("FAILED") - messageKey("subscribeEventChecksumError") - message("subscribeEventChecksumError: request did not pass the checksum security check.") - } - } - } - } - } else { - String sid = meetingService.addSubscription(meeting.getInternalId(), meeting.getExternalId(), params.callbackURL); - - if(sid.isEmpty()){ - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("FAILED") - messageKey("subscribeEventError") - message("subscribeEventError: An error happen while storing your subscription. Check the logs.") - } - } - } - } - - }else{ - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("SUCCESS") - subscriptionID(sid) - } - } - } - } - } - } - } - - def unsubscribeEvent = { - String API_CALL = "unsubscribeEvent" - log.debug CONTROLLER_NAME + "#${API_CALL}" - - if (StringUtils.isEmpty(params.checksum)) { - invalid("checksumError", "You did not pass the checksum security check") - return - } - - if (StringUtils.isEmpty(params.subscriptionID)) { - invalid("missingParamSubscriptionID", "You must pass a subscriptionID for unsubscribing") - return - } - - if(!StringUtils.isEmpty(params.meetingID)) { - params.meetingID = StringUtils.strip(params.meetingID); - if (StringUtils.isEmpty(params.meetingID)) { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - } else { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - - String internalMeetingId = paramsProcessorUtil.convertToInternalMeetingId(params.meetingID); - Meeting meeting = meetingService.getMeeting(internalMeetingId); - if (meeting == null) { - // BEGIN - backward compatibility - invalid("invalidMeetingIdentifier", "The meeting ID that you supplied did not match any existing meetings"); - return; - // END - backward compatibility - - errors.invalidMeetingIdError(); - respondWithErrors(errors) - return; - } - - if (! paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) { - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("FAILED") - messageKey("unsubscribeEventChecksumError") - message("unsubscribeEventChecksumError: request did not pass the checksum security check.") - } - } - } - } - } else { - boolean status = meetingService.removeSubscription(meeting.getInternalId(), params.subscriptionID); - - if(!status){ - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("FAILED") - messageKey("unsubscribeEventError") - message("unsubscribeEventError: An error happen while unsubscribing. Check the logs.") - } - } - } - } - - }else{ - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType:"text/xml") { - response() { - returncode("SUCCESS") - unsubscribed(status) - } - } - } - } - } - } - } - - def listSubscriptions = { - String API_CALL = "listSubscriptions" - log.debug CONTROLLER_NAME + "#${API_CALL}" - - if (StringUtils.isEmpty(params.checksum)) { - invalid("checksumError", "You did not pass the checksum security check") - return - } - - if (!StringUtils.isEmpty(params.meetingID)) { - params.meetingID = StringUtils.strip(params.meetingID); - if (StringUtils.isEmpty(params.meetingID)) { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - } else { - invalid("missingParamMeetingID", "You must specify a meeting ID for the meeting."); - return - } - - String internalMeetingId = paramsProcessorUtil.convertToInternalMeetingId(params.meetingID); - Meeting meeting = meetingService.getMeeting(internalMeetingId); - if (meeting == null) { - // BEGIN - backward compatibility - invalid("invalidMeetingIdentifier", "The meeting ID that you supplied did not match any existing meetings"); - return; - // END - backward compatibility - } - - if (!paramsProcessorUtil.isChecksumSame(API_CALL, params.checksum, request.getQueryString())) { - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType: "text/xml") { - response() { - returncode("FAILED") - messageKey("listSubscriptionsChecksumError") - message("listSubscriptionsChecksumError: request did not pass the checksum security check.") - } - } - } - } - } else { - List> list = meetingService.listSubscriptions(meeting.getInternalId()); - - response.addHeader("Cache-Control", "no-cache") - withFormat { - xml { - render(contentType: "text/xml") { - response() { - returncode("SUCCESS") - subscriptions() { - list.each { item -> - subscription() { - subscriptionID() { mkp.yield(item.get("subscriptionID")) } - event() { mkp.yield(item.get("event")) } - callbackURL() { mkp.yield(item.get("callbackURL")) } - active() { mkp.yield(item.get("active")) } - } - } - } - } - } - } - } - } - } - def getDefaultConfigXML = { String API_CALL = "getDefaultConfigXML" @@ -1447,10 +1208,6 @@ class ApiController { render text: defConfigXML, contentType: 'text/xml' } - - /*********************************************** - * CONFIG API - ***********************************************/ def configXML = { String API_CALL = 'configXML' log.debug CONTROLLER_NAME + "#${API_CALL}" diff --git a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java index bf8b419f46..430b28faec 100755 --- a/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java +++ b/bigbluebutton-web/src/java/org/bigbluebutton/api/MeetingService.java @@ -356,21 +356,6 @@ public class MeetingService implements MessageListener { message.externUserID, message.authToken, message.avatarURL, message.guest); } - public String addSubscription(String meetingId, String event, - String callbackURL) { - String sid = messagingService.storeSubscription(meetingId, event, - callbackURL); - return sid; - } - - public boolean removeSubscription(String meetingId, String subscriptionId) { - return messagingService.removeSubscription(meetingId, subscriptionId); - } - - public List> listSubscriptions(String meetingId) { - return messagingService.listSubscriptions(meetingId); - } - public Meeting getMeeting(String meetingId) { if (meetingId == null) return null;