org.eclipse.mylyn.discovery.core_3.7.1.v20120425-0100

ntry.getValue(), "UTF-8"));
      }
    }
    return sb.toString();
  }
  
  private static String getBundleVersion(Bundle bundle)
  {
    if (bundle == null) {
      return null;
    }
    Object bundleVersion = bundle.getHeaders().get("Bundle-Version");
    if (bundleVersion == null) {
      return null;
    }
    return stripQualifier((String)bundleVersion);
  }
  
  private static Map<String, String> getProperties(ConnectorDescriptor descriptor)
  {
    Map<String, String> p = new LinkedHashMap();
    p.put("id", descriptor.getId());
    p.put("discovery", getBundleVersion(Platform.getBundle("org.eclipse.mylyn")));
    p.put("product", System.getProperty("eclipse.product"));
    p.put("buildId", System.getProperty("eclipse.buildId"));
    p.put("os", System.getProperty("osgi.os"));
    p.put("arch", System.getProperty("osgi.arch"));
    p.put("ws", System.getProperty("osgi.ws"));
    p.put("nl", System.getProperty("osgi.nl"));
    return p;
  }
  
  private static String stripQualifier(String longVersion)
  {
    if (longVersion == null) {
      return null;
    }
    String[] parts = longVersion.split("\\.");
    StringBuilder version = new StringBuilder();
    if (parts.length > 0)
    {
      version.append(parts[0]);
      if (parts.length > 1)
      {
        version.append(".");
        version.append(parts[1]);
        if (parts.length > 2)
        {
          version.append(".");
          version.append(parts[2]);
        }
      }
    }
    return version.toString();
  }
  
  public DiscoveryFeedbackJob(List<ConnectorDescriptor> descriptors)
  {
    super(Messages.DiscoveryFeedbackJob_Job_Label);
    Assert.isNotNull(descriptors);
    this.descriptors = descriptors;
    setSystem(true);
  }
  
  private List<URI> getStatUrls()
  {
    List<URI> uris = new ArrayList(descriptors.size());
    for (ConnectorDescriptor descriptor : descriptors) {
      try
      {
        StringBuilder sb = new StringBuilder(descriptor.getStatsUrl());
        try
        {
          Map<String, String> p = getProperties(descriptor);
          String parameters = toUrl(p);
          sb.append("?");
          sb.append(parameters);
        }
        catch (UnsupportedEncodingException localUnsupportedEncodingException) {}
        URI uri = new URI(sb.toString());
        uris.add(uri);
      }
      catch (URISyntaxException localURISyntaxException) {}
    }
    return uris;
  }
  
  protected IStatus run(IProgressMonitor monitor)
  {
    try
    {
      WebUtil.verifyAvailability(getStatUrls(), false, monitor);
    }
    catch (Exception localException) {}
    return Status.OK_STATUS;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DiscoveryFeedbackJob
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.URL;
import org.osgi.framework.Bundle;

public class BundleDiscoverySource
  extends AbstractDiscoverySource
{
  private final Bundle bundle;
  
  public BundleDiscoverySource(Bundle bundle)
  {
    if (bundle == null) {
      throw new IllegalArgumentException();
    }
    this.bundle = bundle;
  }
  
  public Object getId()
  {
    return "bundle:" + bundle.getSymbolicName();
  }
  
  public URL getResource(String relativeUrl)
  {
    return bundle.getEntry(relativeUrl);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.BundleDiscoverySource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IConfigurationElement;

public class ConnectorDiscoveryExtensionReader
{
  private static final String P2_FEATURE_GROUP_SUFFIX = ".feature.group";
  public static final String EXTENSION_POINT_ID = "org.eclipse.mylyn.discovery.core.connectorDiscovery";
  public static final String CONNECTOR_DESCRIPTOR = "connectorDescriptor";
  public static final String CONNECTOR_CATEGORY = "connectorCategory";
  public static final String CERTIFICATION = "certification";
  public static final String ICON = "icon";
  public static final String OVERVIEW = "overview";
  public static final String FEATURE_FILTER = "featureFilter";
  public static final String GROUP = "group";
  
  public ConnectorDescriptor readConnectorDescriptor(IConfigurationElement element)
    throws ValidationException
  {
    return readConnectorDescriptor(element, ConnectorDescriptor.class);
  }
  
  public <T extends ConnectorDescriptor> T readConnectorDescriptor(IConfigurationElement element, Class<T> clazz)
    throws ValidationException
  {
    try
    {
      connectorDescriptor = (ConnectorDescriptor)clazz.newInstance();
    }
    catch (Exception e)
    {
      T connectorDescriptor;
      throw new IllegalStateException(e);
    }
    T connectorDescriptor;
    String str1;
    try
    {
      String kinds = element.getAttribute("kind");
      if (kinds != null)
      {
        String[] akinds = kinds.split("\\s*,\\s*");
        String[] arrayOfString1;
        int i = (arrayOfString1 = akinds).length;
        for (str1 = 0; str1 < i; str1++)
        {
          kind = arrayOfString1[str1];
          connectorDescriptor.getKind().add(ConnectorDescriptorKind.fromValue(kind));
        }
      }
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_value_kind);
    }
    connectorDescriptor.setName(element.getAttribute("name"));
    connectorDescriptor.setProvider(element.getAttribute("provider"));
    connectorDescriptor.setLicense(element.getAttribute("license"));
    connectorDescriptor.setDescription(element.getAttribute("description"));
    connectorDescriptor.setSiteUrl(element.getAttribute("siteUrl"));
    connectorDescriptor.setId(element.getAttribute("id"));
    connectorDescriptor.setCategoryId(element.getAttribute("categoryId"));
    connectorDescriptor.setCertificationId(element.getAttribute("certificationId"));
    connectorDescriptor.setPlatformFilter(element.getAttribute("platformFilter"));
    connectorDescriptor.setGroupId(element.getAttribute("groupId"));
    connectorDescriptor.setStatsUrl(element.getAttribute("statsUrl"));
    
    IConfigurationElement[] children = element.getChildren("iu");
    IConfigurationElement[] arrayOfIConfigurationElement1;
    if (children.length > 0)
    {
      str1 = (arrayOfIConfigurationElement1 = children).length;
      for (kind = 0; kind < str1; kind++)
      {
        IConfigurationElement child = arrayOfIConfigurationElement1[kind];
        connectorDescriptor.getInstallableUnits().add(getFeatureId(child.getAttribute("id")));
      }
    }
    else
    {
      connectorDescriptor.getInstallableUnits().add(getFeatureId(connectorDescriptor.getId()));
    }
    String str2 = (arrayOfIConfigurationElement1 = element.getChildren("attribute")).length;
    for (String kind = 0; kind < str2; kind++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement1[kind];
      readAttribute(child, connectorDescriptor.getAttributes());
    }
    String str3 = (arrayOfIConfigurationElement1 = element.getChildren("featureFilter")).length;
    for (kind = 0; kind < str3; kind++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement1[kind];
      FeatureFilter featureFilterItem = readFeatureFilter(child);
      featureFilterItem.setConnectorDescriptor(connectorDescriptor);
      connectorDescriptor.getFeatureFilter().add(featureFilterItem);
    }
    String str4 = (arrayOfIConfigurationElement1 = element.getChildren("icon")).length;
    for (kind = 0; kind < str4; kind++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement1[kind];
      Icon iconItem = readIcon(child);
      if (connectorDescriptor.getIcon() != null) {
        throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_element_icon);
      }
      connectorDescriptor.setIcon(iconItem);
    }
    String str5 = (arrayOfIConfigurationElement1 = element.getChildren("overview")).length;
    for (kind = 0; kind < str5; kind++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement1[kind];
      Overview overviewItem = readOverview(child);
      overviewItem.setConnectorDescriptor(connectorDescriptor);
      if (connectorDescriptor.getOverview() != null) {
        throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_element_overview);
      }
      connectorDescriptor.setOverview(overviewItem);
    }
    connectorDescriptor.validate();
    
    return connectorDescriptor;
  }
  
  private void readAttribute(IConfigurationElement element, Map<String, String> attributes)
  {
    attributes.put(element.getAttribute("key"), element.getAttribute("value"));
  }
  
  private String getFeatureId(String id)
  {
    if (!id.endsWith(".feature.group")) {
      return id + ".feature.group";
    }
    return id;
  }
  
  public ConnectorCategory readConnectorCategory(IConfigurationElement element)
    throws ValidationException
  {
    return readConnectorCategory(element, ConnectorCategory.class);
  }
  
  public <T extends ConnectorCategory> T readConnectorCategory(IConfigurationElement element, Class<T> clazz)
    throws ValidationException
  {
    try
    {
      connectorCategory = (ConnectorCategory)clazz.newInstance();
    }
    catch (Exception e)
    {
      T connectorCategory;
      throw new IllegalStateException(e);
    }
    T connectorCategory;
    connectorCategory.setId(element.getAttribute("id"));
    connectorCategory.setName(element.getAttribute("name"));
    connectorCategory.setDescription(element.getAttribute("description"));
    connectorCategory.setRelevance(element.getAttribute("relevance"));
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = element.getChildren("icon")).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement[i];
      Icon iconItem = readIcon(child);
      if (connectorCategory.getIcon() != null) {
        throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_element_icon);
      }
      connectorCategory.setIcon(iconItem);
    }
    j = (arrayOfIConfigurationElement = element.getChildren("overview")).length;
    for (i = 0; i < j; i++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement[i];
      Overview overviewItem = readOverview(child);
      overviewItem.setConnectorCategory(connectorCategory);
      if (connectorCategory.getOverview() != null) {
        throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_element_overview);
      }
      connectorCategory.setOverview(overviewItem);
    }
    j = (arrayOfIConfigurationElement = element.getChildren("group")).length;
    for (i = 0; i < j; i++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement[i];
      Group groupItem = readGroup(child);
      groupItem.setConnectorCategory(connectorCategory);
      connectorCategory.getGroup().add(groupItem);
    }
    connectorCategory.validate();
    
    return connectorCategory;
  }
  
  public <T extends Certification> T readCertification(IConfigurationElement element, Class<T> clazz)
    throws ValidationException
  {
    try
    {
      certification = (Certification)clazz.newInstance();
    }
    catch (Exception e)
    {
      T certification;
      throw new IllegalStateException(e);
    }
    T certification;
    certification.setId(element.getAttribute("id"));
    certification.setName(element.getAttribute("name"));
    certification.setUrl(element.getAttribute("url"));
    IConfigurationElement[] arrayOfIConfigurationElement;
    int j = (arrayOfIConfigurationElement = element.getChildren("icon")).length;
    for (int i = 0; i < j; i++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement[i];
      Icon iconItem = readIcon(child);
      if (certification.getIcon() != null) {
        throw new ValidationException(Messages.ConnectorDiscoveryExtensionReader_unexpected_element_icon);
      }
      certification.setIcon(iconItem);
    }
    j = (arrayOfIConfigurationElement = element.getChildren("description")).length;
    for (i = 0; i < j; i++)
    {
      IConfigurationElement child = arrayOfIConfigurationElement[i];
      certification.setDescription(child.getValue());
    }
    certification.validate();
    
    return certification;
  }
  
  public Icon readIcon(IConfigurationElement element)
    throws ValidationException
  {
    Icon icon = new Icon();
    
    icon.setImage16(element.getAttribute("image16"));
    icon.setImage32(element.getAttribute("image32"));
    icon.setImage48(element.getAttribute("image48"));
    icon.setImage64(element.getAttribute("image64"));
    icon.setImage128(element.getAttribute("image128"));
    
    icon.validate();
    
    return icon;
  }
  
  public Overview readOverview(IConfigurationElement element)
    throws ValidationException
  {
    Overview overview = new Overview();
    
    overview.setSummary(element.getAttribute("summary"));
    overview.setUrl(element.getAttribute("url"));
    overview.setScreenshot(element.getAttribute("screenshot"));
    
    overview.validate();
    
    return overview;
  }
  
  public FeatureFilter readFeatureFilter(IConfigurationElement element)
    throws ValidationException
  {
    FeatureFilter featureFilter = new FeatureFilter();
    
    featureFilter.setFeatureId(element.getAttribute("featureId"));
    featureFilter.setVersion(element.getAttribute("version"));
    
    featureFilter.validate();
    
    return featureFilter;
  }
  
  public Group readGroup(IConfigurationElement element)
    throws ValidationException
  {
    Group group = new Group();
    
    group.setId(element.getAttribute("id"));
    
    group.validate();
    
    return group;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.ConnectorDiscoveryExtensionReader
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public class DiscoveryCertification
  extends Certification
{
  private AbstractDiscoverySource source;
  
  public AbstractDiscoverySource getSource()
  {
    return source;
  }
  
  public void setSource(AbstractDiscoverySource source)
  {
    this.source = source;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DiscoveryCertification
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.util.ArrayList;
import java.util.List;

public class DiscoveryCategory
  extends ConnectorCategory
{
  private AbstractDiscoverySource source;
  private final List<DiscoveryConnector> connectors = new ArrayList();
  
  public List<DiscoveryConnector> getConnectors()
  {
    return connectors;
  }
  
  public AbstractDiscoverySource getSource()
  {
    return source;
  }
  
  public void setSource(AbstractDiscoverySource source)
  {
    this.source = source;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.DiscoveryCategory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ConnectorDescriptor
{
  protected List<ConnectorDescriptorKind> kind = new ArrayList();
  protected String name;
  protected String provider;
  protected String license;
  protected String description;
  protected String siteUrl;
  protected String id;
  protected String categoryId;
  protected String platformFilter;
  protected String groupId;
  protected String statsUrl;
  protected List<FeatureFilter> featureFilter = new ArrayList();
  protected List<String> installableUnits = new ArrayList();
  protected Icon icon;
  protected Overview overview;
  protected String certificationId;
  protected boolean installed;
  private final Map<String, String> attributes = new HashMap();
  
  public List<ConnectorDescriptorKind> getKind()
  {
    return kind;
  }
  
  public void setKind(List<ConnectorDescriptorKind> kind)
  {
    this.kind = kind;
  }
  
  public String getName()
  {
    return name;
  }
  
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String getProvider()
  {
    return provider;
  }
  
  public void setProvider(String provider)
  {
    this.provider = provider;
  }
  
  public String getLicense()
  {
    return license;
  }
  
  public void setLicense(String license)
  {
    this.license = license;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public void setDescription(String description)
  {
    this.description = description;
  }
  
  public String getSiteUrl()
  {
    return siteUrl;
  }
  
  public void setSiteUrl(String siteUrl)
  {
    this.siteUrl = siteUrl;
  }
  
  public String getId()
  {
    return id;
  }
  
  public void setId(String id)
  {
    this.id = id;
  }
  
  public String getCategoryId()
  {
    return categoryId;
  }
  
  public void setCategoryId(String categoryId)
  {
    this.categoryId = categoryId;
  }
  
  public String getCertificationId()
  {
    return certificationId;
  }
  
  public void setCertificationId(String certificationId)
  {
    this.certificationId = certificationId;
  }
  
  public String getPlatformFilter()
  {
    return platformFilter;
  }
  
  public void setPlatformFilter(String platformFilter)
  {
    this.platformFilter = platformFilter;
  }
  
  public String getGroupId()
  {
    return groupId;
  }
  
  public void setGroupId(String groupId)
  {
    this.groupId = groupId;
  }
  
  public List<FeatureFilter> getFeatureFilter()
  {
    return featureFilter;
  }
  
  public void setFeatureFilter(List<FeatureFilter> featureFilter)
  {
    this.featureFilter = featureFilter;
  }
  
  public Icon getIcon()
  {
    return icon;
  }
  
  public void setIcon(Icon icon)
  {
    this.icon = icon;
  }
  
  public Overview getOverview()
  {
    return overview;
  }
  
  public void setOverview(Overview overview)
  {
    this.overview = overview;
  }
  
  public void validate()
    throws ValidationException
  {
    if ((kind == null) || (kind.isEmpty())) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_kind);
    }
    if ((name == null) || (name.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_name);
    }
    if ((provider == null) || (provider.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_provider);
    }
    if ((license == null) || (license.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_license);
    }
    if ((siteUrl == null) || (siteUrl.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_siteUrl);
    }
    try
    {
      new URL(siteUrl);
    }
    catch (MalformedURLException localMalformedURLException)
    {
      throw new ValidationException(Messages.ConnectorDescriptor_invalid_connectorDescriptor_siteUrl);
    }
    if ((id == null) || (id.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_id);
    }
    if ((categoryId == null) || (categoryId.length() == 0)) {
      throw new ValidationException(Messages.ConnectorDescriptor_must_specify_connectorDescriptor_categoryId);
    }
    for (FeatureFilter featureFilterItem : featureFilter) {
      featureFilterItem.validate();
    }
    if (icon != null) {
      icon.validate();
    }
    if (overview != null) {
      overview.validate();
    }
  }
  
  public List<String> getInstallableUnits()
  {
    return installableUnits;
  }
  
  public void setInstallableUnits(List<String> installableUnits)
  {
    this.installableUnits = installableUnits;
  }
  
  public boolean isInstalled()
  {
    return installed;
  }
  
  public void setInstalled(boolean installed)
  {
    this.installed = installed;
  }
  
  public String getStatsUrl()
  {
    return statsUrl;
  }
  
  public void setStatsUrl(String statsUrl)
  {
    this.statsUrl = statsUrl;
  }
  
  public Map<String, String> getAttributes()
  {
    return attributes;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.ConnectorDescriptor
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;

class ConnectorDiscovery$1
  implements ISafeRunnable
{
  ConnectorDiscovery$1(ConnectorDiscovery paramConnectorDiscovery, AbstractDiscoveryStrategy paramAbstractDiscoveryStrategy) {}
  
  public void run()
    throws Exception
  {
    val$strategy.dispose();
  }
  
  public void handleException(Throwable exception)
  {
    StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", 
      Messages.ConnectorDiscovery_exception_disposing + val$strategy.getClass().getName(), exception));
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.ConnectorDiscovery.1
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.util.ArrayList;
import java.util.List;

public class Directory
{
  public static final class Entry
  {
    private String location;
    private boolean permitCategories;
    
    public String getLocation()
    {
      return location;
    }
    
    public void setLocation(String location)
    {
      this.location = location;
    }
    
    public boolean isPermitCategories()
    {
      return permitCategories;
    }
    
    public void setPermitCategories(boolean permitCategories)
    {
      this.permitCategories = permitCategories;
    }
  }
  
  private final List<Entry> entries = new ArrayList();
  
  public List<Entry> getEntries()
  {
    return entries;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.Directory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;

public class JarDiscoverySource
  extends AbstractDiscoverySource
{
  private final String id;
  private final File jarFile;
  
  public JarDiscoverySource(String id, File jarFile)
  {
    this.id = id;
    this.jarFile = jarFile;
  }
  
  public Object getId()
  {
    return id;
  }
  
  public URL getResource(String resourceName)
  {
    try
    {
      String prefix = jarFile.toURI().toURL().toExternalForm();
      
      return new URL("jar:" + prefix + "!/" + URLEncoder.encode(resourceName, "utf-8"));
    }
    catch (MalformedURLException e)
    {
      throw new IllegalStateException(e);
    }
    catch (UnsupportedEncodingException e)
    {
      throw new IllegalStateException(e);
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.JarDiscoverySource
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

public class Overview
{
  protected String summary;
  protected String url;
  protected String screenshot;
  protected ConnectorDescriptor connectorDescriptor;
  protected ConnectorCategory connectorCategory;
  
  public String getSummary()
  {
    return summary;
  }
  
  public void setSummary(String summary)
  {
    this.summary = summary;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public void setUrl(String url)
  {
    this.url = url;
  }
  
  public String getScreenshot()
  {
    return screenshot;
  }
  
  public void setScreenshot(String screenshot)
  {
    this.screenshot = screenshot;
  }
  
  public ConnectorDescriptor getConnectorDescriptor()
  {
    return connectorDescriptor;
  }
  
  public void setConnectorDescriptor(ConnectorDescriptor connectorDescriptor)
  {
    this.connectorDescriptor = connectorDescriptor;
  }
  
  public ConnectorCategory getConnectorCategory()
  {
    return connectorCategory;
  }
  
  public void setConnectorCategory(ConnectorCategory connectorCategory)
  {
    this.connectorCategory = connectorCategory;
  }
  
  public void validate()
    throws ValidationException
  {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.Overview
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.mylyn.internal.discovery.core.model;

import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Dictionary;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.CoreUtil;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.discovery.core.util.WebUtil;
import org.eclipse.osgi.service.resolver.VersionRange;
import org.eclipse.osgi.util.NLS;
import org.osgi.framework.Bundle;
import org.osgi.framework.Filter;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.InvalidSyntaxException;
import org.osgi.framework.Version;

public class ConnectorDiscovery
{
  private List<DiscoveryConnector> connectors = Collections.emptyList();
  private List<DiscoveryCategory> categories = Collections.emptyList();
  private List<DiscoveryCertification> certifications = Collections.emptyList();
  private List<DiscoveryConnector> filteredConnectors = Collections.emptyList();
  private final List<AbstractDiscoveryStrategy> discoveryStrategies = new ArrayList();
  private Dictionary<Object, Object> environment = System.getProperties();
  private boolean verifyUpdateSiteAvailability = false;
  private Map<String, Version> featureToVersion = null;
  
  public List<AbstractDiscoveryStrategy> getDiscoveryStrategies()
  {
    return discoveryStrategies;
  }
  
  /* Error */
  public IStatus performDiscovery(IProgressMonitor monitor)
  {
    // Byte code:
    //   0: new 223	org/eclipse/core/runtime/MultiStatus
    //   3: dup
    //   4: ldc 4
    //   6: iconst_0
    //   7: getstatic 451	org/eclipse/mylyn/internal/discovery/core/model/Messages:ConnectorDiscovery_Failed_to_discovery_all_Error	Ljava/lang/String;
    //   10: aconst_null
    //   11: invokespecial 484	org/eclipse/core/runtime/MultiStatus:<init>	(Ljava/lang/String;ILjava/lang/String;Ljava/lang/Throwable;)V
    //   14: astore_2
    //   15: aload_0
    //   16: getfield 448	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:discoveryStrategies	Ljava/util/List;
    //   19: invokeinterface 534 1 0
    //   24: ifeq +11 -> 35
    //   27: new 198	java/lang/IllegalStateException
    //   30: dup
    //   31: invokespecial 462	java/lang/IllegalStateException:<init>	()V
    //   34: athrow
    //   35: aload_0
    //   36: new 205	java/util/ArrayList
    //   39: dup
    //   40: invokespecial 474	java/util/ArrayList:<init>	()V
    //   43: putfield 447	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:connectors	Ljava/util/List;
    //   46: aload_0
    //   47: new 205	java/util/ArrayList
    //   50: dup
    //   51: invokespecial 474	java/util/ArrayList:<init>	()V
    //   54: putfield 449	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:filteredConnectors	Ljava/util/List;
    //   57: aload_0
    //   58: new 205	java/util/ArrayList
    //   61: dup
    //   62: invokespecial 474	java/util/ArrayList:<init>	()V
    //   65: putfield 445	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:categories	Ljava/util/List;
    //   68: aload_0
    //   69: new 205	java/util/ArrayList
    //   72: dup
    //   73: invokespecial 474	java/util/ArrayList:<init>	()V
    //   76: putfield 446	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:certifications	Ljava/util/List;
    //   79: aload_1
    //   80: getstatic 456	org/eclipse/mylyn/internal/discovery/core/model/Messages:ConnectorDiscovery_task_discovering_connectors	Ljava/lang/String;
    //   83: ldc 2
    //   85: invokeinterface 553 3 0
    //   90: aload_0
    //   91: getfield 448	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:discoveryStrategies	Ljava/util/List;
    //   94: invokeinterface 537 1 0
    //   99: astore 4
    //   101: goto +96 -> 197
    //   104: aload 4
    //   106: invokeinterface 532 1 0
    //   111: checkcast 232	org/eclipse/mylyn/internal/discovery/core/model/AbstractDiscoveryStrategy
    //   114: astore_3
    //   115: aload_3
    //   116: aload_0
    //   117: getfield 445	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:categories	Ljava/util/List;
    //   120: invokevirtual 493	org/eclipse/mylyn/internal/discovery/core/model/AbstractDiscoveryStrategy:setCategories	(Ljava/util/List;)V
    //   123: aload_3
    //   124: aload_0
    //   125: getfield 447	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:connectors	Ljava/util/List;
    //   128: invokevirtual 495	org/eclipse/mylyn/internal/discovery/core/model/AbstractDiscoveryStrategy:setConnectors	(Ljava/util/List;)V
    //   131: aload_3
    //   132: aload_0
    //   133: getfield 446	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:certifications	Ljava/util/List;
    //   136: invokevirtual 494	org/eclipse/mylyn/internal/discovery/core/model/AbstractDiscoveryStrategy:setCertifications	(Ljava/util/List;)V
    //   139: aload_3
    //   140: new 228	org/eclipse/core/runtime/SubProgressMonitor
    //   143: dup
    //   144: aload_1
    //   145: ldc 1
    //   147: aload_0
    //   148: getfield 448	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:discoveryStrategies	Ljava/util/List;
    //   151: invokeinterface 533 1 0
    //   156: idiv
    //   157: invokespecial 489	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   160: invokevirtual 496	org/eclipse/mylyn/internal/discovery/core/model/AbstractDiscoveryStrategy:performDiscovery	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   163: goto +34 -> 197
    //   166: astore 5
    //   168: aload_2
    //   169: new 227	org/eclipse/core/runtime/Status
    //   172: dup
    //   173: iconst_4
    //   174: ldc 4
    //   176: getstatic 452	org/eclipse/mylyn/internal/discovery/core/model/Messages:ConnectorDiscovery_Strategy_failed_Error	Ljava/lang/String;
    //   179: aload_3
    //   180: invokevirtual 465	java/lang/Object:getClass	()Ljava/lang/Class;
    //   183: invokevirtual 460	java/lang/Class:getSimpleName	()Ljava/lang/String;
    //   186: invokestatic 526	org/eclipse/osgi/util/NLS:bind	(Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/String;
    //   189: aload 5
    //   191: invokespecial 488	org/eclipse/core/runtime/Status:<init>	(ILjava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)V
    //   194: invokevirtual 483	org/eclipse/core/runtime/MultiStatus:add	(Lorg/eclipse/core/runtime/IStatus;)V
    //   197: aload 4
    //   199: invokeinterface 531 1 0
    //   204: ifne -100 -> 104
    //   207: aload_0
    //   208: invokespecial 499	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:filterDescriptors	()V
    //   211: aload_0
    //   212: getfield 443	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:verifyUpdateSiteAvailability	Z
    //   215: ifeq +18 -> 233
    //   218: aload_0
    //   219: new 228	org/eclipse/core/runtime/SubProgressMonitor
    //   222: dup
    //   223: aload_1
    //   224: sipush 10000
    //   227: invokespecial 489	org/eclipse/core/runtime/SubProgressMonitor:<init>	(Lorg/eclipse/core/runtime/IProgressMonitor;I)V
    //   230: invokevirtual 501	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:verifySiteAvailability	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   233: aload_0
    //   234: invokespecial 497	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:connectCategoriesToDescriptors	()V
    //   237: aload_0
    //   238: invokespecial 498	org/eclipse/mylyn/internal/discovery/core/model/ConnectorDiscovery:connectCertificationsToDescriptors	()V
    //   241: goto +14 -> 255
    //   244: astore 6
    //   246: aload_1
    //   247: invokeinterface 549 1 0
    //   252: aload 6
    //   254: athrow
    //   255: aload_1
    //   256: invokeinterface 549 1 0
    //   261: aload_2
    //   262: areturn
    // Line number table:
    //   Java source line #95	-> byte code offset #0
    //   Java source line #96	-> byte code offset #7
    //   Java source line #95	-> byte code offset #11
    //   Java source line #97	-> byte code offset #15
    //   Java source line #98	-> byte code offset #27
    //   Java source line #100	-> byte code offset #35
    //   Java source line #101	-> byte code offset #46
    //   Java source line #102	-> byte code offset #57
    //   Java source line #103	-> byte code offset #68
    //   Java source line #108	-> byte code offset #79
    //   Java source line #110	-> byte code offset #90
    //   Java source line #111	-> byte code offset #115
    //   Java source line #112	-> byte code offset #123
    //   Java source line #113	-> byte code offset #131
    //   Java source line #115	-> byte code offset #139
    //   Java source line #116	-> byte code offset #147
    //   Java source line #115	-> byte code offset #160
    //   Java source line #117	-> byte code offset #166
    //   Java source line #118	-> byte code offset #168
    //   Java source line #119	-> byte code offset #176
    //   Java source line #120	-> byte code offset #183
    //   Java source line #118	-> byte code offset #186
    //   Java source line #120	-> byte code offset #189
    //   Java source line #118	-> byte code offset #194
    //   Java source line #110	-> byte code offset #197
    //   Java source line #124	-> byte code offset #207
    //   Java source line #125	-> byte code offset #211
    //   Java source line #126	-> byte code offset #218
    //   Java source line #128	-> byte code offset #233
    //   Java source line #129	-> byte code offset #237
    //   Java source line #130	-> byte code offset #244
    //   Java source line #131	-> byte code offset #246
    //   Java source line #132	-> byte code offset #252
    //   Java source line #131	-> byte code offset #255
    //   Java source line #133	-> byte code offset #261
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	263	0	this	ConnectorDiscovery
    //   0	263	1	monitor	IProgressMonitor
    //   14	248	2	status	org.eclipse.core.runtime.MultiStatus
    //   114	66	3	discoveryStrategy	AbstractDiscoveryStrategy
    //   99	99	4	localIterator	Iterator
    //   166	24	5	e	CoreException
    //   244	9	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   139	163	166	org/eclipse/core/runtime/CoreException
    //   90	244	244	finally
  }
  
  public List<DiscoveryCategory> getCategories()
  {
    return categories;
  }
  
  public List<DiscoveryConnector> getConnectors()
  {
    return connectors;
  }
  
  public List<DiscoveryConnector> getFilteredConnectors()
  {
    return filteredConnectors;
  }
  
  public Dictionary<Object, Object> getEnvironment()
  {
    return environment;
  }
  
  public void setEnvironment(Dictionary<Object, Object> environment)
  {
    if (environment == null) {
      throw new IllegalArgumentException();
    }
    this.environment = environment;
  }
  
  public boolean isVerifyUpdateSiteAvailability()
  {
    return verifyUpdateSiteAvailability;
  }
  
  public void setVerifyUpdateSiteAvailability(boolean verifyUpdateSiteAvailability)
  {
    this.verifyUpdateSiteAvailability = verifyUpdateSiteAvailability;
  }
  
  public Map<String, Version> getFeatureToVersion()
  {
    return featureToVersion;
  }
  
  public void setFeatureToVersion(Map<String, Version> featureToVersion)
  {
    this.featureToVersion = featureToVersion;
  }
  
  private void connectCertificationsToDescriptors()
  {
    Map<String, DiscoveryCertification> idToCertification = new HashMap();
    for (DiscoveryCertification certification : certifications)
    {
      DiscoveryCertification previous = (DiscoveryCertification)idToCertification.put(certification.getId(), certification);
      if (previous != null) {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
          "Duplicate certification id ''{0}'': declaring sources: {1}, {2}", 
          new Object[] { certification.getId(), certification.getSource().getId(), 
          previous.getSource().getId() })));
      }
    }
    for (DiscoveryConnector connector : connectors) {
      if (connector.getCertificationId() != null)
      {
        DiscoveryCertification certification = (DiscoveryCertification)idToCertification.get(connector.getCertificationId());
        if (certification != null) {
          connector.setCertification(certification);
        } else {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
            "Unknown category ''{0}'' referenced by connector ''{1}'' declared in {2}", new Object[] {
            connector.getCertificationId(), connector.getId(), connector.getSource().getId() })));
        }
      }
    }
  }
  
  private void connectCategoriesToDescriptors()
  {
    Map<String, DiscoveryCategory> idToCategory = new HashMap();
    for (DiscoveryCategory category : categories)
    {
      DiscoveryCategory previous = (DiscoveryCategory)idToCategory.put(category.getId(), category);
      if (previous != null) {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
          Messages.ConnectorDiscovery_duplicate_category_id, new Object[] { category.getId(), 
          category.getSource().getId(), previous.getSource().getId() })));
      }
    }
    for (DiscoveryConnector connector : connectors)
    {
      DiscoveryCategory category = (DiscoveryCategory)idToCategory.get(connector.getCategoryId());
      if (category != null)
      {
        category.getConnectors().add(connector);
        connector.setCategory(category);
      }
      else
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
          Messages.ConnectorDiscovery_bundle_references_unknown_category, 
          new Object[] { connector
1 2 3 4 5

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd