Author: gavrikvetal
Date: 2009-09-25 05:03:45 -0400 (Fri, 25 Sep 2009)
New Revision: 185
Modified:
jcr/trunk/component/ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
Log:
EXOJCR-160 HttpBackupAgent should return "Restore Info" bean after new restore
job is started
Modified:
jcr/trunk/component/ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
===================================================================
---
jcr/trunk/component/ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2009-09-25
08:57:39 UTC (rev 184)
+++
jcr/trunk/component/ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2009-09-25
09:03:45 UTC (rev 185)
@@ -18,6 +18,26 @@
*/
package org.exoplatform.services.jcr.ext.backup.server;
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.security.RolesAllowed;
+import javax.jcr.LoginException;
+import javax.jcr.NoSuchWorkspaceException;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.ws.rs.Consumes;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.Produces;
+import javax.ws.rs.core.CacheControl;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
import org.exoplatform.services.jcr.RepositoryService;
import org.exoplatform.services.jcr.config.RepositoryConfigurationException;
import org.exoplatform.services.jcr.config.WorkspaceEntry;
@@ -43,26 +63,6 @@
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.resource.ResourceContainer;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.annotation.security.RolesAllowed;
-import javax.jcr.LoginException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.CacheControl;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
/**
* Created by The eXo Platform SAS.
*
@@ -410,6 +410,7 @@
*/
@POST
@Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
@RolesAllowed("administrators")
@Path("/restore/{repo}/{id}")
public Response restore(WorkspaceEntry wEntry, @PathParam("repo") String
repository, @PathParam("id") String backupId)
@@ -436,8 +437,9 @@
BackupChainLog backupChainLog = new BackupChainLog(backupLog);
backupManager.restore(backupChainLog, repository, wEntry, true);
-
- return Response.ok().cacheControl(noCache).build();
+
+ ShortInfo shortInfo = new ShortInfo(ShortInfo.CURRENT, backupChainLog);
+ return Response.ok(shortInfo).cacheControl(noCache).build();
}
catch (WorkspaceRestoreExeption e)
{
Show replies by date