Package org.rhq.core.domain.cloud

Examples of org.rhq.core.domain.cloud.StorageNode


    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handlePrepareForBootstrap(ResourceOperationHistory operationHistory) {
        StorageNode newStorageNode = findStorageNode(operationHistory.getResource());
        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            return;
        case CANCELED:
View Full Code Here


    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleAddNodeMaintenance(ResourceOperationHistory resourceOperationHistory) {
        StorageNode storageNode = findStorageNode(resourceOperationHistory.getResource());
        Configuration parameters = resourceOperationHistory.getParameters();
        String newNodeAddress = parameters.getSimpleValue("newNodeAddress");
        StorageNode newStorageNode;

        switch (resourceOperationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            return;
        case CANCELED:
            newStorageNode = findStorageNodeByAddress(newNodeAddress);
            deploymentOperationCanceled(storageNode, resourceOperationHistory, newStorageNode);
            return;
        case FAILURE:
            newStorageNode = findStorageNodeByAddress(newNodeAddress);
            deploymentOperationFailed(storageNode, resourceOperationHistory, newStorageNode);
            return;
        default: // SUCCESS
            log.info("Finished running add node maintenance for " + storageNode);
            storageNode.setMaintenancePending(false);
            StorageNode nextNode = takeFromMaintenanceQueue();
            newStorageNode = findStorageNodeByAddress(newNodeAddress);

            if (nextNode == null) {
                log.info("Finished running add node maintenance on all cluster nodes");
                storageNodeOperationsHandler.setMode(newStorageNode, StorageNode.OperationMode.NORMAL);
View Full Code Here

    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleRemoveNodeMaintenance(ResourceOperationHistory operationHistory) {
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        Configuration parameters = operationHistory.getParameters();
        String removedNodeAddress = parameters.getSimpleValue("removedNodeAddress");
        StorageNode removedStorageNode;

        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            break;
        case CANCELED:
            removedStorageNode = findStorageNodeByAddress(removedNodeAddress);
            undeploymentOperationCanceled(storageNode, operationHistory, removedStorageNode);
            break;
        case FAILURE:
            removedStorageNode = findStorageNodeByAddress(removedNodeAddress);
            undeploymentOperationFailed(storageNode, operationHistory, removedStorageNode);
            break;
        default: // SUCCESS
            log.info("Finished remove node maintenance for " + storageNode);
            storageNode.setMaintenancePending(false);
            StorageNode nextNode = takeFromMaintenanceQueue();
            removedStorageNode = findStorageNodeByAddress(removedNodeAddress);

            if (nextNode == null) {
                log.info("Finished running remove node maintenance on all cluster nodes");
                removedStorageNode = storageNodeOperationsHandler.setMode(removedStorageNode,
View Full Code Here

        for (StorageNode node : clusterNodes) {
            node.setErrorMessage(null);
            node.setFailedOperation(null);
            node.setMaintenancePending(true);
        }
        StorageNode storageNode = storageNodeOperationsHandler.setMode(clusterNodes.get(0),
            StorageNode.OperationMode.MAINTENANCE);
        scheduleOperation(subject, storageNode, new Configuration(), "repair", Hours.SIX.toStandardSeconds()
            .getSeconds());
    }
View Full Code Here

    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleRepair(ResourceOperationHistory operationHistory) {
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            break;
        case CANCELED:
            repairCanceled(storageNode, operationHistory);
            break;
        case FAILURE:
            repairFailed(storageNode, operationHistory);
            break;
        default: // SUCCESS
            log.info("Finished running repair on " + storageNode);
            storageNode.setMaintenancePending(false);
            storageNodeOperationsHandler.setMode(storageNode, StorageNode.OperationMode.NORMAL);
            StorageNode nextNode = takeFromMaintenanceQueue();

            if (nextNode == null) {
                log.info("Finished running repair on storage cluster");
            } else {
                nextNode = storageNodeOperationsHandler.setMode(nextNode, StorageNode.OperationMode.MAINTENANCE);
View Full Code Here

    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleDecommission(ResourceOperationHistory operationHistory) {
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing do to here
            break;
        case CANCELED:
View Full Code Here

    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleUninstall(ResourceOperationHistory operationHistory) {
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            break;
        case CANCELED:
View Full Code Here

        if (log.isInfoEnabled()) {
            log.info("Linking " + resource + " to storage node at " + address);
        }
        try {
            StorageNode storageNode = storageNodeManager.findStorageNodeByAddress(address);
            if (storageNode == null) {
                if (InetAddresses.isInetAddress(address)) {
                    String hostName = InetAddresses.forString(address).getHostName();
                    log.info("Did not find storage node with address [" + address + "]. Searching by hostname ["
                        + hostName + "]");
                    storageNode = storageNodeManager.findStorageNodeByAddress(hostName);
                } else {
                    String ipAddress = InetAddress.getByName(address).getHostAddress();
                    log.info("Did not find storage node with address [" + address + "] Searching by IP address ["
                        + ipAddress + "]");
                    storageNode = storageNodeManager.findStorageNodeByAddress(ipAddress);
                }
            }
            StorageClusterSettings clusterSettings = storageClusterSettingsManager.getClusterSettings(subjectManager
                .getOverlord());
            if (storageNode != null) {
                if (log.isInfoEnabled()) {
                    log.info(storageNode + " is an existing storage node. No cluster maintenance is necessary.");
                }
                storageNode.setAddress(address);
                storageNode.setResource(resource);
                storageNode.setOperationMode(OperationMode.NORMAL);
                storageNodeManager.linkExistingStorageNodeToResource(storageNode);
                storageNodeManager.scheduleSnapshotManagementOperationsForStorageNode(subjectManager.getOverlord(),
                    storageNode, clusterSettings);

            } else {
View Full Code Here

        }
    }

    @Override
    public StorageNode linkExistingStorageNodeToResource(StorageNode storageNode) {
        StorageNode existingStorageNode = entityManager.find(StorageNode.class, storageNode.getId());
        if (null != existingStorageNode) {
            existingStorageNode.setAddress(storageNode.getAddress());
            existingStorageNode.setResource(storageNode.getResource());
            existingStorageNode.setOperationMode(storageNode.getOperationMode());
            storageNode = entityManager.merge(existingStorageNode);

        } else {
            log.info("Storage node did not exist, could not link to Resource. Returning unpersisted Storage Node "
                + storageNode);
View Full Code Here

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public StorageNode createStorageNode(Resource resource, StorageClusterSettings clusterSettings) {
        Configuration pluginConfig = resource.getPluginConfiguration();

        StorageNode storageNode = new StorageNode();
        storageNode.setAddress(pluginConfig.getSimpleValue(RHQ_STORAGE_ADDRESS_PROPERTY));
        storageNode.setCqlPort(clusterSettings.getCqlPort());
        storageNode.setResource(resource);
        storageNode.setOperationMode(OperationMode.INSTALLED);
        storageNode.setVersion(this.getClass().getPackage().getImplementationVersion());

        entityManager.persist(storageNode);

        return storageNode;
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.cloud.StorageNode

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.