@Test public void testNullJob() { try { jobDispatcher.doOneCrawl((Job) null, "test", "test", "test", SELECTIVE_HARVEST_CHANNEL, "unittesters", new ArrayList<MetadataEntry>()); fail("Should throw ArgumentNotValid on NULL job"); } catch (ArgumentNotValid e) { } }
public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure { ArgumentNotValid.checkNotNull(job, "job"); ArgumentNotValid.checkNotNull(metadata, "metadata"); if (origHarvestAudience != null && !origHarvestAudience.isEmpty()) { job.setHarvestAudience(origHarvestAudience); } if (usingWarcAsArchiveFormat()) { log.info("As we're using WARC as archiveFormat WarcInfoMetadata is now added to the template"); HeritrixTemplate ht = job.getOrderXMLdoc(); ht.insertWarcInfoMetadata(job, origHarvestName, origHarvestDesc, origHarvestSchedule, Settings.get(HarvesterSettings.PERFORMER)); job.setOrderXMLDoc(ht); } else { log.info("As we're using ARC as archiveFormat no WarcInfoMetadata was added to the template"); } DoOneCrawlMessage nMsg = new DoOneCrawlMessage(job, HarvesterChannels.getHarvestJobChannelId(channel), new HarvestDefinitionInfo(origHarvestName, origHarvestDesc, origHarvestSchedule), metadata); log.debug("Send crawl request: {}", nMsg); jmsConnection.send(nMsg); }
JobDispatcher { public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure { ArgumentNotValid.checkNotNull(job, "job"); ArgumentNotValid.checkNotNull(metadata, "metadata"); if (origHarvestAudience != null && !origHarvestAudience.isEmpty()) { job.setHarvestAudience(origHarvestAudience); } if (usingWarcAsArchiveFormat()) { log.info("As we're using WARC as archiveFormat WarcInfoMetadata is now added to the template"); HeritrixTemplate ht = job.getOrderXMLdoc(); ht.insertWarcInfoMetadata(job, origHarvestName, origHarvestDesc, origHarvestSchedule, Settings.get(HarvesterSettings.PERFORMER)); job.setOrderXMLDoc(ht); } else { log.info("As we're using ARC as archiveFormat no WarcInfoMetadata was added to the template"); } DoOneCrawlMessage nMsg = new DoOneCrawlMessage(job, HarvesterChannels.getHarvestJobChannelId(channel), new HarvestDefinitionInfo(origHarvestName, origHarvestDesc, origHarvestSchedule), metadata); log.debug("Send crawl request: {}", nMsg); jmsConnection.send(nMsg); } }
JobDispatcher { public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure { ArgumentNotValid.checkNotNull(job, "job"); ArgumentNotValid.checkNotNull(metadata, "metadata"); if (origHarvestAudience != null && !origHarvestAudience.isEmpty()) { job.setHarvestAudience(origHarvestAudience); } if (usingWarcAsArchiveFormat()) { log.info("As we're using WARC as archiveFormat WarcInfoMetadata is now added to the template"); HeritrixTemplate ht = job.getOrderXMLdoc(); ht.insertWarcInfoMetadata(job, origHarvestName, origHarvestDesc, origHarvestSchedule, Settings.get(HarvesterSettings.PERFORMER)); job.setOrderXMLDoc(ht); } else { log.info("As we're using ARC as archiveFormat no WarcInfoMetadata was added to the template"); } DoOneCrawlMessage nMsg = new DoOneCrawlMessage(job, HarvesterChannels.getHarvestJobChannelId(channel), new HarvestDefinitionInfo(origHarvestName, origHarvestDesc, origHarvestSchedule), metadata); log.debug("Send crawl request: {}", nMsg); jmsConnection.send(nMsg); } JobDispatcher(JMSConnection jmsConnection, HarvestDefinitionDAO hDao, JobDAO jobDao); }
JobDispatcher { public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure { ArgumentNotValid.checkNotNull(job, "job"); ArgumentNotValid.checkNotNull(metadata, "metadata"); if (origHarvestAudience != null && !origHarvestAudience.isEmpty()) { job.setHarvestAudience(origHarvestAudience); } if (usingWarcAsArchiveFormat()) { log.info("As we're using WARC as archiveFormat WarcInfoMetadata is now added to the template"); HeritrixTemplate ht = job.getOrderXMLdoc(); ht.insertWarcInfoMetadata(job, origHarvestName, origHarvestDesc, origHarvestSchedule, Settings.get(HarvesterSettings.PERFORMER)); job.setOrderXMLDoc(ht); } else { log.info("As we're using ARC as archiveFormat no WarcInfoMetadata was added to the template"); } DoOneCrawlMessage nMsg = new DoOneCrawlMessage(job, HarvesterChannels.getHarvestJobChannelId(channel), new HarvestDefinitionInfo(origHarvestName, origHarvestDesc, origHarvestSchedule), metadata); log.debug("Send crawl request: {}", nMsg); jmsConnection.send(nMsg); } JobDispatcher(JMSConnection jmsConnection, HarvestDefinitionDAO hDao, JobDAO jobDao); void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule,
            HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata); }
JobDispatcher { public void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule, HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata) throws ArgumentNotValid, IOFailure { ArgumentNotValid.checkNotNull(job, "job"); ArgumentNotValid.checkNotNull(metadata, "metadata"); if (origHarvestAudience != null && !origHarvestAudience.isEmpty()) { job.setHarvestAudience(origHarvestAudience); } if (usingWarcAsArchiveFormat()) { log.info("As we're using WARC as archiveFormat WarcInfoMetadata is now added to the template"); HeritrixTemplate ht = job.getOrderXMLdoc(); ht.insertWarcInfoMetadata(job, origHarvestName, origHarvestDesc, origHarvestSchedule, Settings.get(HarvesterSettings.PERFORMER)); job.setOrderXMLDoc(ht); } else { log.info("As we're using ARC as archiveFormat no WarcInfoMetadata was added to the template"); } DoOneCrawlMessage nMsg = new DoOneCrawlMessage(job, HarvesterChannels.getHarvestJobChannelId(channel), new HarvestDefinitionInfo(origHarvestName, origHarvestDesc, origHarvestSchedule), metadata); log.debug("Send crawl request: {}", nMsg); jmsConnection.send(nMsg); } JobDispatcher(JMSConnection jmsConnection, HarvestDefinitionDAO hDao, JobDAO jobDao); void doOneCrawl(Job job, String origHarvestName, String origHarvestDesc, String origHarvestSchedule,
            HarvestChannel channel, String origHarvestAudience, List<MetadataEntry> metadata);  }