Removed some callback API methods from bigbluebutton web that were missed on merge

This commit is contained in:
Pedro Beschorner Marin 2017-03-31 12:18:33 +00:00
parent 050b9ae7fc
commit 49855b4c80
2 changed files with 0 additions and 258 deletions

View File

@ -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<Map<String, String>> 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 = { def getDefaultConfigXML = {
String API_CALL = "getDefaultConfigXML" String API_CALL = "getDefaultConfigXML"
@ -1447,10 +1208,6 @@ class ApiController {
render text: defConfigXML, contentType: 'text/xml' render text: defConfigXML, contentType: 'text/xml'
} }
/***********************************************
* CONFIG API
***********************************************/
def configXML = { def configXML = {
String API_CALL = 'configXML' String API_CALL = 'configXML'
log.debug CONTROLLER_NAME + "#${API_CALL}" log.debug CONTROLLER_NAME + "#${API_CALL}"

View File

@ -356,21 +356,6 @@ public class MeetingService implements MessageListener {
message.externUserID, message.authToken, message.avatarURL, message.guest); 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<Map<String, String>> listSubscriptions(String meetingId) {
return messagingService.listSubscriptions(meetingId);
}
public Meeting getMeeting(String meetingId) { public Meeting getMeeting(String meetingId) {
if (meetingId == null) if (meetingId == null)
return null; return null;