IngestServiceImpl extends AbstractJobProducer implements IngestService, ManagedService { public WorkflowInstance addZippedMediaPackage(InputStream zipStream) throws IngestException, IOException, MediaPackageException { try { return addZippedMediaPackage(zipStream, null, null); } catch (NotFoundException e) { throw new IllegalStateException("A not found exception was thrown without a lookup"); } } IngestServiceImpl(); @Override @Activate void activate(ComponentContext cc); @Deactivate void deactivate(); @Override void updated(Dictionary<String, ?> properties); @Reference void setHttpClient(TrustedHttpClient httpClient); @Reference void setServiceRegistry(ServiceRegistry serviceRegistry); @Reference void setMediaInspectionService(MediaInspectionService mediaInspectionService); WorkflowInstance addZippedMediaPackage(InputStream zipStream); @Override WorkflowInstance addZippedMediaPackage(InputStream zipStream, String wd, Map<String, String> workflowConfig); @Override WorkflowInstance addZippedMediaPackage(InputStream zipStream, String workflowDefinitionId,
          Map<String, String> workflowConfig, Long workflowInstanceId); @Override MediaPackage createMediaPackage(); @Override MediaPackage createMediaPackage(String mediaPackageId); @Override MediaPackage addTrack(URI uri, MediaPackageElementFlavor flavor, MediaPackage mediaPackage); @Override MediaPackage addTrack(URI uri, MediaPackageElementFlavor flavor, String[] tags, MediaPackage mediaPackage); @Override MediaPackage addTrack(InputStream in, String fileName, MediaPackageElementFlavor flavor,
          MediaPackage mediaPackage); @Override MediaPackage addTrack(InputStream in, String fileName, MediaPackageElementFlavor flavor, String[] tags,
          MediaPackage mediaPackage); @Override MediaPackage addPartialTrack(URI uri, MediaPackageElementFlavor flavor, long startTime,
          MediaPackage mediaPackage); @Override MediaPackage addPartialTrack(InputStream in, String fileName, MediaPackageElementFlavor flavor, long startTime,
          MediaPackage mediaPackage); @Override MediaPackage addCatalog(URI uri, MediaPackageElementFlavor flavor, MediaPackage mediaPackage); @Override MediaPackage addCatalog(InputStream in, String fileName, MediaPackageElementFlavor flavor,
          MediaPackage mediaPackage); @Override MediaPackage addCatalog(InputStream in, String fileName, MediaPackageElementFlavor flavor, String[] tags,
          MediaPackage mediaPackage); @Override MediaPackage addAttachment(URI uri, MediaPackageElementFlavor flavor, MediaPackage mediaPackage); @Override MediaPackage addAttachment(InputStream in, String fileName, MediaPackageElementFlavor flavor, String[] tags,
          MediaPackage mediaPackage); @Override MediaPackage addAttachment(InputStream in, String fileName, MediaPackageElementFlavor flavor,
          MediaPackage mediaPackage); @Override WorkflowInstance ingest(MediaPackage mp); @Override WorkflowInstance ingest(MediaPackage mp, String wd, Map<String, String> properties); @Override WorkflowInstance ingest(MediaPackage mp, String workflowDefinitionId, Map<String, String> properties,
          Long workflowInstanceId); @Override void schedule(MediaPackage mediaPackage, String workflowDefinitionID, Map<String, String> properties); @Override void discardMediaPackage(MediaPackage mp); @Reference void setWorkflowService(WorkflowService workflowService); @Reference void setWorkingFileRepository(WorkingFileRepository workingFileRepository); @Reference void setSeriesService(SeriesService seriesService); @Reference void setDublinCoreService(DublinCoreCatalogService dublinCoreService); @Reference void setSecurityService(SecurityService securityService); @Reference void setUserDirectoryService(UserDirectoryService userDirectoryService); @Reference( policy = ReferencePolicy.DYNAMIC, cardinality = ReferenceCardinality.OPTIONAL, unbind = "unsetSchedulerService" ) void setSchedulerService(SchedulerService schedulerService); void unsetSchedulerService(SchedulerService schedulerService); @Reference void setOrganizationDirectoryService(OrganizationDirectoryService organizationDirectory); static Function<MediaPackageElement, Job> newEnrichJob(final MediaInspectionService svc); static Function<Job, Track> payloadAsTrack(final ServiceRegistry reg); static final String LEGACY_MEDIAPACKAGE_ID_KEY; static final String JOB_TYPE; static final String INGEST_ZIP; static final String INGEST_TRACK; static final String INGEST_TRACK_FROM_URI; static final String INGEST_ATTACHMENT; static final String INGEST_ATTACHMENT_FROM_URI; static final String INGEST_CATALOG; static final String INGEST_CATALOG_FROM_URI; static final float DEFAULT_INGEST_FILE_JOB_LOAD; static final float DEFAULT_INGEST_ZIP_JOB_LOAD; static final String FILE_JOB_LOAD_KEY; static final String ZIP_JOB_LOAD_KEY; static final String DOWNLOAD_SOURCE; static final String DOWNLOAD_USER; static final String DOWNLOAD_PASSWORD; static final boolean DEFAULT_ALLOW_SERIES_MODIFICATIONS; static final boolean DEFAULT_ALLOW_ONLY_NEW_FLAVORS; static final boolean DEFAULT_SKIP; @Deprecated
  static final String MODIFY_OPENCAST_SERIES_KEY; static final String ADD_ONLY_NEW_FLAVORS_KEY; static final String SKIP_CATALOGS_KEY; static final String SKIP_ATTACHMENTS_KEY; }
@Test public void testThickClient() throws Exception { FileUtils.copyURLToFile(urlPackage.toURL(), packageFile); InputStream packageStream = null; try { packageStream = urlPackage.toURL().openStream(); WorkflowInstance instance = service.addZippedMediaPackage(packageStream); Assert.assertEquals(workflowInstanceID, instance.getId()); } catch (IOException e) { Assert.fail(e.getMessage()); } finally { IOUtils.closeQuietly(packageStream); } }
@Test public void testThickClientOldMP() throws Exception { FileUtils.copyURLToFile(urlPackageOld.toURL(), packageFile); InputStream packageStream = null; try { packageStream = urlPackageOld.toURL().openStream(); WorkflowInstance instance = service.addZippedMediaPackage(packageStream); Assert.assertEquals(workflowInstanceID, instance.getId()); } catch (IOException e) { Assert.fail(e.getMessage()); } finally { IOUtils.closeQuietly(packageStream); } }