Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjmisinco2013-11-22 20:29:46 +0000
committerjmisinco2013-11-22 20:46:36 +0000
commit6c1e3e8ade724f4436fc979afbfed56ebcaebb60 (patch)
tree245c50728aac5f77f7d06bd8bee57c908bbf4798 /plugins/org.eclipse.osee.framework.manager.servlet
parent56937887f66cadd6cd7bac5b7ecdbbf6d8282dd2 (diff)
downloadorg.eclipse.osee-6c1e3e8ade724f4436fc979afbfed56ebcaebb60.tar.gz
org.eclipse.osee-6c1e3e8ade724f4436fc979afbfed56ebcaebb60.tar.xz
org.eclipse.osee-6c1e3e8ade724f4436fc979afbfed56ebcaebb60.zip
bug[ats_5PR0D]: Request the server to refresh branch cache
This is a temporary fix for the issue of server branch caches being out of date. This was put specifically on the Branch Manager widget's refresh button to limit its use. Change-Id: If91b94141856ef4546119728729f6fe0b654f642
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/BranchManagerServlet.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/BranchManagerServlet.java b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/BranchManagerServlet.java
index bd1347869b5..7e83a863365 100644
--- a/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/BranchManagerServlet.java
+++ b/plugins/org.eclipse.osee.framework.manager.servlet/src/org/eclipse/osee/framework/manager/servlet/BranchManagerServlet.java
@@ -13,9 +13,9 @@ package org.eclipse.osee.framework.manager.servlet;
import java.io.IOException;
import java.net.HttpURLConnection;
+import java.util.concurrent.Callable;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.osee.executor.admin.CancellableCallable;
import org.eclipse.osee.framework.core.enums.Function;
import org.eclipse.osee.framework.core.server.ISessionManager;
import org.eclipse.osee.framework.core.server.SecureOseeHttpServlet;
@@ -53,8 +53,10 @@ public class BranchManagerServlet extends SecureOseeHttpServlet {
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
try {
- CancellableCallable<?> callable = createCallable(req, resp);
- callable.call();
+ Callable<?> callable = createCallable(req, resp);
+ if (callable != null) {
+ callable.call();
+ }
} catch (Exception ex) {
getLogger().error(ex, "Branch servlet request error: [%s]", req.toString());
resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR);
@@ -69,7 +71,7 @@ public class BranchManagerServlet extends SecureOseeHttpServlet {
return ApplicationContextFactory.createContext(getSessionId(req));
}
- private AbstractBranchCallable<?, ?> createCallable(HttpServletRequest req, HttpServletResponse resp) throws Exception {
+ private Callable<?> createCallable(HttpServletRequest req, HttpServletResponse resp) throws Exception {
String rawFunction = req.getParameter("function");
Function function = Function.fromString(rawFunction);
@@ -98,6 +100,9 @@ public class BranchManagerServlet extends SecureOseeHttpServlet {
case UPDATE_BRANCH_STATE:
callable = new ChangeBranchStateCallable(applicationContext, req, resp, translationService, orcsApi);
break;
+ case RELOAD_BRANCH_CACHE:
+ orcsApi.getBranchCache().reloadCache();
+ break;
default:
throw new UnsupportedOperationException();
}

Back to the top