Package org.rhq.core.domain.configuration.definition

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


                    : patch.getTargetVersion();

                DeploymentProperties props = new DeploymentProperties(0, patch.getIdentityName(),
                    version, patch.getDescription(), DestinationComplianceMode.full);

                ConfigurationDefinition config = new ConfigurationDefinition("wildfly-patch", null);
                PropertyDefinitionSimple patchIdProp = new PropertyDefinitionSimple("patchId", "The ID of the patch",
                    true,
                    PropertySimpleType.STRING);
                patchIdProp.setDefaultValue(patch.getId());
                patchIdProp.setReadOnly(true);
                PropertyDefinitionSimple patchTypeProp = new PropertyDefinitionSimple("patchType",
                    "The type of the patch",
                    true, PropertySimpleType.STRING);
                patchTypeProp.setDefaultValue(patch.getType().toString());
                patchTypeProp.setReadOnly(true);

                config.put(patchIdProp);
                config.put(patchTypeProp);
                addCommonProperties(config);

                parseResults = new RecipeParseResults(props, config, null);
                fileName = patch.getId();
                recipe = patch.getContents();
            } else if (patchInfo.is(PatchBundle.class)) {
                PatchBundle patchBundle = patchInfo.as(PatchBundle.class);

                Patch lastPatch = null;
                StringBuilder allPatchIds = new StringBuilder();

                for (PatchBundle.Element p : patchBundle) {
                    lastPatch = p.getPatch();
                    allPatchIds.append(p.getPatch().getId()).append("#");
                }
                allPatchIds.replace(allPatchIds.length() - 1, allPatchIds.length(), "");

                if (lastPatch == null) {
                    throw new UnknownRecipeException("Not a Wildfly patch");
                }

                DeploymentProperties props = new DeploymentProperties(0, lastPatch.getIdentityName(),
                    lastPatch.getTargetVersion(), lastPatch.getDescription(), DestinationComplianceMode.full);

                ConfigurationDefinition config = new ConfigurationDefinition("wildfly-patch", null);
                PropertyDefinitionSimple allPatchIdsProp = new PropertyDefinitionSimple("allPatchIds",
                    "Hash-separated list of all individual patches the patch bundle is composed of.", true,
                    PropertySimpleType.STRING);
                allPatchIdsProp.setDefaultValue(allPatchIds.toString());
                allPatchIdsProp.setReadOnly(true);
                PropertyDefinitionSimple patchTypeProp = new PropertyDefinitionSimple("patchType",
                    "The type of the patch", true, PropertySimpleType.STRING);
                patchTypeProp.setDefaultValue("patch-bundle");
                patchTypeProp.setReadOnly(true);

                config.put(allPatchIdsProp);
                config.put(patchTypeProp);
                addCommonProperties(config);

                parseResults = new RecipeParseResults(props, config, null);
                fileName = allPatchIds.toString();
                recipe = patchBundle.getContents();
View Full Code Here


    StructuredAndRawConfigManagement structuredAndRawConfigManagement;

    @BeforeMethod
    public void setup() {
        resourceType = new ResourceType();
        resourceType.setResourceConfigurationDefinition(new ConfigurationDefinition("", ""));

        configFacet = context.mock(ResourceConfigurationFacet.class);

        structuredAndRawConfigManagement = new StructuredAndRawConfigManagement();
        structuredAndRawConfigManagement.setComponentService(componentService);
View Full Code Here

    }

    ResourceType createResourceType() {
        ResourceType resourceType = new ResourceType();
        resourceType
            .setResourceConfigurationDefinition(new ConfigurationDefinition("test_config", "Test Configuration"));

        return resourceType;
    }
View Full Code Here

            outcome = OUTCOME_ARTIFACT;
            break;
        }

        case CONFIGURATION: {
            ConfigurationDefinition configurationDefinition = lookupConfigurationDefinition(resourceType.getId());
            outcome = (configurationDefinition.getTemplates().size() > 1) ? OUTCOME_CONFIGURATION_MULTIPLE_TEMPLATES
                : OUTCOME_CONFIGURATION_SINGLE_TEMPLATE;
            break;
        }
        }
View Full Code Here

    }

    private ConfigurationDefinition lookupConfigurationDefinition(int resourceTypeId) {
        Subject user = EnterpriseFacesContextUtility.getSubject();
        ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager();
        ConfigurationDefinition configurationDefinition = configurationManager
            .getResourceConfigurationDefinitionWithTemplatesForResourceType(user, resourceTypeId);
        return configurationDefinition;
    }
View Full Code Here

        if (log.isDebugEnabled()) {
            log.debug("Updating plugin configuration definition for " + existingType);
        }

        existingType = entityMgr.find(ResourceType.class, existingType.getId());
        ConfigurationDefinition existingConfigurationDefinition = existingType.getPluginConfigurationDefinition();
        if (newType.getPluginConfigurationDefinition() != null) {
            // all new
            if (existingConfigurationDefinition == null) {
                if (log.isDebugEnabled()) {
                    log.debug(existingType + " currently does not have a plugin configuration definition. Adding "
View Full Code Here

                    contentSourceType.setDefaultDownloadMode(DownloadMode.valueOf(newType.getDownloadMode()
                        .toUpperCase()));
                    contentSourceType.setDefaultSyncSchedule(newType.getSyncSchedule());
                    contentSourceType.setContentSourceApiClass(newType.getApiClass());

                    ConfigurationDefinition configDef = ConfigurationMetadataParser.parse(newType.getName(), newType
                        .getConfiguration());
                    contentSourceType.setContentSourceConfigurationDefinition(configDef);

                    // add the new domain object to the list of domain objects for this plugin
                    pluginTypes.put(contentSourceType.getName(), contentSourceType);
View Full Code Here

    }

    @Override
    protected ConfigurationDefinition lookupConfigurationDefinition() {
        int resourceTypeId = EnterpriseFacesContextUtility.getResource().getResourceType().getId();
        ConfigurationDefinition configurationDefinition = this.configurationManager
            .getPluginConfigurationDefinitionForResourceType(EnterpriseFacesContextUtility.getSubject(), resourceTypeId);
        return configurationDefinition;
    }
View Full Code Here

        this.measurementScheduleManager = measurementScheduleManager;
    }

    @Override
    public ConfigurationDefinition getImportConfigurationDefinition() {
        ConfigurationDefinition def = new ConfigurationDefinition("MetricTemplateImportConfiguration", null);
        PropertyDefinitionSimple updateAllSchedules =
            new PropertyDefinitionSimple(
                UPDATE_ALL_SCHEDULES_PROPERTY,
                "If set to true, all the metric templates will update all the existing schedules on corresponding resources.",
                true, PropertySimpleType.BOOLEAN);
        updateAllSchedules.setDefaultValue(Boolean.toString(UPDATE_SCHEDULES_DEFAULT));
        def.put(updateAllSchedules);

        PropertyDefinitionSimple metricName =
            new PropertyDefinitionSimple(METRIC_NAME_PROPERTY, "The name of the metric", true,
                PropertySimpleType.STRING);
        PropertyDefinitionSimple resourceTypeName =
            new PropertyDefinitionSimple(RESOURCE_TYPE_NAME_PROPERTY,
                "The name of the resource type defining the metric", true, PropertySimpleType.STRING);
        PropertyDefinitionSimple resourceTypePlugin =
            new PropertyDefinitionSimple(RESOURCE_TYPE_PLUGIN_PROPERTY,
                "The name of the plugin defining the resource type that defines the metric", true,
                PropertySimpleType.STRING);
        PropertyDefinitionSimple updateSchedules =
            new PropertyDefinitionSimple(UPDATE_SCHEDULES_PROPERTY,
                "Whether to update the schedules of this metric on existing resources", true,
                PropertySimpleType.BOOLEAN);

        PropertyDefinitionMap metricUpdateOverride =
            new PropertyDefinitionMap(METRIC_UPDATE_OVERRIDE_PROPERTY, null, true, metricName, resourceTypeName,
                resourceTypePlugin, updateSchedules);
        PropertyDefinitionList metricUpdateOverrides =
            new PropertyDefinitionList(METRIC_UPDATE_OVERRIDES_PROPERTY, "Per metric settings", false,
                metricUpdateOverride);

        def.put(metricUpdateOverrides);

        ConfigurationUtility.initializeDefaultTemplate(def);

        return def;
    }
View Full Code Here

        return info;
    }

    private void ensureDisplayNameIsSet(RecipeParseResults recipeParseResults) {
        if (recipeParseResults != null && recipeParseResults.getConfigurationDefinition() != null) {
            ConfigurationDefinition configDef = recipeParseResults.getConfigurationDefinition();
            for (PropertyDefinition propDef : configDef.getPropertyDefinitions().values()) {
                if (propDef instanceof PropertyDefinitionSimple) {
                    if (propDef.getDisplayName() == null) {
                        propDef.setDisplayName(propDef.getName());
                    }
                }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.ConfigurationDefinition$GroupComparator

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.