@Override public List<Vertex> getVertices(Collection<? extends VertexRef> references, Criteria... criteria) { return m_delegate.getVertices(references, criteria); }
@Override public List<Vertex> getVertices(Collection<? extends VertexRef> references, Criteria... criteria) { return m_delegate.getVertices(references, criteria); }
@Override public List<Vertex> getVertices(Collection<? extends VertexRef> references, Criteria... criteria) { return m_delegate.getVertices(references, criteria); }
@Override public List<SearchResult> query(SearchQuery searchQuery, GraphContainer graphContainer) { LOG.debug("SearchProvider->query: called with search query: '{}'", searchQuery); List<Vertex> vertices = m_delegate.getVertices(); List<SearchResult> searchResults = Lists.newArrayList(); for(Vertex vertex : vertices){ if(searchQuery.matches(vertex.getLabel())) { searchResults.add(new SearchResult(vertex, false, false)); } if(searchResults.size() > 50) { break; // make sure we don't display too many results => its slows the display down and makes it unusuable } } LOG.debug("SearchProvider->query: found {} search results.", searchResults.size()); return searchResults; }
@Override public Set<VertexRef> getVertices() { OnmsCategory category = categoryProvider.findCategoryByName(m_categoryName); if (category == null) { return Collections.emptySet(); } else { List<OnmsNode> nodes = categoryProvider.findNodesForCategory(category); List<Integer> nodeIds = nodes.stream().map(n -> n.getId()).collect(Collectors.toList()); GraphProvider graphProvider = graphContainer.getTopologyServiceClient().getGraphProviderBy(graphContainer.getTopologyServiceClient().getNamespace()); return graphProvider.getVertices(new IgnoreHopCriteria()).stream() .filter(v -> v.getNodeID() != null) .filter(v -> nodeIds.contains(v.getNodeID())) .collect(Collectors.toSet()); } }
@Override public Set<VertexRef> getVertices() { OnmsCategory category = categoryProvider.findCategoryByName(m_categoryName); if (category == null) { return Collections.emptySet(); } else { List<OnmsNode> nodes = categoryProvider.findNodesForCategory(category); List<Integer> nodeIds = nodes.stream().map(n -> n.getId()).collect(Collectors.toList()); GraphProvider graphProvider = graphContainer.getTopologyServiceClient().getGraphProviderBy(graphContainer.getTopologyServiceClient().getNamespace()); return graphProvider.getVertices(new IgnoreHopCriteria()).stream() .filter(v -> v.getNodeID() != null) .filter(v -> nodeIds.contains(v.getNodeID())) .collect(Collectors.toSet()); } }
try { IgnoreHopCriteria ignoreHopCriteria = (IgnoreHopCriteria)criterium; return m_delegate.getVertices(); } catch (ClassCastException e) {}
try { IgnoreHopCriteria ignoreHopCriteria = (IgnoreHopCriteria)criterium; return m_delegate.getVertices(); } catch (ClassCastException e) {}
@Override public void execute(List<VertexRef> targets, OperationContext operationContext) { GraphProvider graphProvider = operationContext.getGraphContainer().getBaseTopology(); Map<String, WrappedVertex> idMap = new HashMap<String, WrappedVertex>(); // first create all the vertices; List<WrappedVertex> vertices = new ArrayList<WrappedVertex>(); for(Vertex vertex : graphProvider.getVertices()) { WrappedVertex wrappedVertex = WrappedVertex.create(vertex); vertices.add(wrappedVertex); idMap.put(vertex.getId(), wrappedVertex); } // then set the parents for each for(Vertex vertex : graphProvider.getVertices()) { Vertex parent = graphProvider.getParent(vertex); if (parent != null) { WrappedVertex wrappedVertex = idMap.get(vertex.getId()); WrappedVertex wrappedParent = idMap.get(parent.getId()); wrappedVertex.parent = wrappedParent; } } // then create the edges List<WrappedEdge> edges = new ArrayList<WrappedEdge>(); for(Edge edge : graphProvider.getEdges()) { WrappedVertex wrappedSource = idMap.get(edge.getSource().getVertex().getId()); WrappedVertex wrappedTarget = idMap.get(edge.getTarget().getVertex().getId()); edges.add(new WrappedEdge(edge, wrappedSource, wrappedTarget)); } WrappedGraph graph = new WrappedGraph(graphProvider.getVertexNamespace(), vertices, edges); JAXB.marshal(graph, new File("/tmp/saved-graph.xml")); }
for(Vertex v : graphProvider.getVertices(criteria)) { int vzl = graphProvider.getSemanticZoomLevel(v); if (vzl == semanticZoomLevel || (vzl < semanticZoomLevel && !graphProvider.hasChildren(v))) {
for(Vertex v : graphProvider.getVertices(criteria)) { int vzl = graphProvider.getSemanticZoomLevel(v); if (vzl == semanticZoomLevel || (vzl < semanticZoomLevel && !graphProvider.hasChildren(v))) {
@Override public void execute(List<VertexRef> targets, OperationContext operationContext) { GraphProvider graphProvider = operationContext.getGraphContainer().getBaseTopology(); Map<String, WrappedVertex> idMap = new HashMap<String, WrappedVertex>(); // first create all the vertices; List<WrappedVertex> vertices = new ArrayList<WrappedVertex>(); for(Vertex vertex : graphProvider.getVertices()) { WrappedVertex wrappedVertex = WrappedVertex.create(vertex); vertices.add(wrappedVertex); idMap.put(vertex.getId(), wrappedVertex); } // then set the parents for each for(Vertex vertex : graphProvider.getVertices()) { Vertex parent = graphProvider.getParent(vertex); if (parent != null) { WrappedVertex wrappedVertex = idMap.get(vertex.getId()); WrappedVertex wrappedParent = idMap.get(parent.getId()); wrappedVertex.parent = wrappedParent; } } // then create the edges List<WrappedEdge> edges = new ArrayList<WrappedEdge>(); for(Edge edge : graphProvider.getEdges()) { WrappedVertex wrappedSource = idMap.get(edge.getSource().getVertex().getId()); WrappedVertex wrappedTarget = idMap.get(edge.getTarget().getVertex().getId()); edges.add(new WrappedEdge(edge, wrappedSource, wrappedTarget)); } WrappedGraph graph = new WrappedGraph(graphProvider.getVertexNamespace(), vertices, edges); JAXB.marshal(graph, new File("/tmp/saved-graph.xml")); }
for (Vertex eachVertex : eachGraph.getVertices(new IgnoreHopCriteria())) { sparseGraph.addVertex(eachVertex);
for (Vertex eachVertex : eachGraph.getVertices(new IgnoreHopCriteria())) { sparseGraph.addVertex(eachVertex);