@Test public void canStoreVideoArtifactRemotely() throws IOException, StorageException, URISyntaxException { assertTrue(JniLoader.isLoaded()); Table<Integer, Integer, URI> expectedResults = new ImmutableTable.Builder<Integer, Integer, URI>() .put(1, 0, getExpectedUri("f97dd04f771f00ff8230964b41ee8bb9f0a494c95d8266eb3797233fa62b2a0c")) .put(6, 5, getExpectedUri("6f40abbb266b4b75623901850be789f151f1a2b7c10468e952acc2758533d231")) .put(10, 9, getExpectedUri("e42964a776a29b3e7be02761d6723c467bd336e7d5b7a4bdd3131f8ae26db3c2")) .build(); Path testFile = getTestFileCopy(); SortedMap<Integer, Map<Integer, JsonDetectionOutputObject>> extractionsMap = new TreeMap<>(); List<Integer> frames = Arrays.asList(0, 5, 9); for (Integer frame : frames) { Map<Integer, JsonDetectionOutputObject> trackAndDetection = new TreeMap<>(); trackAndDetection.put(frame+1, new JsonDetectionOutputObject(10, 20, 100, 200, (float)0.1, Collections.emptySortedMap(), frame.intValue(), 0, "REQUESTED", "")); extractionsMap.put(frame, trackAndDetection); } ArtifactExtractionRequest request = new ArtifactExtractionRequest( TEST_JOB_ID, 0, testFile.toString(), MediaType.VIDEO, 0, 0, true); request.getExtractionsMap().putAll(extractionsMap); Table<Integer, Integer, URI> results = _nginxStorageService.storeArtifacts(request); assertEquals(expectedResults, results); }
@Override public Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request) throws IOException, StorageException { URI serviceUri = getServiceUri(request.getJobId()); return StreamableFrameExtractor.run(request, inStream -> store(serviceUri, inStream)); }
CustomNginxStorageBackend implements StorageBackend { @Override public Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request) throws IOException, StorageException { URI serviceUri = getServiceUri(request.getJobId()); return StreamableFrameExtractor.run(request, inStream -> store(serviceUri, inStream)); } }
CustomNginxStorageBackend implements StorageBackend { @Override public Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request) throws IOException, StorageException { URI serviceUri = getServiceUri(request.getJobId()); return StreamableFrameExtractor.run(request, inStream -> store(serviceUri, inStream)); } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); }
CustomNginxStorageBackend implements StorageBackend { @Override public Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request) throws IOException, StorageException { URI serviceUri = getServiceUri(request.getJobId()); return StreamableFrameExtractor.run(request, inStream -> store(serviceUri, inStream)); } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); @Override boolean canStore(JsonOutputObject outputObject); @Override URI store(JsonOutputObject outputObject); @Override boolean canStore(MarkupResult markupResult); @Override void store(MarkupResult markupResult); @Override boolean canStore(ArtifactExtractionRequest request); @Override Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request); URI store(URI serviceUri, InputStream content); }
CustomNginxStorageBackend implements StorageBackend { @Override public Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request) throws IOException, StorageException { URI serviceUri = getServiceUri(request.getJobId()); return StreamableFrameExtractor.run(request, inStream -> store(serviceUri, inStream)); } @Inject  CustomNginxStorageBackend(
            PropertiesUtil propertiesUtil,
            ObjectMapper objectMapper,
            InProgressBatchJobsService inProgressBatchJobs); @Override boolean canStore(JsonOutputObject outputObject); @Override URI store(JsonOutputObject outputObject); @Override boolean canStore(MarkupResult markupResult); @Override void store(MarkupResult markupResult); @Override boolean canStore(ArtifactExtractionRequest request); @Override Table<Integer, Integer, URI> storeArtifacts(ArtifactExtractionRequest request); URI store(URI serviceUri, InputStream content);  }