InvalidHTTPRequestException e = new InvalidHTTPRequestException(ErrorCodes.ACTION_PARAMETER_ABSENT, "ACTION_PARAMETER_ABSENT");
return formErrorResponse(logger, e);
}
String response = new ResponseTemplate().execute(logger, connectionId, request, new ResponseCallback() {
public Object execute() throws Exception {
DatabaseService databaseService = new DatabaseServiceImpl(connectionId);
String status = null;
RequestMethod method = null;
for (RequestMethod m : RequestMethod.values()) {
if ((m.toString()).equals(action)) {
method = m;
break;
}
}
switch (method) {
case PUT: {
status = databaseService.createDb(dbName);
break;
}
case DELETE: {
status = databaseService.dropDb(dbName);
break;
}
default: {
status = "Action parameter value is wrong";
break;