[exo-jcr-commits] exo-jcr SVN: r3706 - jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Dec 22 06:33:16 EST 2010
Author: areshetnyak
Date: 2010-12-22 06:33:16 -0500 (Wed, 22 Dec 2010)
New Revision: 3706
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
Log:
JCR-1502 : Remove commented code in HTTPBackupAgent.
Modified: jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java
===================================================================
--- jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-12-22 10:57:44 UTC (rev 3705)
+++ jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/server/HTTPBackupAgent.java 2010-12-22 11:33:16 UTC (rev 3706)
@@ -1808,129 +1808,6 @@
}
/**
- * Restore the repository.
- *
- * @param rEntry
- * RepositoryEntry, the configuration to restored repository
- * @param repository
- * String, the repository name
- * @param backupId
- * String, the identifier of backup
- * @param removeExisting
- * Boolean, if 'true' will be removed fully (db, value storage, index) existed repository.
- * @return Response return the response
- */
- /*
- @POST
- @Produces(MediaType.APPLICATION_JSON)
- @RolesAllowed("administrators")
- @Path("/restore-repository-from-backup-set/{backup-set-path:.*}/{remove-Existing}")
- public Response restoreRepositoryFromBackupSet(@PathParam("backup-set-path") String backupSetPath,
- @PathParam("remove-Existing") Boolean removeExisting)
- {
- String failMessage;
- Response.Status status;
- Throwable exception;
-
- String repository = null;
-
- try
- {
- File backupSetDir = (new File(backupSetPath));
-
- if (!backupSetDir.exists())
- {
- throw new WorkspaceRestoreException("Backup set directory is not exists :" + backupSetPath);
- }
-
- if (!backupSetDir.isDirectory())
- {
- throw new WorkspaceRestoreException("Backup set directory is not directory :" + backupSetPath);
- }
-
- File[] cfs = PrivilegedFileHelper.listFiles(backupSetDir, new RepositoryBackupLogsFilter());
-
- if (cfs.length == 0)
- {
- throw new BackupConfigurationException("Can not found repository backup log in directory : "
- + backupSetPath);
- }
-
- if (cfs.length > 1)
- {
- throw new BackupConfigurationException(
- "Backup set directory should contains only one repository backup log : " + backupSetPath);
- }
-
- RepositoryBackupChainLog backupChainLog = new RepositoryBackupChainLog(cfs[0]);
- repository = backupChainLog.getBackupConfig().getRepository();
-
- validateOneRepositoryRestoreInstants(repository);
-
- if (removeExisting)
- {
- if (!isRepositoryExist(repository))
- {
- throw new RepositoryRestoreExeption("Repository " + repository + " is not exists!");
- }
-
- backupManager.restoreExistingRepository(backupSetDir, true);
- }
- else
- {
- if (isRepositoryExist(repository))
- {
- throw new RepositoryRestoreExeption("Repository " + repository + " already exists!");
- }
-
- backupManager.restoreRepository(backupSetDir, true);
- }
-
- // Sleeping. Restore should be initialized by job thread
- Thread.sleep(100);
-
- // search necessary restore
- JobRepositoryRestore restore = backupManager.getLastRepositoryRestore(repository);
- ShortInfo info =
- new ShortInfo(ShortInfo.RESTORE, restore.getRepositoryBackupChainLog(), restore.getStartTime(),
- restore.getEndTime(), restore.getStateRestore(), restore.getRepositoryName());
-
- return Response.ok(info).cacheControl(noCache).build();
- }
- catch (RepositoryRestoreExeption e)
- {
- exception = e;
- status = Response.Status.FORBIDDEN;
- failMessage = e.getMessage();
- }
- catch (RepositoryException e)
- {
- exception = e;
- status = Response.Status.NOT_FOUND;
- failMessage = e.getMessage();
- }
- catch (RepositoryConfigurationException e)
- {
- exception = e;
- status = Response.Status.NOT_FOUND;
- failMessage = e.getMessage();
- }
- catch (Throwable e)
- {
- exception = e;
- status = Response.Status.INTERNAL_SERVER_ERROR;
- failMessage = e.getMessage();
- }
-
- log.error("Can not start restore the repository '" + "/" + repository + "' from backup set '" + backupSetPath
- + "'", exception);
-
- return Response.status(status).entity(
- "Can not start restore the repository '" + "/" + repository + "' from backup set '" + backupSetPath
- + "' : " + failMessage).type(MediaType.TEXT_PLAIN).cacheControl(noCache).build();
- }*/
-
- /**
* The backup stop by 'id'.
*
* @param backupId
More information about the exo-jcr-commits
mailing list