@Test public void testDiscoverOperationsForOutput() throws Exception { Set<Operation<String>> result = matchDiscovery.findOperationsProducing("y"); assertNotNull(result); assertEquals(2, result.size()); }
@Override public Set<Operation<E>> findOperationsProducing(E output) { Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E source : sources.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithOutput(source); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; }
MatchBasedDiscoveryIO implements DiscoveryIO<E> { @Override public Set<Operation<E>> findOperationsProducing(E output) { Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E source : sources.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithOutput(source); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; } }
MatchBasedDiscoveryIO implements DiscoveryIO<E> { @Override public Set<Operation<E>> findOperationsProducing(E output) { Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E source : sources.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithOutput(source); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; } MatchBasedDiscoveryIO(MatchGraph<E, T> matchGraph, ServiceProvider<E> provider); }
MatchBasedDiscoveryIO implements DiscoveryIO<E> { @Override public Set<Operation<E>> findOperationsProducing(E output) { Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E source : sources.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithOutput(source); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; } MatchBasedDiscoveryIO(MatchGraph<E, T> matchGraph, ServiceProvider<E> provider); @Override Set<Operation<E>> findOperationsConsuming(E input); @Override Set<Operation<E>> findOperationsProducing(E output); }
MatchBasedDiscoveryIO implements DiscoveryIO<E> { @Override public Set<Operation<E>> findOperationsProducing(E output) { Map<E,T> sources = matchGraph.getSourceElementsThatMatch(output); Set<Operation<E>> relevantOps = new HashSet<Operation<E>>(); for(E source : sources.keySet()){ Iterable<Operation<E>> result = provider.getOperationsWithOutput(source); if (result != null){ relevantOps.addAll(Sets.newHashSet(result)); } } return relevantOps; } MatchBasedDiscoveryIO(MatchGraph<E, T> matchGraph, ServiceProvider<E> provider); @Override Set<Operation<E>> findOperationsConsuming(E input); @Override Set<Operation<E>> findOperationsProducing(E output);  }