Package lcmc.host.domain

Examples of lcmc.host.domain.HostNetworks


        eventBus.register(this);
    }

    @Subscribe
    public void onNetInterfacesChanged(final NetInterfacesChangedEvent event) {
        final HostNetworks hostNetworks = new HostNetworks();
        hostNetworks.setNetworkIntefaces(event.getNetInterfaces());
        hostNetInterfacesByHost.put(event.getHost(), hostNetworks);
    }
View Full Code Here


        hostNetInterfacesByHost.put(event.getHost(), hostNetworks);
    }

    @Subscribe
    public void onBridgesChanged(final BridgesChangedEvent event) {
        final HostNetworks hostNetworks = hostNetInterfacesByHost.get(event.getHost());
        if (hostNetworks != null) {
            hostNetworks.setBridges(event.getBridges());
        }

    }
View Full Code Here

        }

    }

    public Collection<Value> getBridges(final Host host) {
        final HostNetworks hostNetworks = hostNetInterfacesByHost.get(host);
        if (hostNetworks == null) {
            return Collections.emptyList();
        } else {
            return hostNetworks.getBridges();
        }
    }
View Full Code Here

    public Map<String,Integer> getNetworksIntersection(final Collection<Host> hosts) {
        Optional<Map<String, Integer>> networksIntersection = Optional.absent();

        for (final Host host : hosts) {
            final HostNetworks hostNetworks = hostNetInterfacesByHost.get(host);
            if (hostNetworks != null) {
                networksIntersection = hostNetworks.getNetworksIntersection(networksIntersection);
            }
        }
        return networksIntersection.or(new HashMap<String, Integer>());
    }
View Full Code Here

        }
        return networksIntersection.or(new HashMap<String, Integer>());
    }

    public NetInterface[] getNetInterfacesWithBridges(final Host host) {
        final HostNetworks hostNetworks = hostNetInterfacesByHost.get(host);
        if (hostNetworks == null) {
            return new NetInterface[]{};
        } else {
            return hostNetworks.getNetInterfacesWithBridges();
        }
    }
View Full Code Here

            return hostNetworks.getNetInterfacesWithBridges();
        }
    }

    public Collection<String> getIpsFromNetwork(final Host host, final String netIp) {
        final HostNetworks hostNetworks = hostNetInterfacesByHost.get(host);
        if (hostNetworks == null) {
            return new ArrayList<String>();
        } else {
            return hostNetworks.getIpsFromNetwork(netIp);
        }
    }
View Full Code Here

TOP

Related Classes of lcmc.host.domain.HostNetworks

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.