Examples of ConfigurationDefinition


Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

            vLayout.setOverflow(Overflow.AUTO);

            // keep a reference to the startingConfig in case the user navs back and changes it
            startingConfig = wizard.getNewStartingConfiguration();
            ConfigurationDefinition def = getDriftConfigDef();
            editor = new ConfigurationEditor(def, startingConfig);
            vLayout.addMember(editor);
        }

        return vLayout;
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

* @author Ian Springer
*/
public abstract class TestConfigurationFactory {

    public static ConfigurationDefinition createConfigurationDefinition() {
        ConfigurationDefinition configDef = new ConfigurationDefinition("TestConfig", "a test config");

        ConfigurationTemplate defaultTemplate = new ConfigurationTemplate(ConfigurationTemplate.DEFAULT_TEMPLATE_NAME, "default template");
        configDef.putTemplate(defaultTemplate);
        Configuration defaultConfiguration = new Configuration();
        defaultTemplate.setConfiguration(defaultConfiguration);

        Map<String, PropertyDefinition> propertyDefinitions = new HashMap<String, PropertyDefinition>();
        configDef.setPropertyDefinitions(propertyDefinitions);

        int orderIndex = 0;

        PropertyDefinitionSimple simplePropDef;

View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

        }

        GWTServiceLookup.getDriftService().getDriftDefinition(driftDefId, new AsyncCallback<DriftDefinition>() {
            @Override
            public void onSuccess(final DriftDefinition result) {
                ConfigurationDefinition configDef = null;
                if (result.getTemplate() != null && result.getTemplate().isPinned()) {
                    configDef = DriftConfigurationDefinition.getExistingResourceInstanceByPinnedTemplate();
                } else {
                    configDef = DriftConfigurationDefinition.getInstanceForExistingConfiguration();
                }
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

        try {
            // this is simulating what the UI would be doing, build the config and call the server-side API
            // we'll pretend the user is the overlord - another test will check a real user to see permission errors
            ResourceType newResource1Type = resource.getResourceType();
            ConfigurationDefinition initialDefinition = newResource1Type.getResourceConfigurationDefinition();
            int loadCount = 300;
            HashSet<String> parsedNames = new HashSet<String>();
            for (int i = 0; i < loadCount; i++) {
                String name = "fakeProperty_" + i;
                initialDefinition
                    .put(new PropertyDefinitionSimple(name, "fake_" + i, false, PropertySimpleType.BOOLEAN));
                parsedNames.add(name);
            }
            newResource1Type.setResourceConfigurationDefinition(initialDefinition);
            newResource1Type = em.merge(newResource1Type);
            em.flush(); // so that slsb calls below will see the change reflected in the db

            ConfigurationDefinition configurationDefinition = newResource1Type.getResourceConfigurationDefinition();
            assert configurationDefinition != null : "Configuration Definition could not be located.";
            //retrieve the options for ConfigurationDefinition
            ConfigurationDefinition options = configurationManager.getOptionsForConfigurationDefinition(overlord,
                newResource1.getId(), -1, configurationDefinition);
            assert options != null : "Unable able to retrieve options for resource with id [" + newResource1.getId()
                + "].";
            assert !options.getPropertyDefinitions().entrySet().isEmpty() : "No PropertyDefinitionSimple instances found.";

            PropertyDefinitionSimple locatedPropertyDefSimple = null;
            int locatedCount = 0;
            for (Map.Entry<String, PropertyDefinition> entry : options.getPropertyDefinitions().entrySet()) {
                PropertyDefinition pd = entry.getValue();
                if (pd instanceof PropertyDefinitionSimple) {
                    locatedPropertyDefSimple = (PropertyDefinitionSimple) pd;
                    locatedCount++;
                    parsedNames.remove(locatedPropertyDefSimple.getName());
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

        }
        OperationRest operationRest = new OperationRest(resourceId,definitionId);
        operationRest.setId((int)System.currentTimeMillis()); // TODO better id (?)(we need one for pUT later on)
        operationRest.setReadyToSubmit(false);
        operationRest.setName(opDef.getName());
        ConfigurationDefinition paramDefinition = opDef.getParametersConfigurationDefinition();
        if (paramDefinition != null) {
            for (PropertyDefinition propDefs : paramDefinition.getNonGroupedProperties()) { // TODO extend to all properties ?
                operationRest.getParams().put(propDefs.getName(),"TODO"); // TODO type and value of the value
            }
        }

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

        if (operation.isReadyToSubmit()) {

            OperationDefinition opDef = opsManager.getOperationDefinition(caller,operation.getDefinitionId());

            // Validate parameters
            ConfigurationDefinition parameterDefinition = opDef.getParametersConfigurationDefinition();
            if (parameterDefinition!=null) {
                // There are parameters defined, so lets validate them.
                List<String> errorMessages = ConfigurationHelper.checkConfigurationWrtDefinition(parameters, parameterDefinition);

                if (errorMessages.size()>0) {
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

     * of which type they are and which ones are required
     * @param def OperationsDefinition to "copy"
     * @param definitionRest The definition to fill in
     */
    private void copyParamsForDefinition(OperationDefinition def, OperationDefinitionRest definitionRest) {
        ConfigurationDefinition cd = def.getParametersConfigurationDefinition();
        if (cd==null) {
            return;
        }

        for (Map.Entry<String,PropertyDefinition> entry : cd.getPropertyDefinitions().entrySet()) {
            PropertyDefinition pd = entry.getValue();
            if (pd instanceof PropertyDefinitionSimple) {
                PropertyDefinitionSimple pds = (PropertyDefinitionSimple) pd;
                SimplePropDef prop = new SimplePropDef();
                prop.setName(pds.getName());
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

    }

    @Override
    public ConfigurationDefinition getPluginConfigurationDefinition(int resourceTypeId) throws RuntimeException {
        try {
            ConfigurationDefinition definition = configurationManager.getPluginConfigurationDefinitionForResourceType(
                getSessionSubject(), resourceTypeId);
            return SerialUtility.prepare(definition, "ConfigurationService.getPluginConfigDefinition");
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

    }

    @Override
    public ConfigurationDefinition getResourceConfigurationDefinition(int resourceTypeId) throws RuntimeException {
        try {
            ConfigurationDefinition definition = configurationManager
                .getResourceConfigurationDefinitionWithTemplatesForResourceType(getSessionSubject(), resourceTypeId);
            return SerialUtility.prepare(definition, "ResourceDefinition");
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

Examples of org.rhq.core.domain.configuration.definition.ConfigurationDefinition

    @Override
    public ConfigurationDefinition getOptionValuesForConfigDefinition(int resourceId, int parentResourceId,
        ConfigurationDefinition definition) throws RuntimeException {
        try {
            ConfigurationDefinition def = configurationManager.getOptionsForConfigurationDefinition(
                getSessionSubject(), resourceId, parentResourceId, definition);
            return SerialUtility.prepare(def, "ConfigurationService.getOptionValuesForPropertySimple");
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.