use of org.eclipse.winery.repository.exceptions.AllocationException in project winery by eclipse.
the class MinExternalConnections method getPossibleMatches.
@Override
protected List<List<PermutationHelper>> getPossibleMatches(TopologyWrapper topology) {
List<List<PermutationHelper>> possibilities = new ArrayList<>();
try {
for (TNodeTemplate topLevelNT : topology.getTopLevelNTs()) {
Map<TNodeTemplate, List<TTopologyTemplate>> fragments = fragmentsCache.getAllMatchingFragments(topology, topLevelNT);
List<PermutationHelper> possibility = new ArrayList<>();
for (Map.Entry<TNodeTemplate, List<TTopologyTemplate>> entry : fragments.entrySet()) {
possibility.add(new PermutationHelper(entry.getKey(), entry.getValue()));
}
possibilities.add(possibility);
}
} catch (AllocationException e) {
logger.debug("Exception calculating matching fragments: " + e.getMessage());
return new ArrayList<>();
}
return possibilities;
}
Aggregations