Package lcmc.host.domain

Examples of lcmc.host.domain.HostBlockDevices


        eventBus.register(this);
    }

    @Subscribe
    public void blockDevicesChanged(final BlockDevicesChangedEvent event) {
        final HostBlockDevices hostBlockDevices = new HostBlockDevices();
        hostBlockDevices.setBlockDevices(event.getBlockDevices());
        hostBlockDevicesByHost.put(event.getHost(), hostBlockDevices);
    }
View Full Code Here


        hostBlockDevicesByHost.put(event.getHost(), hostBlockDevices);
    }

    @Subscribe
    public void drbdStatusChanged(final DrbdStatusChangedEvent event) {
        final HostBlockDevices hostBlockDevices = hostBlockDevicesByHost.get(event.getHost());
        if (hostBlockDevices != null) {
            hostBlockDevices.resetDrbdOnBlockDevices(event.isDrbdStatusOk());
        }
    }
View Full Code Here

        }
    }

    @Subscribe
    public void blockDevicesDiskSpaceEvent(final BlockDevicesDiskSpaceEvent event) {
        final HostBlockDevices hostBlockDevices = hostBlockDevicesByHost.get(event.getHost());
        if (hostBlockDevices != null) {
            hostBlockDevices.setDiskSpace(event.getDiskSpaces());
        }
    }
View Full Code Here

            hostBlockDevices.setDiskSpace(event.getDiskSpaces());
        }
    }

    public Collection<BlockDevice> getBlockDevices(final Host host) {
        final HostBlockDevices hostBlockDevices = hostBlockDevicesByHost.get(host);
        if (hostBlockDevices == null) {
            return Collections.emptyList();
        } else {
            return hostBlockDevices.getBlockDevices();
        }
    }
View Full Code Here

    }

    public Collection<String> getCommonBlockDeviceNames(final Iterable<Host> hosts) {
        Optional<Collection<String>> namesIntersection = Optional.absent();
        for (final Host host : hosts) {
            final HostBlockDevices hostBlockDevices = hostBlockDevicesByHost.get(host);
            if (hostBlockDevices != null) {
                namesIntersection = hostBlockDevices.getBlockDevicesNamesIntersection(namesIntersection);
            }
        }
        return namesIntersection.or(new ArrayList<String>());
    }
View Full Code Here

        }
        return namesIntersection.or(new ArrayList<String>());
    }

    public Optional<BlockDevice> getBlockDeviceByName(final Host host, final String name) {
        final HostBlockDevices hostBlockDevices = hostBlockDevicesByHost.get(host);
        if (hostBlockDevices != null) {
            return hostBlockDevices.getBlockDeviceByName(name);
        }
        return Optional.absent();
    }
View Full Code Here

TOP

Related Classes of lcmc.host.domain.HostBlockDevices

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.