/** @deprecated Use {@link #getHead()} */ @JsonIgnore @Deprecated @Nonnull public NodeInterfacePair getInterface2() { return getHead(); }
private void rebuildFromEdges() { _nodeEdges.clear(); _interfaceEdges.clear(); for (Edge edge : _edges) { String node1 = edge.getNode1(); String node2 = edge.getNode2(); NodeInterfacePair iface1 = edge.getTail(); NodeInterfacePair iface2 = edge.getHead(); _nodeEdges.computeIfAbsent(node1, k -> new TreeSet<>()).add(edge); _nodeEdges.computeIfAbsent(node2, k -> new TreeSet<>()).add(edge); _interfaceEdges.computeIfAbsent(iface1, k -> new TreeSet<>()).add(edge); _interfaceEdges.computeIfAbsent(iface2, k -> new TreeSet<>()).add(edge); } }
/** * Get the hostname/interface of the last hop or {@code null} if the flow was no accepted. * * @return the hostname of the accepting node or {@code null} if the flow disposition is not * "accepted" */ @Nullable @JsonIgnore public NodeInterfacePair getAcceptingNode() { if (getDisposition() != FlowDisposition.ACCEPTED) { return null; } FlowTraceHop lastHop = getLastHop(); return lastHop == null ? null : lastHop.getEdge().getHead(); }
/** * Compute the layer 3 topology from the layer-2 topology and layer-3 information contained in the * configurations. */ public static @Nonnull Topology computeLayer3Topology( @Nonnull Layer2Topology layer2Topology, @Nonnull Map<String, Configuration> configurations) { return new Topology( synthesizeL3Topology(configurations).getEdges().stream() .filter(edge -> layer2Topology.inSameBroadcastDomain(edge.getHead(), edge.getTail())) .collect(ImmutableSortedSet.toImmutableSortedSet(Comparator.naturalOrder()))); }
Interface i2 = ifaceMap.get(e.getHead()); String neighbor = e.getNode2(); GraphEdge ge1 = new GraphEdge(i1, i2, router, neighbor, false, false);
@Test public void testGetterEquivalence() { assertThat(EDGE.getNode1(), equalTo(EDGE.getTail().getHostname())); assertThat(EDGE.getNode2(), equalTo(EDGE.getHead().getHostname())); assertThat(EDGE.getInt1(), equalTo(EDGE.getTail().getInterface())); assertThat(EDGE.getInt2(), equalTo(EDGE.getHead().getInterface())); }
NodeInterfacePair head = edge.getHead(); if ((tunnelIpsecEndpoints.contains(tail) || tunnelIpsecEndpoints.contains(head)) && (!successfulIPsecEdges.contains(edge)