Java Code Examples for org.onosproject.net.Host#id()
The following examples show how to use
org.onosproject.net.Host#id() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OpenstackSwitchingHostProviderTest.java From onos with Apache License 2.0 | 6 votes |
@Override public void addLocationToHost(HostId hostId, HostLocation location) { Host oldHost = hostMap.get(hostId); Set<HostLocation> newHostlocations = oldHost.locations(); newHostlocations.add(location); Host newHost = new DefaultHost(oldHost.providerId(), oldHost.id(), oldHost.mac(), oldHost.vlan(), newHostlocations, oldHost.ipAddresses(), oldHost.innerVlan(), oldHost.tpid(), oldHost.configured(), oldHost.annotations()); hostMap.put(hostId, newHost); }
Example 2
Source File: HostsWebResource.java From onos with Apache License 2.0 | 5 votes |
/** * Creates and adds new host based on given data and returns its host ID. * * @param node JsonNode containing host information * @return host ID of new host created */ private HostId parseHost(JsonNode node) { Host host = codec(Host.class).decode((ObjectNode) node, HostsWebResource.this); HostId hostId = host.id(); DefaultHostDescription desc = new DefaultHostDescription( host.mac(), host.vlan(), host.locations(), host.ipAddresses(), host.innerVlan(), host.tpid(), host.configured(), (SparseAnnotations) host.annotations()); hostProviderService.hostDetected(hostId, desc, false); return hostId; }
Example 3
Source File: ModelCache.java From onos with Apache License 2.0 | 5 votes |
void addOrUpdateHost(Host host) { HostId id = host.id(); String memo = MEMO_UPDATED; UiHost uiHost = uiTopology.findHost(id); if (uiHost == null) { uiHost = addNewHost(host); memo = MEMO_ADDED; } updateHost(uiHost, host); postEvent(HOST_ADDED_OR_UPDATED, uiHost, memo); // Link event must be sent after the host event UiEdgeLink uiEdgeLink = uiTopology.findEdgeLink(uiHost.edgeLinkId()); postEvent(LINK_ADDED_OR_UPDATED, uiEdgeLink, memo); }
Example 4
Source File: ModelCache.java From onos with Apache License 2.0 | 5 votes |
void removeHost(Host host) { HostId id = host.id(); UiHost uiHost = uiTopology.findHost(id); if (uiHost != null) { UiEdgeLink edgeLink = uiTopology.findEdgeLink(uiHost.edgeLinkId()); uiTopology.remove(edgeLink); postEvent(LINK_REMOVED, edgeLink, MEMO_REMOVED); uiTopology.remove(uiHost); postEvent(HOST_REMOVED, uiHost, MEMO_REMOVED); } else { log.warn(E_NO_ELEMENT, "host", id); } }
Example 5
Source File: TopoIntentFilter.java From onos with Apache License 2.0 | 5 votes |
private boolean isIntentRelevantToHosts(HostToHostIntent intent, Iterable<Host> hosts) { for (Host host : hosts) { HostId id = host.id(); // Bail if intent does not involve this host. if (!id.equals(intent.one()) && !id.equals(intent.two())) { return false; } } return true; }
Example 6
Source File: UiHost.java From onos with Apache License 2.0 | 5 votes |
/** * Creates a new UI host. * * @param topology parent topology * @param host backing host */ public UiHost(UiTopology topology, Host host) { checkNotNull(host, HOST_CANNOT_BE_NULL); this.topology = topology; this.hostId = host.id(); this.regionId = RegionId.regionId(UiRegion.NULL_NAME); }
Example 7
Source File: DefaultHostProbe.java From onos with Apache License 2.0 | 5 votes |
/** * Constructs DefaultHostProbe with given retry. * * @param host host to be probed * @param connectPoint location to be verified * @param probeMac source MAC address of the probe * @param mode probe mode * @param retry number of retry */ DefaultHostProbe(Host host, ConnectPoint connectPoint, ProbeMode mode, MacAddress probeMac, int retry) { super(host.providerId(), host.id(), host.mac(), host.vlan(), host.locations(), host.ipAddresses(), host.configured()); this.connectPoint = connectPoint; this.mode = mode; this.probeMac = probeMac; this.retry = retry; }
Example 8
Source File: TopologyViewMessageHandlerBase.java From onos with Apache License 2.0 | 4 votes |
private EdgeLink edgeLink(Host host, boolean ingress) { return new DefaultEdgeLink(PID, new ConnectPoint(host.id(), portNumber(0)), host.location(), ingress); }
Example 9
Source File: MaoRoutingManager.java From ONOS_LoadBalance_Routing_Forward with Apache License 2.0 | 2 votes |
/** * Generate EdgeLink which is between Host and Device. * Tool for getLoadBalancePaths(). * * @param host * @param isIngress whether it is Ingress to Device or not. * @return */ private EdgeLink getEdgeLink(Host host, boolean isIngress) { return new DefaultEdgeLink(routeProviderId, new ConnectPoint(host.id(), PortNumber.portNumber(0)), host.location(), isIngress); }