@Test public final void testPurgeTargetInstance() { TargetInstance aTargetInstance = tiDao.load(5003L); assertFalse(aTargetInstance.isPurged()); List<HarvestResult> results = aTargetInstance.getHarvestResults(); assertNotNull(results); assertTrue(results.size() == 1); assertFalse(results.get(0).getResources().isEmpty()); testInstance.purgeTargetInstance(aTargetInstance); assertTrue(aTargetInstance.isPurged()); results = aTargetInstance.getHarvestResults(); assertNotNull(results); assertTrue(results.size() == 1); assertTrue(results.get(0).getResources().isEmpty()); }
public void purgeTargetInstance(TargetInstance aTargetInstance) { aTargetInstance.setPurged(true); targetInstanceDao.save(aTargetInstance); targetInstanceDao.deleteHarvestResources(aTargetInstance.getOid()); }
TargetInstanceManagerImpl implements TargetInstanceManager { public void purgeTargetInstance(TargetInstance aTargetInstance) { aTargetInstance.setPurged(true); targetInstanceDao.save(aTargetInstance); targetInstanceDao.deleteHarvestResources(aTargetInstance.getOid()); } }
TargetInstanceManagerImpl implements TargetInstanceManager { public void purgeTargetInstance(TargetInstance aTargetInstance) { aTargetInstance.setPurged(true); targetInstanceDao.save(aTargetInstance); targetInstanceDao.deleteHarvestResources(aTargetInstance.getOid()); }  }
TargetInstanceManagerImpl implements TargetInstanceManager { public void purgeTargetInstance(TargetInstance aTargetInstance) { aTargetInstance.setPurged(true); targetInstanceDao.save(aTargetInstance); targetInstanceDao.deleteHarvestResources(aTargetInstance.getOid()); }  void setStoreSeedHistory(boolean storeSeedHistory); boolean getStoreSeedHistory(); Pagination search(final TargetInstanceCriteria aCriteria); Pagination search(final TargetInstanceCriteria aCriteria, final int aPage, final int aPageSize); TargetInstance getNextTargetInstanceToHarvest(); List<QueuedTargetInstanceDTO> getQueue(); List<QueuedTargetInstanceDTO> getQueueForTarget(Long targetOid); Long countQueueLengthForTarget(final Long targetOid); TargetInstance getTargetInstance(Long aOid); TargetInstance getTargetInstance(Long aOid, boolean aLoadFully); void delete(TargetInstance aTargetInstance); void save(TargetInstance aTargetInstance); void save(HarvestResult aHarvestResult); void saveOrUpdate(Indicator indicator); void saveOrUpdate(IndicatorReportLine indicatorReportLine); List<Annotation> getAnnotations(TargetInstance aTargetInstance); int countTargetInstances(User aUser, ArrayList<String> aStates); int countTargetInstancesByTarget(Long Oid); void setTargetInstanceDao(TargetInstanceDAO targetInstanceDao); void setAuditor(Auditor auditor); void setAnnotationDAO(AnnotationDAO annotationDAO); void setProfileDAO(ProfileDAO profileDAO); void setInTrayManager(InTrayManager inTrayManager); void saveAll(Collection<TargetInstance> aCollection); void deleteTargetInstances(Long aTargetOid, Long aScheduleOid); List<HarvestHistoryDTO> getHarvestHistory(Long targetOid); List<HarvestResult> getHarvestResults(Long targetInstanceOid); HarvestResourceDTO getHarvestResourceDTO(final long harvestResultOid, final String resource); void purgeTargetInstance(TargetInstance aTargetInstance); void setIndicatorDAO(IndicatorDAO indicatorDAO); IndicatorDAO getIndicatorDAO(); IndicatorCriteriaDAO getIndicatorCriteriaDAO(); List<IndicatorCriteria> getIndicatorCriterias(); List<IndicatorCriteria> getIndicatorCriteriasByAgencyOid(Long agencyOid); void setIndicatorCriteriaDAO(IndicatorCriteriaDAO indicatorCriteriaDAO); void setIndicatorReportLineDAO(IndicatorReportLineDAO indicatorReportLineDAO); void deleteIndicatorReportLines(Indicator indicator); }
TargetInstanceManagerImpl implements TargetInstanceManager { public void purgeTargetInstance(TargetInstance aTargetInstance) { aTargetInstance.setPurged(true); targetInstanceDao.save(aTargetInstance); targetInstanceDao.deleteHarvestResources(aTargetInstance.getOid()); }  void setStoreSeedHistory(boolean storeSeedHistory); boolean getStoreSeedHistory(); Pagination search(final TargetInstanceCriteria aCriteria); Pagination search(final TargetInstanceCriteria aCriteria, final int aPage, final int aPageSize); TargetInstance getNextTargetInstanceToHarvest(); List<QueuedTargetInstanceDTO> getQueue(); List<QueuedTargetInstanceDTO> getQueueForTarget(Long targetOid); Long countQueueLengthForTarget(final Long targetOid); TargetInstance getTargetInstance(Long aOid); TargetInstance getTargetInstance(Long aOid, boolean aLoadFully); void delete(TargetInstance aTargetInstance); void save(TargetInstance aTargetInstance); void save(HarvestResult aHarvestResult); void saveOrUpdate(Indicator indicator); void saveOrUpdate(IndicatorReportLine indicatorReportLine); List<Annotation> getAnnotations(TargetInstance aTargetInstance); int countTargetInstances(User aUser, ArrayList<String> aStates); int countTargetInstancesByTarget(Long Oid); void setTargetInstanceDao(TargetInstanceDAO targetInstanceDao); void setAuditor(Auditor auditor); void setAnnotationDAO(AnnotationDAO annotationDAO); void setProfileDAO(ProfileDAO profileDAO); void setInTrayManager(InTrayManager inTrayManager); void saveAll(Collection<TargetInstance> aCollection); void deleteTargetInstances(Long aTargetOid, Long aScheduleOid); List<HarvestHistoryDTO> getHarvestHistory(Long targetOid); List<HarvestResult> getHarvestResults(Long targetInstanceOid); HarvestResourceDTO getHarvestResourceDTO(final long harvestResultOid, final String resource); void purgeTargetInstance(TargetInstance aTargetInstance); void setIndicatorDAO(IndicatorDAO indicatorDAO); IndicatorDAO getIndicatorDAO(); IndicatorCriteriaDAO getIndicatorCriteriaDAO(); List<IndicatorCriteria> getIndicatorCriterias(); List<IndicatorCriteria> getIndicatorCriteriasByAgencyOid(Long agencyOid); void setIndicatorCriteriaDAO(IndicatorCriteriaDAO indicatorCriteriaDAO); void setIndicatorReportLineDAO(IndicatorReportLineDAO indicatorReportLineDAO); void deleteIndicatorReportLines(Indicator indicator);  }