Author: areshetnyak
Date: 2011-09-15 04:56:47 -0400 (Thu, 15 Sep 2011)
New Revision: 4914
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DataRestoreContext.java
Removed:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JdbcBackupable.java
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Backupable.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceSameConfigRestore.java
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
Log:
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Backupable.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Backupable.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/Backupable.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -18,6 +18,8 @@
*/
package org.exoplatform.services.jcr.impl.backup;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
+
import java.io.File;
/**
@@ -47,11 +49,11 @@
/**
* Get data restorer to support atomic restore.
*
- * @param storageDir
- * the directory where backup is stored
+ * @param context
+ * the context
* @throws RestoreException
* if any exception occurred
*/
- DataRestore getDataRestorer(File storageDir) throws BackupException;
+ DataRestore getDataRestorer(DataRestoreContext context) throws BackupException;
}
Deleted:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JdbcBackupable.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JdbcBackupable.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/JdbcBackupable.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2009 eXo Platform SAS.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-package org.exoplatform.services.jcr.impl.backup;
-
-import java.io.File;
-import java.sql.Connection;
-
-/**
- * @author <a href="mailto:anatoliy.bazko@gmail.com">Anatoliy
Bazko</a>
- * @version $Id: Backupable.java 34360 2009-07-22 23:58:59Z tolusha $
- */
-public interface JdbcBackupable extends Backupable
-{
-
- /**
- * Get data restorer to support atomic restore.
- *
- * @param storageDir
- * the directory where backup is stored
- * @param jdbcConn
- * the connection to database
- * @throws RestoreException
- * if any exception occurred
- */
- DataRestore getDataRestorer(File storageDir, Connection jdbcConn) throws
BackupException;
-
-}
Added:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DataRestoreContext.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DataRestoreContext.java
(rev 0)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DataRestoreContext.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2003-2011 eXo Platform SAS.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not,
see<http://www.gnu.org/licenses/>.
+ */
+package org.exoplatform.services.jcr.impl.backup.rdbms;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by The eXo Platform SAS.
+ *
+ * <br/>Date: 2011
+ *
+ * @author <a href="mailto:alex.reshetnyak@exoplatform.com.ua">Alex
Reshetnyak</a>
+ * @version $Id: DBRestoreContext.java 111 2011-11-11 11:11:11Z rainf0x $
+ */
+public class DataRestoreContext
+{
+
+ public static final String STORAGE_DIR = "storage-dir";
+
+ public static final String DB_CONNECTION = "db-connection";
+
+ public static final String DB_CLEANER = "db-cleaner";
+
+ /**
+ * Context objects.
+ */
+ private Map<String, Object> objects = new HashMap<String, Object>();
+
+ /**
+ * Constructor.
+ *
+ * @param names
+ * the array with names
+ * @param objects
+ * the array with objects
+ */
+ public DataRestoreContext(String[] names, Object[] objects)
+ {
+ for (int i = 0; i < names.length; i++)
+ {
+ this.objects.put(names[i], objects[i]);
+ }
+ }
+
+ /**
+ * Getting object from context.
+ *
+ * @param objectName
+ * String, name of object.
+ * @return Object, if object is not contains in context will be throws
RuntimeException.
+ *
+ */
+ public Object getObject(String objectName)
+ {
+ return objects.get(objectName);
+ }
+}
Property changes on:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/backup/rdbms/DataRestoreContext.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/lock/cacheable/AbstractCacheableLockManager.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -41,6 +41,7 @@
import org.exoplatform.services.jcr.impl.backup.DataRestore;
import org.exoplatform.services.jcr.impl.backup.DummyDataRestore;
import org.exoplatform.services.jcr.impl.backup.rdbms.DBBackup;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.SessionDataManager;
import org.exoplatform.services.jcr.impl.core.lock.LockRemover;
import org.exoplatform.services.jcr.impl.core.lock.LockRemoverHolder;
@@ -827,14 +828,15 @@
/**
* {@inheritDoc}
*/
- public DataRestore getDataRestorer(File storageDir) throws BackupException
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
{
List<LockData> locks = new ArrayList<LockData>();
ObjectInputStream in = null;
try
{
- File contentFile = new File(storageDir, "CacheLocks" +
DBBackup.CONTENT_FILE_SUFFIX);
+ File contentFile = new
File((File)context.getObject(DataRestoreContext.STORAGE_DIR),
+ "CacheLocks" + DBBackup.CONTENT_FILE_SUFFIX);
// it is possible that backup was created on configuration without Backupable
WorkspaceLockManager class
if (!PrivilegedFileHelper.exists(contentFile))
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/SearchManager.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -54,6 +54,7 @@
import org.exoplatform.services.jcr.impl.backup.ResumeException;
import org.exoplatform.services.jcr.impl.backup.SuspendException;
import org.exoplatform.services.jcr.impl.backup.Suspendable;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.backup.rdbms.DirectoryRestore;
import org.exoplatform.services.jcr.impl.core.LocationFactory;
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
@@ -1593,11 +1594,11 @@
/**
* {@inheritDoc}}
*/
- public DataRestore getDataRestorer(File storageDir) throws BackupException
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
{
try
{
- File backupDir = new File(storageDir, getStorageName());
+ File backupDir = new File((File)
context.getObject(DataRestoreContext.STORAGE_DIR), getStorageName());
if (!PrivilegedFileHelper.exists(backupDir))
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/infinispan/ISPNCacheWorkspaceStorageCache.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -45,6 +45,7 @@
import org.exoplatform.services.jcr.impl.backup.BackupException;
import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
@@ -1527,7 +1528,7 @@
/**
* {@inheritDoc}
*/
- public DataRestore getDataRestorer(File storageDir) throws BackupException
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
{
return new DataRestore()
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/jbosscache/JBossCacheWorkspaceStorageCache.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -46,6 +46,7 @@
import org.exoplatform.services.jcr.impl.backup.BackupException;
import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.itemfilters.QPathEntryFilter;
import org.exoplatform.services.jcr.impl.dataflow.TransientNodeData;
import org.exoplatform.services.jcr.impl.dataflow.TransientPropertyData;
@@ -59,8 +60,8 @@
import org.jboss.cache.CacheStatus;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.Configuration.CacheMode;
-import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.eviction.ExpirationAlgorithmConfig;
import org.jboss.cache.jmx.JmxRegistrationManager;
import org.jboss.cache.notifications.annotation.NodeModified;
@@ -2016,7 +2017,7 @@
/**
* {@inheritDoc}
*/
- public DataRestore getDataRestorer(File storageDir) throws BackupException
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
{
return new DataRestore()
{
Modified:
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java
===================================================================
---
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/jdbc/JDBCWorkspaceDataContainer.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -29,11 +29,12 @@
import org.exoplatform.services.jcr.dataflow.serialization.ObjectWriter;
import org.exoplatform.services.jcr.impl.Constants;
import org.exoplatform.services.jcr.impl.backup.BackupException;
+import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.ComplexDataRestore;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
-import org.exoplatform.services.jcr.impl.backup.JdbcBackupable;
import org.exoplatform.services.jcr.impl.backup.rdbms.DBBackup;
import org.exoplatform.services.jcr.impl.backup.rdbms.DBRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.backup.rdbms.DirectoryRestore;
import org.exoplatform.services.jcr.impl.backup.rdbms.RestoreTableRule;
import org.exoplatform.services.jcr.impl.backup.rdbms.SybaseDBRestore;
@@ -96,7 +97,7 @@
* @author <a href="mailto:peter.nedonosko@exoplatform.com.ua">Peter
Nedonosko</a>
* @version $Id:GenericWorkspaceDataContainer.java 13433 2007-03-15 16:07:23Z peterit $
*/
-public class JDBCWorkspaceDataContainer extends WorkspaceDataContainerBase implements
Startable, JdbcBackupable,
+public class JDBCWorkspaceDataContainer extends WorkspaceDataContainerBase implements
Startable, Backupable,
Reindexable
{
@@ -1157,7 +1158,7 @@
/**
* {@inheritDoc}
*/
- public DataRestore getDataRestorer(File storageDir, Connection jdbcConn) throws
BackupException
+ public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
{
List<DataRestore> restorers = new ArrayList<DataRestore>();
@@ -1165,8 +1166,33 @@
ObjectReader backupInfo = null;
try
{
+ File storageDir = (File) context.getObject(DataRestoreContext.STORAGE_DIR);
+ Connection jdbcConn = null;
+
+ if (context.getObject(DataRestoreContext.DB_CONNECTION) == null)
+ {
+ try
+ {
+ jdbcConn = connFactory.getJdbcConnection();
+ jdbcConn.setAutoCommit(false);
+ }
+ catch (SQLException e)
+ {
+ throw new BackupException(e);
+ }
+ catch (RepositoryException e)
+ {
+ throw new BackupException(e);
+ }
+
+ }
+ else
+ {
+ jdbcConn = (Connection) context.getObject(DataRestoreContext.DB_CONNECTION);
+ }
+
backupInfo =
- new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new
File(storageDir,
+ new ObjectReaderImpl(PrivilegedFileHelper.fileInputStream(new
File(storageDir,
"JDBCWorkspaceDataContainer.info")));
String srcContainerName = backupInfo.readString();
@@ -1368,28 +1394,6 @@
/**
* {@inheritDoc}
*/
- public DataRestore getDataRestorer(File storageDir) throws BackupException
- {
- try
- {
- Connection jdbcConn = connFactory.getJdbcConnection();
- jdbcConn.setAutoCommit(false);
-
- return getDataRestorer(storageDir, jdbcConn);
- }
- catch (SQLException e)
- {
- throw new BackupException(e);
- }
- catch (RepositoryException e)
- {
- throw new BackupException(e);
- }
- }
-
- /**
- * {@inheritDoc}
- */
public NodeDataIndexingIterator getNodeDataIndexingIterator(int pageSize) throws
RepositoryException
{
if (isReindexingSupport())
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingRepositorySameConfigRestore.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -30,7 +30,7 @@
import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
import org.exoplatform.services.jcr.impl.backup.JCRRestore;
-import org.exoplatform.services.jcr.impl.backup.JdbcBackupable;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
@@ -116,17 +116,25 @@
File fullBackupDir =
JCRRestore.getFullBackupFile(workspacesMapping.get(wEntry.getName()).getBackupConfig().getBackupDir());
+
+ DataRestoreContext context;
+ if (jdbcConn != null)
+ {
+ context = new DataRestoreContext(
+ new String[] {DataRestoreContext.STORAGE_DIR,
DataRestoreContext.DB_CONNECTION},
+ new Object[] {fullBackupDir, jdbcConn});
+ }
+ else
+ {
+ context = new DataRestoreContext(
+ new String[] {DataRestoreContext.STORAGE_DIR},
+ new Object[] {fullBackupDir});
+ }
+
for (Backupable component : backupable)
{
- if (component instanceof JdbcBackupable && jdbcConn != null)
- {
-
dataRestorer.add(((JdbcBackupable)component).getDataRestorer(fullBackupDir, jdbcConn));
- }
- else
- {
- dataRestorer.add(component.getDataRestorer(fullBackupDir));
- }
+ dataRestorer.add(component.getDataRestorer(context));
}
}
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceSameConfigRestore.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceSameConfigRestore.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/JobExistingWorkspaceSameConfigRestore.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -28,6 +28,7 @@
import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
import org.exoplatform.services.jcr.impl.backup.JCRRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import
org.exoplatform.services.jcr.impl.dataflow.persistent.WorkspacePersistentDataManager;
import org.exoplatform.services.jcr.impl.util.io.FileCleanerHolder;
import org.exoplatform.services.log.ExoLogger;
@@ -92,11 +93,15 @@
.getComponentInstancesOfType(Backupable.class);
File storageDir = backupChainLog.getBackupConfig().getBackupDir();
+ File fullBackupDir = JCRRestore.getFullBackupFile(storageDir);
+ DataRestoreContext context = new DataRestoreContext(
+ new String[] {DataRestoreContext.STORAGE_DIR},
+ new Object[] {fullBackupDir});
+
for (Backupable component : backupable)
{
- File fullBackupDir = JCRRestore.getFullBackupFile(storageDir);
- dataRestorer.add(component.getDataRestorer(fullBackupDir));
+ dataRestorer.add(component.getDataRestorer(context));
}
for (DataRestore restorer : dataRestorer)
Modified:
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java
===================================================================
---
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2011-09-14
14:35:27 UTC (rev 4913)
+++
jcr/trunk/exo.jcr.component.ext/src/main/java/org/exoplatform/services/jcr/ext/backup/impl/rdbms/RdbmsWorkspaceInitializer.java 2011-09-15
08:56:47 UTC (rev 4914)
@@ -29,6 +29,7 @@
import org.exoplatform.services.jcr.impl.backup.BackupException;
import org.exoplatform.services.jcr.impl.backup.Backupable;
import org.exoplatform.services.jcr.impl.backup.DataRestore;
+import org.exoplatform.services.jcr.impl.backup.rdbms.DataRestoreContext;
import org.exoplatform.services.jcr.impl.core.BackupWorkspaceInitializer;
import org.exoplatform.services.jcr.impl.core.LocationFactory;
import org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl;
@@ -168,10 +169,14 @@
}
}
+ DataRestoreContext context = new DataRestoreContext(
+ new String[] {DataRestoreContext.STORAGE_DIR},
+ new Object[] {new File(restorePath)});
+
// restore all components
for (Backupable component : backupableComponents)
{
- dataRestorers.add(component.getDataRestorer(new File(restorePath)));
+ dataRestorers.add(component.getDataRestorer(context));
}
for (DataRestore restorer : dataRestorers)