Package lcmc.drbd.ui.resource

Examples of lcmc.drbd.ui.resource.BlockDevInfo


    @Override
    public String getMainText(final Vertex v, final Application.RunMode runMode) {
        if (isVertexBlockDevice(v)) {
            String l;
            if (isVertexDrbd(v)) {
                final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
                if (bdi == null) {
                    return "";
                }
                l = bdi.getDrbdVolumeInfo().getDevice();
            } else {
                final Info info = getInfo(v);
                if (info == null) {
                    return "";
                }
View Full Code Here


    /** Is called when one block device vertex was pressed. */
    @Override
    protected void oneVertexPressed(final Vertex v) {
        if (isVertexBlockDevice(v)) {
            pickHost(v);
            final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
            if (bdi == null) {
                return;
            }
            getClusterBrowser().getGlobalInfo().setSelectedNode(bdi);
            getClusterBrowser().getGlobalInfo().selectMyself();
View Full Code Here

    /**
     * Returns whether block device belonging to this vertex is available for
     * drbd or not. Returns false if this is not a block device.
     */
    private boolean isVertexAvailable(final Vertex v) {
        final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
        if (bdi != null) {
            return bdi.getBlockDevice().isAvailable();
        }
        return false;
    }
View Full Code Here

    /**
     * Returns true if block device represented by specified vertex is
     * drbd device.
     */
    private boolean isVertexDrbd(final Vertex v) {
        final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
        if (bdi != null) {
            return bdi.getBlockDevice().isDrbd();
        }
        return false;
    }
View Full Code Here

    /**
     * Returns true if block device represented by specified vertex is
     * primary.
     */
    private boolean isVertexPrimary(final Vertex v) {
        final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
        if (bdi != null) {
            return bdi.getBlockDevice().isPrimary();
        }
        return false;
    }
View Full Code Here

    /**
     * Returns true if block device represented by specified vertex is
     * secondary.
     */
    private boolean isVertexSecondary(final Vertex v) {
        final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
        if (bdi != null) {
            return bdi.getBlockDevice().isSecondary();
        }
        return false;
    }
View Full Code Here

    @Override
    protected Color getVertexFillSecondaryColor(final Vertex v) {
        if (!isVertexBlockDevice(v)) {
            return Color.WHITE;
        }
        final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
        if (bdi == null) {
            return Color.WHITE;
        }
        if (bdi.isFirstDrbdVolume()) {
            return Color.WHITE;
        } else {
            return getVertexFillColor(v);
        }
    }
View Full Code Here

    /**
     * Finds BlockDevice object on the specified host for block device
     * represented as a string and returns it.
     */
    BlockDevice findBlockDevice(final String hostName, final String disk) {
        final BlockDevInfo bdi = findBlockDevInfo(hostName, disk);
        if (bdi == null) {
            return null;
        }
        return bdi.getBlockDevice();
    }
View Full Code Here

        }
        if (hi == null) {
            return null;
        }
        for (final Vertex v : hostBDVerticesMap.get(hi)) {
            final BlockDevInfo bdi = (BlockDevInfo) getInfo(v);
            if (bdi == null) {
                continue;
            }
            if (disk.equals(bdi.getName())
                || disk.equals(bdi.getBlockDevice().getDiskUuid())
                || bdi.getBlockDevice().getDiskIds().contains(disk)) {
                return bdi;
            }
        }
        return null;
    }
View Full Code Here

     * primary to secondory, or from connected node to the disconnected or
     * none at all.
     */
    @Override
    protected boolean showEdgeArrow(final Edge edge) {
        final BlockDevInfo sourceBDI = (BlockDevInfo) getInfo(edge.getSource());
        final BlockDevInfo destBDI = (BlockDevInfo) getInfo(edge.getDest());
        if (sourceBDI == null || destBDI == null) {
            return false;
        }
        final BlockDevice sourceBD = sourceBDI.getBlockDevice();
        final BlockDevice destBD = destBDI.getBlockDevice();
        final Application.RunMode runMode = getRunMode();
        if (sourceBDI.isConnected(runMode)
            && sourceBD.isPrimary() != destBD.isPrimary()) {
            return true;
        } else if (sourceBDI.isWFConnection(runMode) ^ destBDI.isWFConnection(runMode)) {
            /* show arrow from wf connection */
            return true;
        }
        return false;
    }
View Full Code Here

TOP

Related Classes of lcmc.drbd.ui.resource.BlockDevInfo

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.