initial cleanup

This commit is contained in:
Marco Calderon 2011-03-07 20:18:33 +00:00
parent 15990d2f55
commit 81627bc616
2 changed files with 25 additions and 1 deletions

View File

@ -167,7 +167,6 @@ class ApiController {
return
}
String createTime = params.createTime
// if (StringUtils.isEmpty(createTime)) {
// errors.missingParamError("createTime");
// }
@ -182,6 +181,23 @@ class ApiController {
respondWithErrors(errors)
return;
}
// the createTime mismatch with meeting's createTime, complain
// In the future, the createTime param will be required
if(params.createTime!=null){
long createTime = 0;
try{
createTime=Long.parseLong(params.createTime);
}catch(Exception e){
log.warn("could not parse createTime param");
createTime = -1;
}
if(createTime != meeting.getCreateTime()){
errors.mismatchCreateTimeParam();
respondWithErrors(errors);
return;
}
}
// Is this user joining a meeting that has been ended. If so, complain.
if (meeting.isForciblyEnded()) {
@ -472,6 +488,8 @@ class ApiController {
mtgs.each { m ->
meeting() {
meetingID(m.getExternalId())
meetingName(m.getName())
createTime(m.getCreateTime())
attendeePW(m.getViewerPassword())
moderatorPW(m.getModeratorPassword())
hasBeenForciblyEnded(m.isForciblyEnded() ? "true" : "false")
@ -752,7 +770,9 @@ class ApiController {
render(contentType:"text/xml") {
response() {
returncode(RESP_CODE_SUCCESS)
meetingName(meeting.getName())
meetingID(meeting.getExternalId())
createTime(meeting.getCreateTime())
attendeePW(meeting.getViewerPassword())
moderatorPW(meeting.getModeratorPassword())
running(meeting.isRunning() ? "true" : "false")

View File

@ -29,6 +29,10 @@ public class ApiErrors {
errors.add(new String[] {"invalidPassword", "The password you submitted is not valid."});
}
public void mismatchCreateTimeParam() {
errors.add(new String[] {"mismatchCreateTime", "The createTime parameter submitted mismatches with the current meeting."});
}
public boolean hasErrors() {
return errors.size() > 0;
}