Package org.exoplatform.services.jcr.impl.backup

Examples of org.exoplatform.services.jcr.impl.backup.DataRestore


   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here


   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(File storageDir) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

      wsQuotaManager.backup(tempDir);

      DataRestoreContext context =
         new DataRestoreContext(new String[]{DataRestoreContext.STORAGE_DIR}, new Object[]{tempDir});
      DataRestore restorer = wsQuotaManager.getDataRestorer(context);

      restorer.clean();

      assertEquals(dbQuotaManager.getRepositoryDataSize(), repDataSize - wsDataSize);

      try
      {
         wsQuotaManager.getWorkspaceQuota();
         fail("Quota should be unknown after clean");
      }
      catch (UnknownQuotaLimitException e)
      {
      }

      try
      {
         wsQuotaManager.getWorkspaceDataSize();
         fail("Data size should be unknown after clean");
      }
      catch (UnknownDataSizeException e)
      {
      }

      assertTrue(dataSizeShouldNotExists(wsQuotaManager, "/testRoot/test1"));
      assertTrue(dataSizeShouldNotExists(wsQuotaManager, "/testRoot/test2"));
      assertTrue(quotaShouldNotExists(wsQuotaManager, "/testRoot/test1"));
      assertTrue(quotaShouldNotExists(wsQuotaManager, "/testRoot/test2"));

      restorer.rollback();

      assertEquals(dbQuotaManager.getRepositoryDataSize(), repDataSize);
      assertEquals(wsDataSize, wsQuotaManager.getWorkspaceDataSize());
      assertEquals(node1DataSize, wsQuotaManager.getNodeDataSize("/testRoot/test1"));
      assertEquals(node2DataSize, wsQuotaManager.getNodeDataSize("/testRoot/test2"));
      assertEquals(node1Quota, wsQuotaManager.getNodeQuota("/testRoot/test1"));
      assertEquals(node2Quota, wsQuotaManager.getNodeQuota("/testRoot/test2"));

      restorer.clean();
      restorer.restore();

      assertEquals(dbQuotaManager.getRepositoryDataSize(), repDataSize);
      assertEquals(wsDataSize, wsQuotaManager.getWorkspaceDataSize());
      assertEquals(node1DataSize, wsQuotaManager.getNodeDataSize("/testRoot/test1"));
      assertEquals(node2DataSize, wsQuotaManager.getNodeDataSize("/testRoot/test2"));
      assertEquals(node1Quota, wsQuotaManager.getNodeQuota("/testRoot/test1"));
      assertEquals(node2Quota, wsQuotaManager.getNodeQuota("/testRoot/test2"));

      restorer.commit();
      restorer.close();

      wsQuotaManager.resume();
      assertFalse(wsQuotaManager.isSuspended());

      wsQuotaManager.removeGroupOfNodesQuota("/testRoot/*");
 
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

   /**
    * {@inheritDoc}
    */
   public DataRestore getDataRestorer(DataRestoreContext context) throws BackupException
   {
      return new DataRestore()
      {
         /**
          * {@inheritDoc}
          */
         public void clean() throws BackupException
View Full Code Here

TOP

Related Classes of org.exoplatform.services.jcr.impl.backup.DataRestore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.