Search in sources :

Example 1 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class NotificationViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : notificationPluginRegistry.getNotificationPlugins()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, NotificationExtension.EXTENSION_NAME, null, null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)

Example 2 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PackageViewModelBuilder method pluginInfoFor.

public PluginInfo pluginInfoFor(String pluginId) {
    String PACKAGE_CONFIGRATION_TYPE = "package";
    String REPOSITORY_CONFIGRATION_TYPE = "repository";
    if (!PackageMetadataStore.getInstance().hasPreferenceFor(pluginId)) {
        return null;
    }
    GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
    ArrayList<PluginConfiguration> pluginConfigurations = new ArrayList<>();
    pluginConfigurations.addAll(configurations(PackageMetadataStore.getInstance().getMetadata(pluginId), PACKAGE_CONFIGRATION_TYPE));
    pluginConfigurations.addAll(configurations(RepositoryMetadataStore.getInstance().getMetadata(pluginId), REPOSITORY_CONFIGRATION_TYPE));
    return new PluginInfo(descriptor, PackageRepositoryExtension.EXTENSION_NAME, null, new PluggableInstanceSettings(pluginConfigurations));
}
Also used : PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) ArrayList(java.util.ArrayList) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo)

Example 3 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PluggableTaskPluginInfoBuilder method pluginInfoFor.

@Override
public PluggableTaskPluginInfo pluginInfoFor(String pluginId) {
    if (!store.pluginIds().contains(pluginId)) {
        return null;
    }
    GoPluginDescriptor plugin = pluginManager.getPluginDescriptorFor(pluginId);
    TaskPreference taskPreference = store.preferenceFor(pluginId);
    List<PluginConfiguration> pluginConfigurations = configurations(taskPreference.getConfig());
    PluginView pluginView = new PluginView(taskPreference.getView().template());
    return new PluggableTaskPluginInfo(plugin, taskPreference.getView().displayValue(), new PluggableInstanceSettings(pluginConfigurations, pluginView));
}
Also used : PluggableInstanceSettings(com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings) PluginConfiguration(com.thoughtworks.go.server.ui.plugins.PluginConfiguration) PluginView(com.thoughtworks.go.server.ui.plugins.PluginView) PluggableTaskPluginInfo(com.thoughtworks.go.server.ui.plugins.PluggableTaskPluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) TaskPreference(com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)

Example 4 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class PluggableTaskViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : PluggableTaskConfigStore.store().pluginIds()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        TaskPreference taskPreference = PluggableTaskConfigStore.store().preferenceFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, TaskExtension.TASK_EXTENSION, taskPreference.getView().displayValue(), null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor) TaskPreference(com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)

Example 5 with GoPluginDescriptor

use of com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor in project gocd by gocd.

the class SCMViewModelBuilder method allPluginInfos.

public List<PluginInfo> allPluginInfos() {
    List<PluginInfo> pluginInfos = new ArrayList<>();
    for (String pluginId : SCMMetadataStore.getInstance().pluginIds()) {
        GoPluginDescriptor descriptor = pluginManager.getPluginDescriptorFor(pluginId);
        SCMPreference scmPreference = SCMMetadataStore.getInstance().preferenceFor(pluginId);
        pluginInfos.add(new PluginInfo(descriptor, SCMExtension.EXTENSION_NAME, scmPreference.getScmView().displayValue(), null, null));
    }
    return pluginInfos;
}
Also used : ArrayList(java.util.ArrayList) SCMPreference(com.thoughtworks.go.plugin.access.scm.SCMPreference) PluginInfo(com.thoughtworks.go.server.ui.plugins.PluginInfo) GoPluginDescriptor(com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)

Aggregations

GoPluginDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginDescriptor)214 Test (org.junit.jupiter.api.Test)114 Test (org.junit.Test)53 ElasticAgentPluginInfo (com.thoughtworks.go.plugin.domain.elastic.ElasticAgentPluginInfo)20 File (java.io.File)19 PluginManager (com.thoughtworks.go.plugin.infra.PluginManager)16 PluggableInstanceSettings (com.thoughtworks.go.server.ui.plugins.PluggableInstanceSettings)14 AuthorizationPluginInfo (com.thoughtworks.go.plugin.domain.authorization.AuthorizationPluginInfo)12 Capabilities (com.thoughtworks.go.plugin.domain.elastic.Capabilities)12 Before (org.junit.Before)12 AnalyticsPluginInfo (com.thoughtworks.go.plugin.domain.analytics.AnalyticsPluginInfo)11 GoPluginBundleDescriptor (com.thoughtworks.go.plugin.infra.plugininfo.GoPluginBundleDescriptor)11 PluginView (com.thoughtworks.go.server.ui.plugins.PluginView)11 Bundle (org.osgi.framework.Bundle)10 GoPlugin (com.thoughtworks.go.plugin.api.GoPlugin)9 PluginInfo (com.thoughtworks.go.server.ui.plugins.PluginInfo)9 TaskPreference (com.thoughtworks.go.plugin.access.pluggabletask.TaskPreference)8 TaskView (com.thoughtworks.go.plugin.api.task.TaskView)8 ArrayList (java.util.ArrayList)8 InvocationOnMock (org.mockito.invocation.InvocationOnMock)8