private void probe(IpAddress ip) { Set<Host> hosts = hostManager.getHostsByIp(ip); if (hosts.isEmpty()) { sendRequest(ip); } else { for (Host host : hosts) { HostProvider provider = hostProviders.get(host.providerId()); if (provider == null) { hostProviders.remove(host.providerId(), null); } else { provider.triggerProbe(host); } } } }
/** * Providers should only be able to remove a host that is provided by itself, * or a host that is not configured. */ private boolean allowedToChange(HostId hostId) { Host host = store.getHost(hostId); return host == null || !host.configured() || host.providerId().equals(provider().id()); } }
desc = BasicHostOperator.combine(cfg, desc); if (desc != null) { he = store.createOrUpdateHost(host.providerId(), hostId, desc, false); HostProvider hp = (host == null) ? null : getProvider(host.providerId()); HostDescription desc = (host == null) ? null : BasicHostOperator.descriptionOf(host); Optional<Config> prevConfig = event.prevConfig();
/** * Prints information about a host. * * @param host end-station host */ protected void printHost(Host host) { if (shortOnly) { print(FMT_SHORT, host.id(), host.mac(), host.locations(), host.vlan(), host.ipAddresses()); } else { print(FMT, host.id(), host.mac(), host.locations(), host.vlan(), host.ipAddresses(), annotations(host.annotations()), host.innerVlan(), host.tpid().toString(), host.providerId().scheme(), host.providerId().id(), host.configured()); } } }