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

.getCategoryId(), connector.getId(), connector.getSource().getId() })));
      }
    }
  }
  
  private void filterDescriptors()
  {
    for (DiscoveryConnector connector : new ArrayList(connectors))
    {
      Filter filter;
      if ((connector.getPlatformFilter() != null) && (connector.getPlatformFilter().trim().length() > 0))
      {
        boolean match = false;
        try
        {
          filter = FrameworkUtil.createFilter(connector.getPlatformFilter());
          match = filter.match(environment);
        }
        catch (InvalidSyntaxException localInvalidSyntaxException)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
            Messages.ConnectorDiscovery_illegal_filter_syntax, 
            new Object[] { connector.getPlatformFilter(), connector.getId(), 
            connector.getSource().getId() })));
        }
        if (!match)
        {
          connectors.remove(connector);
          filteredConnectors.add(connector);
        }
      }
      for (FeatureFilter featureFilter : connector.getFeatureFilter())
      {
        if (featureToVersion == null) {
          featureToVersion = computeFeatureToVersion();
        }
        boolean match = false;
        Version version = (Version)featureToVersion.get(featureFilter.getFeatureId());
        if (version != null)
        {
          VersionRange versionRange = new VersionRange(featureFilter.getVersion());
          if (versionRange.isIncluded(version)) {
            match = true;
          }
        }
        if (!match)
        {
          connectors.remove(connector);
          filteredConnectors.add(connector);
          break;
        }
      }
    }
  }
  
  private Map<String, Version> computeFeatureToVersion()
  {
    Map<String, Version> featureToVersion = new HashMap();
    IBundleGroupProvider[] arrayOfIBundleGroupProvider;
    int j = (arrayOfIBundleGroupProvider = Platform.getBundleGroupProviders()).length;
    for (int i = 0; i < j; i++)
    {
      IBundleGroupProvider provider = arrayOfIBundleGroupProvider[i];
      IBundleGroup[] arrayOfIBundleGroup;
      int m = (arrayOfIBundleGroup = provider.getBundleGroups()).length;
      for (int k = 0; k < m; k++)
      {
        IBundleGroup bundleGroup = arrayOfIBundleGroup[k];
        Bundle[] arrayOfBundle;
        int i1 = (arrayOfBundle = bundleGroup.getBundles()).length;
        for (int n = 0; n < i1; n++)
        {
          Bundle bundle = arrayOfBundle[n];
          featureToVersion.put(bundle.getSymbolicName(), CoreUtil.getVersion(bundle));
        }
      }
    }
    return featureToVersion;
  }
  
  public void verifySiteAvailability(IProgressMonitor monitor)
  {
    Map<String, Collection<DiscoveryConnector>> urlToDescriptors = new HashMap();
    for (DiscoveryConnector descriptor : connectors) {
      if (descriptor.isInstallable())
      {
        String url = descriptor.getSiteUrl();
        if (!url.endsWith("/")) {
          url = url + "/";
        }
        Collection<DiscoveryConnector> collection = (Collection)urlToDescriptors.get(url);
        if (collection == null)
        {
          collection = new ArrayList();
          urlToDescriptors.put(url, collection);
        }
        collection.add(descriptor);
      }
    }
    int totalTicks = urlToDescriptors.size();
    monitor.beginTask(Messages.ConnectorDiscovery_task_verifyingAvailability, totalTicks);
    try
    {
      if (!urlToDescriptors.isEmpty())
      {
        ExecutorService executorService = Executors.newFixedThreadPool(Math.min(urlToDescriptors.size(), 4));
        try
        {
          List<Future<VerifyUpdateSiteJob>> futures = new ArrayList(
            urlToDescriptors.size());
          for (String url : urlToDescriptors.keySet()) {
            futures.add(executorService.submit(new VerifyUpdateSiteJob(url)));
          }
          for (Future<VerifyUpdateSiteJob> jobFuture : futures) {
            try
            {
              for (;;)
              {
                try
                {
                  VerifyUpdateSiteJob job = (VerifyUpdateSiteJob)jobFuture.get(1L, TimeUnit.SECONDS);
                  
                  Collection<DiscoveryConnector> descriptors = (Collection)urlToDescriptors.get(url);
                  Iterator localIterator3 = descriptors.iterator(); continue;DiscoveryConnector descriptor = (DiscoveryConnector)localIterator3.next();
                  descriptor.setAvailable(Boolean.valueOf(ok));
                  if (localIterator3.hasNext()) {
                    continue;
                  }
                }
                catch (TimeoutException localTimeoutException) {}
                if (monitor.isCanceled())
                {
                  executorService.shutdownNow();return;
                }
              }
            }
            catch (InterruptedException localInterruptedException)
            {
              monitor.setCanceled(true);
              
              executorService.shutdownNow();return;
            }
            catch (ExecutionException e)
            {
              if ((e.getCause() instanceof OperationCanceledException))
              {
                monitor.setCanceled(true);
                
                executorService.shutdownNow(); return;
              }
              IStatus status;
              IStatus status;
              if ((e.getCause() instanceof CoreException)) {
                status = ((CoreException)e.getCause()).getStatus();
              } else {
                status = new Status(4, "org.eclipse.mylyn.discovery.core", 
                  Messages.ConnectorDiscovery_unexpected_exception, e.getCause());
              }
              StatusHandler.log(status);
              
              monitor.worked(1);
            }
          }
        }
        finally
        {
          executorService.shutdownNow();
        }
        executorService.shutdownNow();
      }
    }
    finally
    {
      monitor.done();
    }
    monitor.done();
  }
  
  private static class VerifyUpdateSiteJob
    implements Callable<VerifyUpdateSiteJob>
  {
    private final String url;
    private boolean ok = false;
    
    public VerifyUpdateSiteJob(String url)
    {
      this.url = url;
    }
    
    public VerifyUpdateSiteJob call()
      throws Exception
    {
      URL baseUrl = new URL(url);
      List<URI> locations = new ArrayList();
      String[] arrayOfString;
      int j = (arrayOfString = new String[] { "content.jar", "content.xml", "compositeContent.jar", "compositeContent.xml", "site.xml" }).length;
      for (int i = 0; i < j; i++)
      {
        String location = arrayOfString[i];
        locations.add(new URL(baseUrl, location).toURI());
      }
      ok = WebUtil.verifyAvailability(locations, true, new NullProgressMonitor());
      return this;
    }
  }
  
  public void dispose()
  {
    for (final AbstractDiscoveryStrategy strategy : discoveryStrategies) {
      SafeRunner.run(new ISafeRunnable()
      {
        public void run()
          throws Exception
        {
          strategy.dispose();
        }
        
        public void handleException(Throwable exception)
        {
          StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", 
            Messages.ConnectorDiscovery_exception_disposing + strategy.getClass().getName(), exception));
        }
      });
    }
  }
}

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

public class Certification
{
  protected String id;
  protected String name;
  protected String description;
  protected Icon icon;
  protected String url;
  
  public String getId()
  {
    return id;
  }
  
  public void setId(String id)
  {
    this.id = id;
  }
  
  public String getName()
  {
    return name;
  }
  
  public void setName(String name)
  {
    this.name = name;
  }
  
  public String getDescription()
  {
    return description;
  }
  
  public void setDescription(String description)
  {
    this.description = description;
  }
  
  public Icon getIcon()
  {
    return icon;
  }
  
  public void setIcon(Icon icon)
  {
    this.icon = icon;
  }
  
  public String getUrl()
  {
    return url;
  }
  
  public void setUrl(String url)
  {
    this.url = url;
  }
  
  public void validate()
    throws ValidationException
  {
    if ((id == null) || (id.length() == 0)) {
      throw new ValidationException(Messages.ConnectorCategory_must_specify_connectorCategory_id);
    }
    if ((name == null) || (name.length() == 0)) {
      throw new ValidationException(Messages.ConnectorCategory_must_specify_connectorCategory_name);
    }
    if (icon != null) {
      icon.validate();
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.Certification
 * 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.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.concurrent.Callable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.discovery.core.util.WebUtil;
import org.eclipse.osgi.util.NLS;

class RemoteBundleDiscoveryStrategy$DownloadBundleJob
  implements Callable<DownloadBundleJob>
{
  private final IProgressMonitor monitor;
  private final Directory.Entry entry;
  private File file;
  
  public RemoteBundleDiscoveryStrategy$DownloadBundleJob(RemoteBundleDiscoveryStrategy paramRemoteBundleDiscoveryStrategy, Directory.Entry entry, IProgressMonitor monitor)
  {
    this.entry = entry;
    this.monitor = monitor;
  }
  
  public DownloadBundleJob call()
  {
    String bundleUrl = entry.getLocation();
    for (int attemptCount = 0; attemptCount < RemoteBundleDiscoveryStrategy.access$0(this$0); attemptCount++)
    {
      try
      {
        if ((!bundleUrl.startsWith("http://")) && (!bundleUrl.startsWith("https://")))
        {
          StatusHandler.log(new Status(2, "org.eclipse.mylyn.discovery.core", NLS.bind(
            Messages.RemoteBundleDiscoveryStrategy_unrecognized_discovery_url, bundleUrl)));
        }
        else
        {
          String lastPathElement = bundleUrl.lastIndexOf('/') == -1 ? 
            bundleUrl : 
            bundleUrl.substring(bundleUrl.lastIndexOf('/'));
          File target = File.createTempFile(
            lastPathElement.replaceAll("^[a-zA-Z0-9_.]", "_") + "_", ".jar", RemoteBundleDiscoveryStrategy.access$1(this$0));
          if (monitor.isCanceled()) {
            break;
          }
          try
          {
            WebUtil.download(new URI(bundleUrl), target, new NullProgressMonitor()
            {
              public boolean isCanceled()
              {
                return (super.isCanceled()) || (monitor.isCanceled());
              }
            });
          }
          catch (URISyntaxException localURISyntaxException) {}
          file = target;
        }
      }
      catch (IOException e)
      {
        StatusHandler.log(new Status(4, "org.eclipse.mylyn.discovery.core", NLS.bind(
          Messages.RemoteBundleDiscoveryStrategy_cannot_download_bundle, bundleUrl, e.getMessage()), 
          e));
        if (!RemoteBundleDiscoveryStrategy.access$2(this$0, e)) {
          continue;
        }
      }
      break;
    }
    return this;
  }
}

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

import java.io.IOException;
import java.io.Reader;
import java.net.URI;
import org.eclipse.mylyn.internal.discovery.core.util.WebUtil.TextContentProcessor;

class RemoteBundleDiscoveryStrategy$1
  implements WebUtil.TextContentProcessor
{
  RemoteBundleDiscoveryStrategy$1(RemoteBundleDiscoveryStrategy paramRemoteBundleDiscoveryStrategy, URI paramURI, Directory[] paramArrayOfDirectory) {}
  
  public void process(Reader reader)
    throws IOException
  {
    DirectoryParser parser = new DirectoryParser();
    parser.setBaseUri(val$uri);
    val$temp[0] = parser.parse(reader);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.RemoteBundleDiscoveryStrategy.1
 * 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 org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract class AbstractDiscoveryStrategy
{
  protected List<DiscoveryCategory> categories;
  protected List<DiscoveryConnector> connectors;
  protected List<DiscoveryCertification> certifications;
  
  public abstract void performDiscovery(IProgressMonitor paramIProgressMonitor)
    throws CoreException;
  
  public List<DiscoveryCategory> getCategories()
  {
    return categories;
  }
  
  public void setCategories(List<DiscoveryCategory> categories)
  {
    this.categories = categories;
  }
  
  public List<DiscoveryConnector> getConnectors()
  {
    return connectors;
  }
  
  public void setConnectors(List<DiscoveryConnector> connectors)
  {
    this.connectors = connectors;
  }
  
  public List<DiscoveryCertification> getCertifications()
  {
    return certifications;
  }
  
  public void setCertifications(List<DiscoveryCertification> certifications)
  {
    this.certifications = certifications;
  }
  
  public void dispose() {}
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.model.AbstractDiscoveryStrategy
 * 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.CoreException;
import org.eclipse.core.runtime.Status;

public class ValidationException
  extends CoreException
{
  private static final long serialVersionUID = -7542361242327905294L;
  
  public ValidationException(String message)
  {
    super(new Status(4, "org.eclipse.mylyn.discovery.core", message));
  }
}

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

import org.eclipse.osgi.util.NLS;

class Messages
  extends NLS
{
  private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.discovery.core.model.messages";
  public static String BundleDiscoveryStrategy_3;
  public static String BundleDiscoveryStrategy_categoryDisallowed;
  public static String BundleDiscoveryStrategy_task_loading_local_extensions;
  public static String BundleDiscoveryStrategy_task_processing_extensions;
  public static String BundleDiscoveryStrategy_unexpected_element;
  public static String ConnectorCategory_connectorCategory_relevance_invalid;
  public static String ConnectorCategory_must_specify_connectorCategory_id;
  public static String ConnectorCategory_must_specify_connectorCategory_name;
  public static String ConnectorDescriptor_invalid_connectorDescriptor_siteUrl;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_categoryId;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_id;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_kind;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_license;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_name;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_provider;
  public static String ConnectorDescriptor_must_specify_connectorDescriptor_siteUrl;
  public static String ConnectorDiscovery_bundle_references_unknown_category;
  public static String ConnectorDiscovery_duplicate_category_id;
  public static String ConnectorDiscovery_exception_disposing;
  public static String ConnectorDiscovery_Failed_to_discovery_all_Error;
  public static String ConnectorDiscovery_illegal_filter_syntax;
  public static String ConnectorDiscovery_Strategy_failed_Error;
  public static String ConnectorDiscovery_task_discovering_connectors;
  public static String ConnectorDiscovery_task_verifyingAvailability;
  public static String ConnectorDiscovery_unexpected_exception;
  public static String ConnectorDiscoveryExtensionReader_unexpected_element_icon;
  public static String ConnectorDiscoveryExtensionReader_unexpected_element_overview;
  public static String ConnectorDiscoveryExtensionReader_unexpected_value_kind;
  public static String DirectoryParser_no_directory;
  public static String DirectoryParser_unexpected_element;
  public static String DiscoveryFeedbackJob_Job_Label;
  public static String DiscoveryRegistryStrategy_cannot_load_bundle;
  public static String DiscoveryRegistryStrategy_missing_pluginxml;
  public static String FeatureFilter_must_specify_featureFilter_featureId;
  public static String FeatureFilter_must_specify_featureFilter_version;
  public static String Group_must_specify_group_id;
  public static String RemoteBundleDiscoveryStrategy_cannot_download_bundle;
  public static String RemoteBundleDiscoveryStrategy_empty_directory;
  public static String RemoteBundleDiscoveryStrategy_io_failure_discovery_directory;
  public static String RemoteBundleDiscoveryStrategy_io_failure_temp_storage;
  public static String RemoteBundleDiscoveryStrategy_task_remote_discovery;
  public static String RemoteBundleDiscoveryStrategy_unexpectedError;
  public static String RemoteBundleDiscoveryStrategy_unknown_host_discovery_directory;
  public static String RemoteBundleDiscoveryStrategy_unrecognized_discovery_url;
  
  static
  {
    NLS.initializeMessages("org.eclipse.mylyn.internal.discovery.core.model.messages", Messages.class);
  }
}

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

public class Icon
{
  protected String image16;
  protected String image32;
  protected String image48;
  protected String image64;
  protected String image128;
  
  public String getImage16()
  {
    return image16;
  }
  
  public void setImage16(String image16)
  {
    this.image16 = image16;
  }
  
  public String getImage32()
  {
    return image32;
  }
  
  public void setImage32(String image32)
  {
    this.image32 = image32;
  }
  
  public String getImage48()
  {
    return image48;
  }
  
  public void setImage48(String image48)
  {
    this.image48 = image48;
  }
  
  public String getImage64()
  {
    return image64;
  }
  
  public void setImage64(String image64)
  {
    this.image64 = image64;
  }
  
  public String getImage128()
  {
    return image128;
  }
  
  public void setImage128(String image128)
  {
    this.image128 = image128;
  }
  
  public void validate()
    throws ValidationException
  {}
}

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

public class Group
{
  protected String id;
  protected ConnectorCategory connectorCategory;
  
  public String getId()
  {
    return id;
  }
  
  public void setId(String id)
  {
    this.id = id;
  }
  
  public ConnectorCategory getConnectorCategory()
  {
    return connectorCategory;
  }
  
  public void setConnectorCategory(ConnectorCategory connectorCategory)
  {
    this.connectorCategory = connectorCategory;
  }
  
  public void validate()
    throws ValidationException
  {
    if ((id == null) || (id.length() == 0)) {
      throw new ValidationException(Messages.Group_must_specify_group_id);
    }
  }
}

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

public abstract class DiscoveryCore
{
  public static final String ID_PLUGIN = "org.eclipse.mylyn.discovery.core";
}

/* Location:
 * Qualified Name:     org.eclipse.mylyn.internal.discovery.core.DiscoveryCore
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
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