TieredStorageAssetManagerJobProducer extends AbstractJobProducer { public Job moveById(final String mpId, final String targetStorage) { RequireUtil.notEmpty(mpId, "mpId"); RequireUtil.notEmpty(targetStorage, "targetStorage"); List<String> args = new LinkedList<String>(); args.add(targetStorage); args.add(mpId); try { return serviceRegistry.createJob(JOB_TYPE, Operation.MoveById.toString(), args, null, true, NONTERMINAL_JOB_LOAD); } catch (ServiceRegistryException e) { throw new AssetManagerException("Unable to create a job", e); } } 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; }
@Test public void testById() throws ServiceRegistryException { String[] mp = createAndAddMediaPackagesSimple(1, 2, 2, Opt.<String>none()); createIdExpectation(mp[0]); EasyMock.replay(sr); tsamjp.moveById(mp[0], REMOTE_STORE_1_ID); EasyMock.verify(sr); }