Example #1
0
  public boolean equals(Object obj) {
    if (!(obj instanceof PluginPackage)) {
      return false;
    }

    PluginPackage pluginPackage = (PluginPackage) obj;

    EqualsBuilder equalsBuilder = new EqualsBuilder();

    equalsBuilder.append(getModuleId(), pluginPackage.getModuleId());
    equalsBuilder.append(getRepositoryURL(), pluginPackage.getRepositoryURL());

    return equalsBuilder.isEquals();
  }
  public void addPluginPackage(PluginPackage pluginPackage) {
    if (pluginPackage.getContext() == null) {
      if (_log.isDebugEnabled()) {
        _log.debug(
            "Plugin package cannot be registered because it does not "
                + "have an installation context");
      }

      return;
    }

    _pendingPackages.remove(pluginPackage.getContext());
    _pendingPackages.remove(pluginPackage.getModuleId());

    _pluginPackages.remove(pluginPackage.getContext());
    _pluginPackages.put(pluginPackage.getContext(), pluginPackage);
  }
  public void registerPluginPackageInstallation(PluginPackage pluginPackage) {
    if (pluginPackage.getContext() != null) {
      PluginPackage previousPluginPackage = _pluginPackages.get(pluginPackage.getContext());

      if (previousPluginPackage == null) {
        addPluginPackage(pluginPackage);
      }
    }

    String key = pluginPackage.getContext();

    if (key == null) {
      key = pluginPackage.getModuleId();
    }

    _pendingPackages.put(key, pluginPackage);
  }