Revision: 3282
Author: silva.josemanuel1
Date: Wed Feb 10 11:40:12 2010
Log: Added method to client for requesting the server do a revert.
http://code.google.com/p/power-architect/source/detail?r=3282

Modified:
 /trunk/src/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java

=======================================
--- /trunk/src/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java Wed Feb 10 11:19:11 2010 +++ /trunk/src/ca/sqlpower/architect/enterprise/ArchitectClientSideSession.java Wed Feb 10 11:40:12 2010
@@ -76,7 +76,7 @@
private static Logger logger = Logger.getLogger(ArchitectClientSideSession.class);
        private static CookieStore cookieStore = new BasicCookieStore();

-       public static final String MONDRIAN_SCHEMA_REL_PATH = null;
+       public static final String MONDRIAN_SCHEMA_REL_PATH = "/mondrian";

        private final ProjectLocation projectLocation;
        private final HttpClient outboundHttpClient;
@@ -288,6 +288,30 @@
                httpClient.getConnectionManager().shutdown();
        }
     }
+
+       /**
+ * This method reverts the server workspace specified by the given project location
+        * to the specified revision number.
+        *
+ * All sessions should automatically update to the reverted revision due to their Updater.
+        *
+        * @throws IOException
+        * @throws URISyntaxException
+        */
+ public static void revertServerWorkspace(ProjectLocation projectLocation, int revisionNo) throws IOException, URISyntaxException {
+           SPServerInfo serviceInfo = projectLocation.getServiceInfo();
+           HttpClient httpClient = createHttpClient(serviceInfo);
+
+        try {
+ executeServerRequest(httpClient, projectLocation.getServiceInfo(),
+                    "/project/" + projectLocation.getUUID() +
+                    "/revert?revisionNo=" + revisionNo,
+                    new BasicResponseHandler());
+        } finally {
+            httpClient.getConnectionManager().shutdown();
+        }
+
+       }

public static void deleteServerWorkspace(ProjectLocation projectLocation) throws URISyntaxException, ClientProtocolException, IOException {
        SPServerInfo serviceInfo = projectLocation.getServiceInfo();

Reply via email to