Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrbrooks2010-05-14 18:21:51 +0000
committerrbrooks2010-05-14 18:21:51 +0000
commita1b9219c8f56df9af78bf93cf018b0fd0f647b49 (patch)
tree7f4c26a27a5898a63f8b0d2bf4d77e8b7a87d549 /plugins/org.eclipse.osee.framework.manager.servlet
parentdfe83303d1a62077e92542cb1144d6dc91836a2b (diff)
downloadorg.eclipse.osee-a1b9219c8f56df9af78bf93cf018b0fd0f647b49.tar.gz
org.eclipse.osee-a1b9219c8f56df9af78bf93cf018b0fd0f647b49.tar.xz
org.eclipse.osee-a1b9219c8f56df9af78bf93cf018b0fd0f647b49.zip
Make unsubscribe servlet handle duplicate unsubscribe attempts
Diffstat (limited to 'plugins/org.eclipse.osee.framework.manager.servlet')
-rw-r--r--plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java18
1 files changed, 4 insertions, 14 deletions
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
index 3921c0f8835..75460b96064 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/UnsubscribeServlet.java
@@ -17,8 +17,6 @@ import java.util.logging.Level;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.core.operation.LogProgressMonitor;
import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.server.OseeHttpServlet;
@@ -46,15 +44,10 @@ public class UnsubscribeServlet extends OseeHttpServlet {
}
@Override
- protected void checkAccessControl(HttpServletRequest request) throws OseeCoreException {
- }
-
- @Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
String requestUri = request.getRequestURL().toString();
requestUri = requestUri.replace(request.getPathInfo(), "");
-
UnsubscribeRequest data = UnsubscribeRequest.createFromURI(request);
String page = createConfirmationPage(requestUri, data);
@@ -91,18 +84,15 @@ public class UnsubscribeServlet extends OseeHttpServlet {
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
UnsubscribeRequest data = UnsubscribeRequest.createFromXML(request);
- IOperation del = new UnsubscribeTransaction(dbProvider, cacheProvider, data);
+ UnsubscribeTransaction del = new UnsubscribeTransaction(dbProvider, cacheProvider, data);
Operations.executeWorkAndCheckStatus(del, new LogProgressMonitor(), -1);
-
- String message =
- String.format("Unsubscribed user [%s] from group [%s] - Success", data.getUserId(), data.getGroupId());
- response.setStatus(HttpServletResponse.SC_ACCEPTED);
+ response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/plain");
+ String message = del.getCompletionMessage();
response.setContentLength(message.length());
response.getWriter().append(message);
} catch (Exception ex) {
handleError(response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error unsubscribing", ex);
}
}
-
-}
+} \ No newline at end of file

Back to the top