Package org.rhq.core.domain.configuration

Examples of org.rhq.core.domain.configuration.PropertyList


            for (Property val : map.values()) {
                getPropertyStrings(val, str, indent + "   ");
            }
        } else if (prop instanceof PropertyList) {
            str.append(indent + prop.getName() + " LIST:\n");
            PropertyList propList = (PropertyList) prop;
            for (Property val : propList.getList()) {
                getPropertyStrings(val, str, indent + "   ");
            }
        } else {
            str.append("unknown prop type: " + prop);
        }
View Full Code Here


    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleAnnounce(ResourceOperationHistory resourceOperationHistory) {
        StorageNode storageNode = findStorageNode(resourceOperationHistory.getResource());
        Configuration parameters = resourceOperationHistory.getParameters();
        PropertyList addresses = parameters.getList("addresses");
        StorageNode newStorageNode;

        switch (resourceOperationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            return;
        case CANCELED:
            newStorageNode = findStorageNodeByAddress(getAddress(addresses));
            deploymentOperationCanceled(storageNode, resourceOperationHistory, newStorageNode);
        case FAILURE:
            newStorageNode = findStorageNodeByAddress(getAddress(addresses));
            deploymentOperationFailed(storageNode, resourceOperationHistory, newStorageNode);
            return;
        default: // SUCCESS
            storageNode.setMaintenancePending(false);
            StorageNode nextNode = takeFromMaintenanceQueue();
            Subject subject = getSubject(resourceOperationHistory);
            newStorageNode = findStorageNodeByAddress(getAddress(addresses));

            if (nextNode == null) {
                log.info("Successfully announced new storage node to storage cluster");
                newStorageNode = storageNodeOperationsHandler.setMode(newStorageNode,
                    StorageNode.OperationMode.BOOTSTRAP);
                storageNodeOperationsHandler.bootstrapStorageNode(subject, newStorageNode);
            } else {
                announceStorageNode(subject, newStorageNode, nextNode, addresses.deepCopy(false));
            }
        }
    }
View Full Code Here

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void handleUnannounce(ResourceOperationHistory operationHistory) {
        StorageNode storageNode = findStorageNode(operationHistory.getResource());
        Configuration params = operationHistory.getParameters();
        PropertyList addresses = params.getList("addresses");
        StorageNode removedStorageNode;

        switch (operationHistory.getStatus()) {
        case INPROGRESS:
            // nothing to do here
            break;
        case CANCELED:
            removedStorageNode = findStorageNodeByAddress(getAddress(addresses));
            undeploymentOperationCanceled(storageNode, operationHistory, removedStorageNode);
            break;
        case FAILURE:
            removedStorageNode = findStorageNodeByAddress(getAddress(addresses));
            deploymentOperationFailed(storageNode, operationHistory, removedStorageNode);
            break;
        default: // SUCCESS
            storageNode.setMaintenancePending(false);
            StorageNode nextNode = takeFromMaintenanceQueue();
            Subject subject = getSubject(operationHistory);
            removedStorageNode = findStorageNodeByAddress(getAddress(addresses));

            if (nextNode == null) {
                log.info("Successfully unannounced " + removedStorageNode + " to storage cluster");
                removedStorageNode = storageNodeOperationsHandler.setMode(removedStorageNode,
                    StorageNode.OperationMode.UNINSTALL);
                uninstall(getSubject(operationHistory), removedStorageNode);
            } else {
                unannounceStorageNode(subject, nextNode, addresses.deepCopy(false));
            }
        }
    }
View Full Code Here

                log.info("Finished running add node maintenance on all cluster nodes");
                storageNodeOperationsHandler.setMode(newStorageNode, StorageNode.OperationMode.NORMAL);
            } else {

                boolean runRepair = parameters.getSimple(RUN_REPAIR_PROPERTY).getBooleanValue();
                PropertyList seedsList = parameters.getList(SEEDS_LIST).deepCopy(false);
                Subject subject = getSubject(resourceOperationHistory);
                performAddNodeMaintenance(subject, nextNode, runRepair, seedsList, newNodeAddress);
            }
        }
    }
View Full Code Here

                removedStorageNode = storageNodeOperationsHandler.setMode(removedStorageNode,
                    StorageNode.OperationMode.UNANNOUNCE);
                unannounceStorageNode(getSubject(operationHistory), removedStorageNode);
            } else {
                boolean runRepair = parameters.getSimple(RUN_REPAIR_PROPERTY).getBooleanValue();
                PropertyList seedsList = parameters.getList(SEEDS_LIST).deepCopy(false);
                Subject subject = getSubject(operationHistory);
                performRemoveNodeMaintenance(subject, nextNode, runRepair, seedsList, removedNodeAddress);
            }
        }
    }
View Full Code Here

        }
        return list.get(0);
    }

    private PropertyList createPropertyListOfAddresses(String propertyName, List<StorageNode> nodes) {
        PropertyList list = new PropertyList(propertyName);
        for (StorageNode storageNode : nodes) {
            list.add(new PropertySimple("address", storageNode.getAddress()));
        }
        return list;
    }
View Full Code Here

        configuration.setHeapSize(storageNodeConfiguration.getSimpleValue(RHQ_STORAGE_HEAP_MAX_PROPERTY));
        configuration.setHeapNewSize(storageNodeConfiguration.getSimpleValue(RHQ_STORAGE_HEAP_NEW_PROPERTY));
        configuration.setThreadStackSize(storageNodeConfiguration.getSimpleValue(RHQ_STORAGE_THREAD_STACK_PROPERTY));
        configuration.setCommitLogLocation(storageNodeConfiguration.getSimpleValue(RHQ_STORAGE_COMMIT_LOG_PROPERTY));
        configuration.setSavedCachesLocation(storageNodeConfiguration.getSimpleValue(RHQ_STORAGE_SAVED_CACHES_PROPERTY));
        PropertyList allDataFileLocations = storageNodeConfiguration.getList(RHQ_STORAGE_DATA_FILE_PROPERTY);
        if(allDataFileLocations != null) {
            List<String> dataDirectories = new LinkedList<String>();
            for (Property property : allDataFileLocations.getList()) {
                PropertySimple dataFileLocation = (PropertySimple) property;
                dataDirectories.add(dataFileLocation.getStringValue());
            }
            configuration.setDataLocations(dataDirectories);
        }
View Full Code Here

    /*
    org.rhq.enterprise.server.rest.helper.ConfigurationHelper has similar method, getPropertyList(String propertyName, List<Object> objects);
    Merge these two?
     */
    private static PropertyList getPropertyList(String listName, String propertyName, List<? extends Object> objects) {
        PropertyList propertyList = new PropertyList(listName);
        for(Object o : objects) {
            propertyList.add(new PropertySimple(propertyName, o));
        }
        return propertyList;
    }
View Full Code Here

        if (!(p instanceof PropertyList)) {
            LOG.warn(resource + " in " + baseResource + ": option source expression for property " + pds.getName()
                + " and target configuration does not point to a list");
            return false;
        }
        PropertyList pl = (PropertyList) p;
        List<Property> propertyList = pl.getList();
        if (propertyList.size() == 0)
            return false;

        // Now List of simple or list of maps (of simple) ?
View Full Code Here

            PropertyDefinition listMemberPropertyDefinition = propertyDefinitionList.getMemberDefinition();
            // If the property is a List of Maps, iterate the list, and recurse into each Map and mask its child
            // properties.
            if (listMemberPropertyDefinition instanceof PropertyDefinitionMap) {
                PropertyDefinitionMap propertyDefinitionMap = (PropertyDefinitionMap) listMemberPropertyDefinition;
                PropertyList propertyList = parentPropertyMap.getList(propertyDefinition.getName());
                for (Property property : propertyList.getList()) {
                    PropertyMap propertyMap = (PropertyMap) property;
                    maskPropertyMap(propertyMap, propertyDefinitionMap);
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.PropertyList

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.