@Test public void testEdmHasViewUrls_ManyElements_ForceUnconditionalDownload() throws ExecutionException { final List<String> urls = new ArrayList<>(); urls.addAll(Arrays.asList("http: "https: "http: final List<ProcessingJobTuple> jobs = ProcessingJobBuilder.edmHasViewUrlsJobs(urls, owner, JobPriority.NORMAL.getPriority(), trueOption); assertEquals(urls.size(), jobs.size()); validateTasks(jobs, DocumentReferenceTaskType.UNCONDITIONAL_DOWNLOAD, 1, 1, 2, ProcessingJobSubTaskType.values()); }
public static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority, final ProcessingJobCreationOptions options) throws ExecutionException { if (null == options) { throw new IllegalArgumentException("options must not be null"); } final List<ProcessingJobTuple> results = new ArrayList(); final List<SourceDocumentReferenceProcessingProfile> sourceDocumentReferenceProcessingProfiles = new ArrayList<>(); for (final String url : urls) { final SourceDocumentReference sourceDocumentReference = new SourceDocumentReference(owner, url, null, null, null, null, true); final List<ProcessingJobSubTask> subTasks = getSubTasks(sourceDocumentReference.getUrl()); final ProcessingJob processingJob = new ProcessingJob(priority, new Date(), owner, Arrays.asList( new ProcessingJobTaskDocumentReference(documentReferenceTaskTypeFromOptions(options), sourceDocumentReference.getId(), subTasks) ), JobState.READY, URLSourceType.HASVIEW, JobCreator.URL_RESOLVER.resolveIpOfUrlAndReturnLoopbackOnFail(url), true); sourceDocumentReferenceProcessingProfiles.add( SourceDocumentReferenceProcessingProfileBuilder.edmHasView(sourceDocumentReference.getId(), owner, priority ) ); results.add( new ProcessingJobTuple(processingJob, sourceDocumentReference,sourceDocumentReferenceProcessingProfiles)); } return results; }
ProcessingJobBuilder { public static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority, final ProcessingJobCreationOptions options) throws ExecutionException { if (null == options) { throw new IllegalArgumentException("options must not be null"); } final List<ProcessingJobTuple> results = new ArrayList(); final List<SourceDocumentReferenceProcessingProfile> sourceDocumentReferenceProcessingProfiles = new ArrayList<>(); for (final String url : urls) { final SourceDocumentReference sourceDocumentReference = new SourceDocumentReference(owner, url, null, null, null, null, true); final List<ProcessingJobSubTask> subTasks = getSubTasks(sourceDocumentReference.getUrl()); final ProcessingJob processingJob = new ProcessingJob(priority, new Date(), owner, Arrays.asList( new ProcessingJobTaskDocumentReference(documentReferenceTaskTypeFromOptions(options), sourceDocumentReference.getId(), subTasks) ), JobState.READY, URLSourceType.HASVIEW, JobCreator.URL_RESOLVER.resolveIpOfUrlAndReturnLoopbackOnFail(url), true); sourceDocumentReferenceProcessingProfiles.add( SourceDocumentReferenceProcessingProfileBuilder.edmHasView(sourceDocumentReference.getId(), owner, priority ) ); results.add( new ProcessingJobTuple(processingJob, sourceDocumentReference,sourceDocumentReferenceProcessingProfiles)); } return results; } }
ProcessingJobBuilder { public static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority, final ProcessingJobCreationOptions options) throws ExecutionException { if (null == options) { throw new IllegalArgumentException("options must not be null"); } final List<ProcessingJobTuple> results = new ArrayList(); final List<SourceDocumentReferenceProcessingProfile> sourceDocumentReferenceProcessingProfiles = new ArrayList<>(); for (final String url : urls) { final SourceDocumentReference sourceDocumentReference = new SourceDocumentReference(owner, url, null, null, null, null, true); final List<ProcessingJobSubTask> subTasks = getSubTasks(sourceDocumentReference.getUrl()); final ProcessingJob processingJob = new ProcessingJob(priority, new Date(), owner, Arrays.asList( new ProcessingJobTaskDocumentReference(documentReferenceTaskTypeFromOptions(options), sourceDocumentReference.getId(), subTasks) ), JobState.READY, URLSourceType.HASVIEW, JobCreator.URL_RESOLVER.resolveIpOfUrlAndReturnLoopbackOnFail(url), true); sourceDocumentReferenceProcessingProfiles.add( SourceDocumentReferenceProcessingProfileBuilder.edmHasView(sourceDocumentReference.getId(), owner, priority ) ); results.add( new ProcessingJobTuple(processingJob, sourceDocumentReference,sourceDocumentReferenceProcessingProfiles)); } return results; }  }
ProcessingJobBuilder { public static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority, final ProcessingJobCreationOptions options) throws ExecutionException { if (null == options) { throw new IllegalArgumentException("options must not be null"); } final List<ProcessingJobTuple> results = new ArrayList(); final List<SourceDocumentReferenceProcessingProfile> sourceDocumentReferenceProcessingProfiles = new ArrayList<>(); for (final String url : urls) { final SourceDocumentReference sourceDocumentReference = new SourceDocumentReference(owner, url, null, null, null, null, true); final List<ProcessingJobSubTask> subTasks = getSubTasks(sourceDocumentReference.getUrl()); final ProcessingJob processingJob = new ProcessingJob(priority, new Date(), owner, Arrays.asList( new ProcessingJobTaskDocumentReference(documentReferenceTaskTypeFromOptions(options), sourceDocumentReference.getId(), subTasks) ), JobState.READY, URLSourceType.HASVIEW, JobCreator.URL_RESOLVER.resolveIpOfUrlAndReturnLoopbackOnFail(url), true); sourceDocumentReferenceProcessingProfiles.add( SourceDocumentReferenceProcessingProfileBuilder.edmHasView(sourceDocumentReference.getId(), owner, priority ) ); results.add( new ProcessingJobTuple(processingJob, sourceDocumentReference,sourceDocumentReferenceProcessingProfiles)); } return results; }  static final List<ProcessingJobTuple> edmObjectUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                  final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority,
                                                                    final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownByUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownAtUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmObjectUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                  final SourceDocumentReference sourceDocumentReference,
                                                                  final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls,
                                                                    final ReferenceOwner owner,
                                                                    final Integer priority,
                                                                    final SourceDocumentReference sourceDocumentReference,
                                                                    final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownByUrlJobs(final String url,
                                                                     final ReferenceOwner owner,
                                                                     final Integer priority,
                                                                     final SourceDocumentReference sourceDocumentReference,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownAtUrlJobs(final String url,
                                                                     final ReferenceOwner owner,
                                                                     final Integer priority,
                                                                     final SourceDocumentReference sourceDocumentReference,
                                                                     final ProcessingJobCreationOptions options); }
ProcessingJobBuilder { public static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority, final ProcessingJobCreationOptions options) throws ExecutionException { if (null == options) { throw new IllegalArgumentException("options must not be null"); } final List<ProcessingJobTuple> results = new ArrayList(); final List<SourceDocumentReferenceProcessingProfile> sourceDocumentReferenceProcessingProfiles = new ArrayList<>(); for (final String url : urls) { final SourceDocumentReference sourceDocumentReference = new SourceDocumentReference(owner, url, null, null, null, null, true); final List<ProcessingJobSubTask> subTasks = getSubTasks(sourceDocumentReference.getUrl()); final ProcessingJob processingJob = new ProcessingJob(priority, new Date(), owner, Arrays.asList( new ProcessingJobTaskDocumentReference(documentReferenceTaskTypeFromOptions(options), sourceDocumentReference.getId(), subTasks) ), JobState.READY, URLSourceType.HASVIEW, JobCreator.URL_RESOLVER.resolveIpOfUrlAndReturnLoopbackOnFail(url), true); sourceDocumentReferenceProcessingProfiles.add( SourceDocumentReferenceProcessingProfileBuilder.edmHasView(sourceDocumentReference.getId(), owner, priority ) ); results.add( new ProcessingJobTuple(processingJob, sourceDocumentReference,sourceDocumentReferenceProcessingProfiles)); } return results; }  static final List<ProcessingJobTuple> edmObjectUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                  final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls, final ReferenceOwner owner, final Integer priority,
                                                                    final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownByUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownAtUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmObjectUrlJobs(final String url, final ReferenceOwner owner, final Integer priority,
                                                                  final SourceDocumentReference sourceDocumentReference,
                                                                  final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmHasViewUrlsJobs(final List<String> urls,
                                                                    final ReferenceOwner owner,
                                                                    final Integer priority,
                                                                    final SourceDocumentReference sourceDocumentReference,
                                                                    final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownByUrlJobs(final String url,
                                                                     final ReferenceOwner owner,
                                                                     final Integer priority,
                                                                     final SourceDocumentReference sourceDocumentReference,
                                                                     final ProcessingJobCreationOptions options); static final List<ProcessingJobTuple> edmIsShownAtUrlJobs(final String url,
                                                                     final ReferenceOwner owner,
                                                                     final Integer priority,
                                                                     final SourceDocumentReference sourceDocumentReference,
                                                                     final ProcessingJobCreationOptions options);  }