Package org.qzerver.model.domain.entities.cluster

Examples of org.qzerver.model.domain.entities.cluster.ClusterGroup


        return currentIndex;
    }

    @Override
    public ClusterNode createNode(long clusterGroupId, String address, String comment, boolean activity) {
        ClusterGroup clusterGroup = businessEntityDao.lockById(ClusterGroup.class, clusterGroupId);
        if (clusterGroup == null) {
            throw new MissingEntityException(ClusterGroup.class, clusterGroupId);
        }

        ClusterNode clusterNode = new ClusterNode();
        clusterNode.setEnabled(activity);
        clusterNode.setAddress(address);
        clusterNode.setDescription(comment);

        clusterGroup.getNodes().add(clusterNode);
        clusterNode.setGroup(clusterGroup);

        clusterGroup.reindexNodes();

        return clusterNode;
    }
View Full Code Here


        ClusterNode clusterNode = businessEntityDao.findById(ClusterNode.class, clusterNodeId);
        if (clusterNode == null) {
            throw new MissingEntityException(ClusterNode.class, clusterNodeId);
        }

        ClusterGroup clusterGroup = clusterNode.getGroup();

        businessEntityDao.lock(clusterGroup);

        int index = clusterGroup.getNodes().indexOf(clusterNode);
        clusterGroup.getNodes().remove(index);

        clusterGroup.reindexNodes();

        if (clusterGroup.getRollingIndex() > index) {
            clusterGroup.setRollingIndex(clusterGroup.getRollingIndex() - 1);
        }
    }
View Full Code Here

TOP

Related Classes of org.qzerver.model.domain.entities.cluster.ClusterGroup

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.