com.atlassian.plugin.Plugin.getPluginsVersion()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中com.atlassian.plugin.Plugin.getPluginsVersion()方法的一些代码示例,展示了Plugin.getPluginsVersion()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.getPluginsVersion()方法的具体详情如下:
包路径:com.atlassian.plugin.Plugin
类名称:Plugin
方法名:getPluginsVersion

Plugin.getPluginsVersion介绍

暂无

代码示例

代码示例来源:origin: com.atlassian.jira/jira-core

public int compare(final Plugin plugin1, final Plugin plugin2)
  {
    int result = nameComparator.compare(plugin1, plugin2);
    if (result != 0)
    {
      return result;
    }
    result = plugin1.getKey().compareTo(plugin2.getKey());
    if (result != 0)
    {
      return result;
    }
    result = plugin1.getPluginsVersion() - plugin2.getPluginsVersion();
    if (result != 0)
    {
      return result;
    }
    return 0;
  }
}

代码示例来源:origin: com.atlassian.jira/jira-core

public Collection<Plugin> getPlugins()
{
  final SortedSet<Plugin> plugins = new TreeSet<>(new PluginComparator());
  for(Plugin plugin : pluginAccessor.getPlugins())
  {
    if (!plugins.add(plugin))
    {
      throw new IllegalStateException("Multiple plugins with the same key and version:" + plugin.getKey() + " " + plugin.getPluginsVersion());
    }
  }
  return Collections.unmodifiableSet(plugins);
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

protected Plugin loadPlugin(final ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException {
  final InputStream source = getSource();
  if (source == null) {
    throw new PluginParseException("Invalid resource or inputstream specified to load plugins from.");
  }
  Plugin plugin;
  try {
    final DescriptorParser parser = descriptorParserFactory.getInstance(source, ImmutableSet.of());
    plugin = parser.configurePlugin(moduleDescriptorFactory, getNewPlugin());
    if (plugin.getPluginsVersion() == 2) {
      UnloadablePlugin unloadablePlugin = UnloadablePluginFactory.createUnloadablePlugin(plugin);
      final StringBuilder errorText = new StringBuilder("OSGi plugins cannot be deployed via the classpath, which is usually WEB-INF/lib.");
      if (resource != null) {
        errorText.append("\n Resource is: ").append(resource);
      }
      if (url != null) {
        errorText.append("\n URL is: ").append(url);
      }
      unloadablePlugin.setErrorText(errorText.toString());
      plugin = unloadablePlugin;
    }
  } catch (final PluginParseException e) {
    throw new PluginParseException("Unable to load plugin resource: " + resource + " - " + e.getMessage(), e);
  }
  return plugin;
}

代码示例来源:origin: com.atlassian.support/stp

void addPluginInformation(SupportInfoBuilder pluginBuilder, Plugin plugin)
{
  PluginInformation pluginInformation = plugin.getPluginInformation();
  pluginBuilder.addValue(PLUGIN_KEY, plugin.getKey());
  pluginBuilder.addValue(PLUGIN_VERSION, pluginInformation.getVersion());
  pluginBuilder.addValue(PLUGIN_VENDOR, pluginInformation.getVendorName());
  pluginBuilder.addValue(PLUGIN_STATUS, plugin.getPluginState().toString());
  pluginBuilder.addValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl());
  pluginBuilder.addValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion()));
  pluginBuilder.addContext(plugin);
}

代码示例来源:origin: com.atlassian.support/stp

private void loadPluginPropertiesIntoStore(final PropertyStore pluginPropertiesStore, final Collection<Plugin> pluginsCollection)
{
  for (final Plugin plugin : pluginsCollection)
  {
    final PluginInformation pluginInformation = plugin.getPluginInformation();
    final PropertyStore pluginStore = pluginPropertiesStore.addCategory(PLUGINS_PLUGIN);
    pluginStore.setValue(PLUGIN_KEY, plugin.getKey());
    pluginStore.setValue(PLUGIN_NAME, plugin.getName());  // this is important for the SysInfo page
    pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion());
    pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName());
    pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString());
    pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl());
    pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion()));
    pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));
  }
}

代码示例来源:origin: com.atlassian.plugins/atlassian-plugins-core

newPlugin.setUninstallable(oldPlugin.isUninstallable());
newPlugin.setDeletable(oldPlugin.isDeleteable());
newPlugin.setPluginsVersion(oldPlugin.getPluginsVersion());
newPlugin.setDynamicallyLoaded(oldPlugin.isDynamicallyLoaded());

代码示例来源:origin: com.atlassian.support/stp

private void addPluginInfo(final PropertyStore store) {
  callAndLogExceptions((Callable<Void>) () -> {
    Collection<Plugin> plugins = utils.getPlugins();
    PluginMetadataManager pluginMetadataManager = ComponentManager.getComponent(PluginMetadataManager.class);
    PropertyStore pluginProperties = store.addCategory(AbstractSupportApplicationInfo.ENABLED_PLUGINS);
    for (Plugin plugin : plugins) {
      PluginInformation pluginInformation = plugin.getPluginInformation();
      PropertyStore pluginStore = pluginProperties.addCategory(PLUGINS_PLUGIN);
      pluginStore.setValue(PLUGIN_KEY, plugin.getKey());
      pluginStore.setValue(PLUGIN_NAME, plugin.getName());
      pluginStore.setValue(PLUGIN_VERSION, pluginInformation.getVersion());
      pluginStore.setValue(PLUGIN_VENDOR, pluginInformation.getVendorName());
      pluginStore.setValue(PLUGIN_STATUS, plugin.getPluginState().toString());
      pluginStore.setValue(PLUGIN_VENDOR_URL, pluginInformation.getVendorUrl());
      pluginStore.setValue(PLUGIN_FRAMEWORK_VERSION, String.valueOf(plugin.getPluginsVersion()));
      pluginStore.setValue(PLUGIN_USER_INSTALLED, pluginMetadataManager.isUserInstalled(plugin) ? "true" : "false");
      pluginStore.setValue(PLUGIN_BUNDLED, plugin.isBundledPlugin() ? getText(PLUGIN_BUNDLED) : getText(PLUGIN_USER_INSTALLED));
    }
    return null;
  });
}

相关文章