Examples of BackupScheduler


Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setIncrementalJobPeriod(2 * 60); // incrementalPeriod = 2 min
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, stopTime, 0, 0);

      // wait till backup will be started
      waitTime(startTime);

      BackupChain bch = backup.getCurrentBackups().iterator().next();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, null, 0, 0);

      // wait till backup will be started
      while (Calendar.getInstance().getTime().before(startTime))
         Thread.sleep(100);

      Thread.sleep(100); // to know the full is started
      BackupChain bch = backup.getCurrentBackups().iterator().next();

      // wait till full backup will be stopped
      while (bch.getFullBackupState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(50);
      }

      // play with incremental
      addContent(ws1TestRoot, 1, 20, 1);

      scheduler.unschedule(config);

      log.info("-----------------[ restore ]-------------------------");
      // restore
      restoreAndCheck("ws1back.incr5", "jdbcjcr6", bch.getLogFilePath(), backDir, 1, 20);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, null, 0, 10); // 10 sec incremental period

      // wait till backup will be started
      waitTime(startTime);

      Thread.sleep(100); // to know the full is started
      BackupChain bch = backup.getCurrentBackups().iterator().next();

      // wait till full backup will be stopped
      while (bch.getFullBackupState() != BackupJob.FINISHED)
      {
         Thread.yield();
         Thread.sleep(50);
      }

      // play with incremental, each node will be added after 500ms
      addContent(ws1TestRoot, 1, 20, 1100); // 20 * 1100 = 220000 ms = 22sec

      scheduler.unschedule(config);

      log.info("-----------------[ restore ]-------------------------");
      // restore
      restoreAndCheck("ws1back.incr6", "jdbcjcr7", bch.getLogFilePath(), backDir, 1, 20);
   }
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, stopTime, 0, 0);

      // wait till backup will be started
      waitTime(startTime);

      BackupChain bch = backup.getCurrentBackups().iterator().next();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setIncrementalJobPeriod(20); // incrementalPeriod = 20 sec*
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, stopTime, 0, 0); // incrementalPeriod = 20sec* (see
      // before)

      // wait till backup will be started
      waitTime(startTime);

View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_BACKUP_ONLY);;
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      BackupWaiter waiter = new BackupWaiter();
      scheduler.schedule(config, startTime, stopTime, 20, 0, waiter); // 20 sec chain period

      // wait till backup #1 will be started
      assertTrue("Full backup #1 start expired", waiter.await(0, BackupJob.STARTING, 20500)); // 20.5sec
      // to
      // start
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, stopTime, 25, 10);

      // wait till backup will be started
      waitTime(startTime);

      BackupChain bch = backup.getCurrentBackups().iterator().next();
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, null, 10, 0);

      // wait till backup will be started
      waitTime(startTime);

      BackupChain bch1 = backup.getCurrentBackups().iterator().next();
      // BackupChain bch1 = backup.findBackup(config.getRepository(), config.getWorkspace());

      addContent(ws1TestRoot, 1, 20, 10);
      // wait till next backup will be started
      Thread.sleep(11000);

      BackupChain bch2 = backup.getCurrentBackups().iterator().next();
      // BackupChain bch2 = backup.findBackup(config.getRepository(), config.getWorkspace());

      addContent(ws1TestRoot, 21, 40, 1);

      // Stop backup
      Thread.sleep(10000); // for last started chain
      scheduler.unschedule(config);

      log.info("-----------------[ restore #1 ]-------------------------");
      restoreAndCheck("ws1back.incr12", "jdbcjcr15", bch1.getLogFilePath(), backDir, 1, 20);

      log.info("-----------------[ restore #2 ]-------------------------");
View Full Code Here

Examples of org.exoplatform.services.jcr.ext.backup.impl.BackupScheduler

      config.setRepository(repository.getName());
      config.setWorkspace("ws1");
      config.setBackupType(BackupManager.FULL_AND_INCREMENTAL);
      config.setBackupDir(backDir);

      BackupScheduler scheduler = backup.getScheduler();

      scheduler.schedule(config, startTime, null, 10, 6);

      // wait till backup will be started
      waitTime(startTime);

      BackupChain bch1 = backup.getCurrentBackups().iterator().next();
      // BackupChain bch1 = backup.findBackup(config.getRepository(), config.getWorkspace());

      addContent(ws1TestRoot, 1, 20, 15);
      // wait till next backup will be started
      Thread.sleep(11000);

      BackupChain bch2 = backup.getCurrentBackups().iterator().next();
      // BackupChain bch2 = backup.findBackup(config.getRepository(), config.getWorkspace());

      addContent(ws1TestRoot, 21, 40, 15);

      // Stop backup
      Thread.sleep(10000); // for last started chain
      scheduler.unschedule(config);

      log.info("-----------------[ restore #1 ]-------------------------");
      restoreAndCheck("ws1back.incr14", "jdbcjcr17", bch1.getLogFilePath(), backDir, 1, 20);

      log.info("-----------------[ restore #2 ]-------------------------");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.