use of com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings in project gocd by gocd.
the class PackageMaterialPluginInfoBuilder method pluginInfoFor.
public PackageMaterialPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
RepositoryConfiguration repositoryConfiguration = extension.getRepositoryConfiguration(descriptor.id());
com.thoughtworks.go.plugin.api.material.packagerepository.PackageConfiguration packageConfiguration = extension.getPackageConfiguration(descriptor.id());
if (repositoryConfiguration == null) {
throw new RuntimeException(format("Plugin[%s] returned null repository configuration", descriptor.id()));
}
if (packageConfiguration == null) {
throw new RuntimeException(format("Plugin[%s] returned null package configuration", descriptor.id()));
}
PluggableInstanceSettings pluginSettingsAndView = getPluginSettingsAndView(descriptor, extension);
return new PackageMaterialPluginInfo(descriptor, new PluggableInstanceSettings(packageRepoConfigurations(repositoryConfiguration)), new PluggableInstanceSettings(packageRepoConfigurations(packageConfiguration)), pluginSettingsAndView);
}
use of com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings in project gocd by gocd.
the class PluggableTaskPluginInfoBuilder method pluginInfoFor.
public PluggableTaskPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
final TaskPreference[] tp = { null };
extension.doOnTask(descriptor.id(), new Action<Task>() {
@Override
public void execute(Task task, GoPluginDescriptor pluginDescriptor) {
tp[0] = new TaskPreference(task);
}
});
TaskConfig config = tp[0].getConfig();
TaskView view = tp[0].getView();
if (config == null) {
throw new RuntimeException(format("Plugin[%s] returned null task configuration", descriptor.id()));
}
if (view == null) {
throw new RuntimeException(format("Plugin[%s] returned null task view", descriptor.id()));
}
String displayName = view.displayValue();
PluggableInstanceSettings taskSettings = new PluggableInstanceSettings(configurations(config), new PluginView(view.template()));
return new PluggableTaskPluginInfo(descriptor, displayName, taskSettings);
}
use of com.thoughtworks.go.plugin.domain.common.PluggableInstanceSettings in project gocd by gocd.
the class AuthorizationPluginInfoBuilder method pluginInfoFor.
public AuthorizationPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) {
Capabilities capabilities = capabilities(descriptor.id());
PluggableInstanceSettings authConfigSettings = authConfigSettings(descriptor.id());
PluggableInstanceSettings roleSettings = roleSettings(descriptor.id(), capabilities);
Image image = image(descriptor.id());
return new AuthorizationPluginInfo(descriptor, authConfigSettings, roleSettings, image, capabilities);
}
Aggregations