Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.update.search
Class UpdateSearchRequest  view UpdateSearchRequest download UpdateSearchRequest.java

java.lang.Object
  extended byorg.eclipse.update.search.UpdateSearchRequest

public class UpdateSearchRequest
extends java.lang.Object

This class is central to update search. The search pattern is encapsulated in update search category, while the search scope is defined in the scope object. When these two objects are defined and set, search can be performed using the provided method. Search results are reported to the result collector, while search progress is tracked using the progress monitor.

Classes that implement IUpdateSearchResultCollector should call 'filter' to test if the match should be accepted according to the filters added to the request.

Note: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.

Since:
3.0

Nested Class Summary
(package private)  class UpdateSearchRequest.AggregateFilter
           
 
Field Summary
private  UpdateSearchRequest.AggregateFilter aggregateFilter
           
private  IUpdateSearchCategory category
           
private  UpdateSearchScope scope
           
private  boolean searchInProgress
           
 
Constructor Summary
UpdateSearchRequest(IUpdateSearchCategory category, UpdateSearchScope scope)
          The constructor that accepts the search category and scope objects.
 
Method Summary
 void addFilter(IUpdateSearchFilter filter)
          Adds a filter to this request.
 IUpdateSearchCategory getCategory()
          Returns the search catagory used in this request.
private  IUpdateSiteAdapter getMappedSite(org.eclipse.update.internal.search.UpdatePolicy policy, IQueryUpdateSiteAdapter qsite)
           
 UpdateSearchScope getScope()
          Returns the scope of this search request.
 boolean isSearchInProgress()
          Tests whether this search request is current running.
private  org.eclipse.core.runtime.IStatus loadUpdatePolicy(org.eclipse.update.internal.search.UpdatePolicy map, java.net.URL url, org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void performSearch(IUpdateSearchResultCollector collector, org.eclipse.core.runtime.IProgressMonitor monitor)
          Runs the search using the category and scope configured into this request.
 void removeFilter(IUpdateSearchFilter filter)
          Removes the filter from this request.
private  org.eclipse.core.runtime.IStatus searchOneSite(IUpdateSiteAdapter siteAdapter, java.lang.String[] categoriesToSkip, IUpdateSearchQuery query, IUpdateSearchResultCollector collector, org.eclipse.core.runtime.SubProgressMonitor monitor)
           
 void setScope(UpdateSearchScope scope)
          Sets the scope object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

category

private IUpdateSearchCategory category

scope

private UpdateSearchScope scope

searchInProgress

private boolean searchInProgress

aggregateFilter

private UpdateSearchRequest.AggregateFilter aggregateFilter
Constructor Detail

UpdateSearchRequest

public UpdateSearchRequest(IUpdateSearchCategory category,
                           UpdateSearchScope scope)
The constructor that accepts the search category and scope objects.

Method Detail

getCategory

public IUpdateSearchCategory getCategory()
Returns the search catagory used in this request.


getScope

public UpdateSearchScope getScope()
Returns the scope of this search request.


addFilter

public void addFilter(IUpdateSearchFilter filter)
Adds a filter to this request. This method does nothing if search is alrady in progress.


removeFilter

public void removeFilter(IUpdateSearchFilter filter)
Removes the filter from this request. This method does nothing if search is alrady in progress.


setScope

public void setScope(UpdateSearchScope scope)
Sets the scope object. It is possible to reuse the search request object by modifying the scope and re-running the search.


isSearchInProgress

public boolean isSearchInProgress()
Tests whether this search request is current running.


performSearch

public void performSearch(IUpdateSearchResultCollector collector,
                          org.eclipse.core.runtime.IProgressMonitor monitor)
                   throws org.eclipse.core.runtime.CoreException
Runs the search using the category and scope configured into this request. As results arrive, they are passed to the search result collector object.


loadUpdatePolicy

private org.eclipse.core.runtime.IStatus loadUpdatePolicy(org.eclipse.update.internal.search.UpdatePolicy map,
                                                          java.net.URL url,
                                                          org.eclipse.core.runtime.IProgressMonitor monitor)
                                                   throws org.eclipse.core.runtime.CoreException

getMappedSite

private IUpdateSiteAdapter getMappedSite(org.eclipse.update.internal.search.UpdatePolicy policy,
                                         IQueryUpdateSiteAdapter qsite)

searchOneSite

private org.eclipse.core.runtime.IStatus searchOneSite(IUpdateSiteAdapter siteAdapter,
                                                       java.lang.String[] categoriesToSkip,
                                                       IUpdateSearchQuery query,
                                                       IUpdateSearchResultCollector collector,
                                                       org.eclipse.core.runtime.SubProgressMonitor monitor)
                                                throws org.eclipse.core.runtime.CoreException