1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 12 package org.eclipse.update.search; 13 14 import org.eclipse.core.runtime.OperationCanceledException; 15 import org.eclipse.update.core.ISiteWithMirrors; 16 import org.eclipse.update.core.IURLEntry; 17 18 /** 19 * Search results are collected by implementing this interface 20 * and passing it to the search request. If the implementation is 21 * visual, it is recommended that the match is shown as soon 22 * as it is collected (rather than kept in a list and presented 23 * at the end of the search). This interface should be implemented 24 * when you want to support collection of results from a mirror site, 25 * otherwise you can just implement the IUpdateSearchResultsCollector. 26 * <p> 27 * <b>Note:</b> This class/interface is part of an interim API that is still under development and expected to 28 * change significantly before reaching stability. It is being made available at this early stage to solicit feedback 29 * from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken 30 * (repeatedly) as the API evolves. 31 * </p> 32 * @since 3.1 33 */ 34 public interface IUpdateSearchResultCollectorFromMirror extends 35 IUpdateSearchResultCollector { 36 37 /** 38 * Returns a mirror of the specified site. Normally, if the site defines some mirrors, 39 * this method can be implement so that it prompts the user to pick one of the mirrors. 40 * @param site the site to get the mirror for 41 * @param siteName the name of the site 42 * @return a mirror (url+label) for the specified site, or null if no mirror is needed 43 * @throws OperationCanceledException if the user chooses to cancel 44 * the prompt instead of choosing the mirror from the list. 45 */ 46 public IURLEntry getMirror(ISiteWithMirrors site, String siteName) throws OperationCanceledException; 47 } 48