Search in sources :

Example 1 with SCMMetadataStore

use of com.thoughtworks.go.plugin.access.scm.SCMMetadataStore in project gocd by gocd.

the class SCM method applyPluginMetadata.

@PostConstruct
public void applyPluginMetadata() {
    String pluginId = getPluginId();
    for (ConfigurationProperty configurationProperty : configuration) {
        SCMMetadataStore scmMetadataStore = SCMMetadataStore.getInstance();
        if (scmMetadataStore.getConfigurationMetadata(pluginId) != null) {
            boolean isSecureProperty = scmMetadataStore.hasOption(pluginId, configurationProperty.getConfigurationKey().getName(), SCMConfiguration.SECURE);
            configurationProperty.handleSecureValueConfiguration(isSecureProperty);
        }
    }
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) SCMMetadataStore(com.thoughtworks.go.plugin.access.scm.SCMMetadataStore) PostConstruct(javax.annotation.PostConstruct)

Example 2 with SCMMetadataStore

use of com.thoughtworks.go.plugin.access.scm.SCMMetadataStore in project gocd by gocd.

the class SCM method getConfigForDisplay.

public String getConfigForDisplay() {
    String pluginId = getPluginId();
    SCMMetadataStore metadataStore = SCMMetadataStore.getInstance();
    List<ConfigurationProperty> propertiesToBeUsedForDisplay = ConfigurationDisplayUtil.getConfigurationPropertiesToBeUsedForDisplay(metadataStore, pluginId, configuration);
    String prefix = metadataStore.hasPlugin(pluginId) ? "" : "WARNING! Plugin missing. ";
    return prefix + configuration.forDisplay(propertiesToBeUsedForDisplay);
}
Also used : ConfigurationProperty(com.thoughtworks.go.domain.config.ConfigurationProperty) SCMMetadataStore(com.thoughtworks.go.plugin.access.scm.SCMMetadataStore)

Aggregations

ConfigurationProperty (com.thoughtworks.go.domain.config.ConfigurationProperty)2 SCMMetadataStore (com.thoughtworks.go.plugin.access.scm.SCMMetadataStore)2 PostConstruct (javax.annotation.PostConstruct)1