@Test public void testInternalByDate() throws ServiceRegistryException, InterruptedException { Date start = new Date(); Thread.sleep(1); Date before = new Date(); Thread.sleep(1); String[] mp = createAndAddMediaPackagesSimple(2, 2, 2, Opt.<String>none()); Thread.sleep(1); Date after = new Date(); createIdAndVersionExpectation(mp[0], 0, 2); createIdAndVersionExpectation(mp[1], 0, 2); EasyMock.replay(sr); Assert.assertEquals("No versions exist between the start and before test values", "0", tsamjp.internalMoveByDate(start, before, REMOTE_STORE_1_ID)); Assert.assertEquals("All four versions should move", "4", tsamjp.internalMoveByDate(before, after, REMOTE_STORE_1_ID)); Assert.assertEquals("No versions exist after the end date", "0", tsamjp.internalMoveByDate(after, new Date(), REMOTE_STORE_1_ID)); EasyMock.verify(sr); }
protected String internalMoveByDate(final Date start, final Date end, final String targetStorage) { RichAResult results = tsam.getSnapshotsByDate(start, end); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); }
TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveByDate(final Date start, final Date end, final String targetStorage) { RichAResult results = tsam.getSnapshotsByDate(start, end); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); } }
TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveByDate(final Date start, final Date end, final String targetStorage) { RichAResult results = tsam.getSnapshotsByDate(start, end); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); } TieredStorageAssetManagerJobProducer(); }
TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveByDate(final Date start, final Date end, final String targetStorage) { RichAResult results = tsam.getSnapshotsByDate(start, end); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); } TieredStorageAssetManagerJobProducer(); @Override void activate(ComponentContext cc); boolean datastoreExists(String storeId); Job moveByIdAndVersion(final Version version, final String mpId, final String targetStorage); Job moveById(final String mpId, final String targetStorage); Job moveByDate(final Date start, final Date end, final String targetStorage); Job moveByIdAndDate(final String mpId, final Date start, final Date end, final String targetStorage); }
TieredStorageAssetManagerJobProducer extends AbstractJobProducer { protected String internalMoveByDate(final Date start, final Date end, final String targetStorage) { RichAResult results = tsam.getSnapshotsByDate(start, end); List<Job> subjobs = spawnSubjobs(results, targetStorage); return Integer.toString(subjobs.size()); } TieredStorageAssetManagerJobProducer(); @Override void activate(ComponentContext cc); boolean datastoreExists(String storeId); Job moveByIdAndVersion(final Version version, final String mpId, final String targetStorage); Job moveById(final String mpId, final String targetStorage); Job moveByDate(final Date start, final Date end, final String targetStorage); Job moveByIdAndDate(final String mpId, final Date start, final Date end, final String targetStorage); static final String JOB_TYPE; static final Float JOB_LOAD; static final Float NONTERMINAL_JOB_LOAD; }