View | Details | Raw Unified | Return to bug 256434 | Differences between
and this patch

Collapse All | Expand All

(-)META-INF/MANIFEST.MF (-2 / +5 lines)
Lines 50-56 Link Here
50
  x-friends:="org.eclipse.equinox.p2.touchpoint.eclipse,
50
  x-friends:="org.eclipse.equinox.p2.touchpoint.eclipse,
51
   org.eclipse.equinox.p2.touchpoint.natives,
51
   org.eclipse.equinox.p2.touchpoint.natives,
52
   org.eclipse.equinox.p2.extensionlocation,
52
   org.eclipse.equinox.p2.extensionlocation,
53
   org.eclipse.equinox.p2.updatesite"
53
   org.eclipse.equinox.p2.updatesite,
54
   org.eclipse.equinox.p2.directorywatcher"
54
Import-Package: javax.xml.parsers,
55
Import-Package: javax.xml.parsers,
55
 org.eclipse.core.runtime.jobs,
56
 org.eclipse.core.runtime.jobs,
56
 org.eclipse.equinox.app;version="1.0.0";resolution:=optional,
57
 org.eclipse.equinox.app;version="1.0.0";resolution:=optional,
Lines 64-69 Link Here
64
 org.eclipse.equinox.internal.provisional.p2.core.eventbus,
65
 org.eclipse.equinox.internal.provisional.p2.core.eventbus,
65
 org.eclipse.equinox.internal.provisional.p2.core.location,
66
 org.eclipse.equinox.internal.provisional.p2.core.location,
66
 org.eclipse.equinox.internal.provisional.p2.metadata,
67
 org.eclipse.equinox.internal.provisional.p2.metadata,
68
 org.eclipse.equinox.internal.provisional.p2.metadata.query,
67
 org.eclipse.equinox.internal.provisional.p2.repository,
69
 org.eclipse.equinox.internal.provisional.p2.repository,
68
 org.eclipse.equinox.internal.provisional.spi.p2.repository,
70
 org.eclipse.equinox.internal.provisional.spi.p2.repository,
69
 org.eclipse.equinox.p2.core,
71
 org.eclipse.equinox.p2.core,
Lines 81-85 Link Here
81
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
83
Bundle-RequiredExecutionEnvironment: J2SE-1.4,
82
 CDC-1.1/Foundation-1.1
84
 CDC-1.1/Foundation-1.1
83
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
85
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
84
 org.eclipse.equinox.registry
86
 org.eclipse.equinox.registry,
87
 org.eclipse.equinox.p2.metadata
85
Service-Component: OSGI-INF/repositoryManager.xml
88
Service-Component: OSGI-INF/repositoryManager.xml
(-)src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/ArtifactDescriptorQuery.java (+62 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 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.equinox.internal.provisional.p2.artifact.repository;
13
14
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
15
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
16
17
public class ArtifactDescriptorQuery extends MatchQuery implements IArtifactQuery {
18
	private VersionRange range = null;
19
	private String id = null;
20
	private String format = null;
21
	private IArtifactRepository repository = null;
22
23
	public ArtifactDescriptorQuery(String id, VersionRange versionRange, String format) {
24
		this(id, versionRange, format, null);
25
	}
26
27
	public ArtifactDescriptorQuery(String id, VersionRange versionRange, String format, IArtifactRepository repository) {
28
		this.id = id;
29
		this.range = versionRange;
30
		this.format = format;
31
		this.repository = repository;
32
	}
33
34
	public boolean isMatch(Object candidate) {
35
		if (!(candidate instanceof IArtifactDescriptor))
36
			return false;
37
38
		IArtifactDescriptor descriptor = (IArtifactDescriptor) candidate;
39
		if (id != null && !id.equals(descriptor.getArtifactKey().getId()))
40
			return false;
41
42
		if (range != null && !range.isIncluded(descriptor.getArtifactKey().getVersion()))
43
			return false;
44
45
		if (format != null && !format.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT)))
46
			return false;
47
48
		if (repository != null && repository != descriptor.getRepository())
49
			return false;
50
51
		return true;
52
	}
53
54
	public Boolean getAcceptArtifactDescriptors() {
55
		return Boolean.TRUE;
56
	}
57
58
	public Boolean getAcceptArtifactKeys() {
59
		return Boolean.FALSE;
60
	}
61
62
}
(-)src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/ArtifactIterator.java (+133 lines)
Added Link Here
1
/*******************************************************************************
2
 *  Copyright (c) 2009 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.equinox.internal.provisional.p2.artifact.repository;
13
14
import java.util.*;
15
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
16
17
/**
18
 * An iterator over an IArtifactRepository
19
 * Returns IArtifactKey's and IArtifactDescriptor's.  First a key is returned, 
20
 * then that key's descriptors, and again for the next key.
21
 */
22
public class ArtifactIterator implements Iterator {
23
	private final IArtifactRepository artifactRepository;
24
	private Iterator keys = null;
25
	private Iterator descriptors = null;
26
	private boolean returnKeys = false;
27
	private boolean returnDescriptors = false;
28
29
	/**
30
	 * @param artifactRepository - the artifact repository
31
	 * @param returnKeys - whether or not to include IArtifactKey's in the iteration
32
	 * @param returnDescriptors - whether or not to include IArtifactDescriptor's in the iteration
33
	 */
34
	public ArtifactIterator(IArtifactRepository artifactRepository, boolean returnKeys, boolean returnDescriptors) {
35
		this.artifactRepository = artifactRepository;
36
		this.returnDescriptors = returnDescriptors;
37
		this.returnKeys = returnKeys;
38
39
		//initialize the key interator
40
		keys = Arrays.asList(artifactRepository.getArtifactKeys()).iterator();
41
	}
42
43
	/**
44
	 * See {@link Iterator#hasNext()}
45
	 */
46
	public boolean hasNext() {
47
		if (!returnDescriptors && !returnKeys)
48
			return false; //perhaps this is an exception?
49
50
		if (!returnDescriptors)
51
			return keys.hasNext(); //keys only
52
53
		if (returnKeys) //keys and descriptors
54
			return (descriptors != null && descriptors.hasNext()) || keys.hasNext();
55
56
		//descriptors only
57
		if (descriptors != null && descriptors.hasNext())
58
			return true;
59
		while (keys.hasNext()) {
60
			IArtifactKey key = (IArtifactKey) keys.next();
61
			descriptors = Arrays.asList(artifactRepository.getArtifactDescriptors(key)).iterator();
62
			if (descriptors.hasNext())
63
				return true;
64
		}
65
		return false;
66
	}
67
68
	/**
69
	 * See {@link Iterator#next()}
70
	 */
71
	public Object next() {
72
		if (!returnDescriptors && !returnKeys)
73
			throw new NoSuchElementException();
74
75
		if (!returnDescriptors)
76
			return keys.next(); //keys only
77
78
		if (returnKeys) {
79
			//keys and descriptors
80
			if (descriptors != null && descriptors.hasNext())
81
				return descriptors.next();
82
83
			IArtifactKey nextKey = (IArtifactKey) keys.next();
84
			descriptors = Arrays.asList(artifactRepository.getArtifactDescriptors(nextKey)).iterator();
85
			return nextKey;
86
		}
87
88
		//descriptors only
89
		if (descriptors != null && descriptors.hasNext())
90
			return descriptors.next();
91
		while (keys.hasNext()) {
92
			IArtifactKey key = (IArtifactKey) keys.next();
93
			descriptors = Arrays.asList(artifactRepository.getArtifactDescriptors(key)).iterator();
94
			if (!descriptors.hasNext())
95
				continue;
96
			return descriptors.next();
97
		}
98
		throw new NoSuchElementException();
99
	}
100
101
	/**
102
	 * Returns true if the iteration contains more IArtifactKeys
103
	 * @return boolean
104
	 */
105
	public boolean hasNextKey() {
106
		if (!returnKeys)
107
			return false;
108
		return keys.hasNext();
109
	}
110
111
	/**
112
	 * Get the next IArtifactKey skipping over any IArtifactDescriptor's
113
	 * @return IArtifactKey
114
	 * @throws IllegalStateException if this iterator is not returning keys 
115
	 */
116
	public IArtifactKey nextKey() {
117
		if (!returnKeys)
118
			throw new IllegalStateException();
119
		IArtifactKey next = (IArtifactKey) keys.next();
120
		if (returnDescriptors)
121
			descriptors = Arrays.asList(artifactRepository.getArtifactDescriptors(next)).iterator();
122
		return next;
123
	}
124
125
	/**
126
	 * See {@link Iterator#remove()}
127
	 * This operation is not supported
128
	 * @throws UnsupportedOperationException
129
	 */
130
	public void remove() {
131
		throw new UnsupportedOperationException();
132
	}
133
}
(-)src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/ArtifactKeyQuery.java (+58 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 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.equinox.internal.provisional.p2.artifact.repository;
13
14
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
15
import org.eclipse.equinox.internal.provisional.p2.metadata.VersionRange;
16
import org.eclipse.equinox.internal.provisional.p2.metadata.query.MatchQuery;
17
18
/**
19
 * An IArtifactQuery returning matching IArtifactKey objects.
20
 */
21
public class ArtifactKeyQuery extends MatchQuery implements IArtifactQuery {
22
	private String id;
23
	private VersionRange range;
24
25
	/**
26
	 * Pass the id and/or version range to match IArtifactKeys against.
27
	 * Passing null results in matching any id/version
28
	 * @param id - the IArtifactKey id
29
	 * @param range - A version range
30
	 */
31
	public ArtifactKeyQuery(String id, VersionRange range) {
32
		this.id = id;
33
		this.range = range;
34
	}
35
36
	public boolean isMatch(Object candidate) {
37
		if (!(candidate instanceof IArtifactKey))
38
			return false;
39
		IArtifactKey key = (IArtifactKey) candidate;
40
		if (id != null && !key.getId().equals(id))
41
			return false;
42
43
		if (range != null && !range.isIncluded(key.getVersion()))
44
			return false;
45
46
		return true;
47
	}
48
49
	// We are interested in IArtifactKey objects
50
	public Boolean getAcceptArtifactKeys() {
51
		return Boolean.TRUE;
52
	}
53
54
	// We are not interested in IArtifactDescriptor objects
55
	public Boolean getAcceptArtifactDescriptors() {
56
		return Boolean.FALSE;
57
	}
58
}
(-)src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactQuery.java (+34 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2009 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.equinox.internal.provisional.p2.artifact.repository;
13
14
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IMatchQuery;
15
import org.eclipse.equinox.p2.metadata.query.IQuery;
16
17
public interface IArtifactQuery extends IMatchQuery {
18
	public static final String ACCEPT_KEYS = "AcceptArtifactKeys"; //$NON-NLS-1$
19
	public static final String ACCEPT_DESCRIPTORS = "AcceptArtifactDescriptors"; //$NON-NLS-1$
20
21
	/**
22
	 * Return whether or not this query is interested in IArtifactKey objects
23
	 * This method can be accessed using {@link IQuery#getProperty(ACCEPT_KEYS)}
24
	 * @return Boolean
25
	 */
26
	public Boolean getAcceptArtifactKeys();
27
28
	/**
29
	 * Return whether or not this query is interested in IArtifactDescriptor objects
30
	 * This method can be accessed using {@link IQuery#getProperty(ACCEPT_DESCRIPTORS)}
31
	 * @return Boolean
32
	 */
33
	public Boolean getAcceptArtifactDescriptors();
34
}
(-)src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepository.java (-1 / +2 lines)
Lines 15-20 Link Here
15
import org.eclipse.core.runtime.IStatus;
15
import org.eclipse.core.runtime.IStatus;
16
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
16
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
17
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
18
import org.eclipse.equinox.internal.provisional.p2.metadata.query.IQueryable;
18
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
19
import org.eclipse.equinox.internal.provisional.p2.repository.IRepository;
19
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
20
import org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository.AbstractArtifactRepository;
20
21
Lines 27-33 Link Here
27
 * </p>
28
 * </p>
28
 * @noimplement This interface is not intended to be implemented by clients.
29
 * @noimplement This interface is not intended to be implemented by clients.
29
 */
30
 */
30
public interface IArtifactRepository extends IRepository {
31
public interface IArtifactRepository extends IRepository, IQueryable {
31
32
32
	/** 
33
	/** 
33
	 * The return code to use when a client could/should retry a failed getArtifact() operation.
34
	 * The return code to use when a client could/should retry a failed getArtifact() operation.
(-)src/org/eclipse/equinox/internal/provisional/spi/p2/artifact/repository/AbstractArtifactRepository.java (+14 lines)
Lines 10-15 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository;
11
package org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository;
12
12
13
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactIterator;
14
13
import java.io.OutputStream;
15
import java.io.OutputStream;
14
import java.net.URI;
16
import java.net.URI;
15
import java.util.Map;
17
import java.util.Map;
Lines 17-23 Link Here
17
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
19
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
18
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
20
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
19
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
22
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
20
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
23
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
24
import org.eclipse.equinox.p2.metadata.query.IQuery;
21
25
22
public abstract class AbstractArtifactRepository extends AbstractRepository implements IArtifactRepository {
26
public abstract class AbstractArtifactRepository extends AbstractRepository implements IArtifactRepository {
23
27
Lines 78-81 Link Here
78
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
82
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
79
		return new ArtifactDescriptor(key);
83
		return new ArtifactDescriptor(key);
80
	}
84
	}
85
86
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
87
		if (monitor != null && monitor.isCanceled())
88
			return collector;
89
90
		boolean acceptKeys = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_KEYS));
91
		boolean acceptDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_DESCRIPTORS));
92
		ArtifactIterator iterator = new ArtifactIterator(this, acceptKeys, acceptDescriptors);
93
		return query.perform(iterator, collector);
94
	}
81
}
95
}
(-)META-INF/MANIFEST.MF (+1 lines)
Lines 14-19 Link Here
14
 org.eclipse.equinox.internal.provisional.p2.metadata.query,
14
 org.eclipse.equinox.internal.provisional.p2.metadata.query,
15
 org.eclipse.equinox.internal.provisional.p2.metadata.repository,
15
 org.eclipse.equinox.internal.provisional.p2.metadata.repository,
16
 org.eclipse.equinox.internal.provisional.p2.repository,
16
 org.eclipse.equinox.internal.provisional.p2.repository,
17
 org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository,
17
 org.eclipse.equinox.p2.metadata.query,
18
 org.eclipse.equinox.p2.metadata.query,
18
 org.eclipse.equinox.p2.publisher,
19
 org.eclipse.equinox.p2.publisher,
19
 org.eclipse.equinox.p2.publisher.actions,
20
 org.eclipse.equinox.p2.publisher.actions,
(-)src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/CachingArtifactRepository.java (+14 lines)
Lines 9-14 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
10
package org.eclipse.equinox.internal.provisional.p2.directorywatcher;
11
11
12
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactIterator;
13
12
import java.io.File;
14
import java.io.File;
13
import java.io.OutputStream;
15
import java.io.OutputStream;
14
import java.net.URI;
16
import java.net.URI;
Lines 16-21 Link Here
16
import org.eclipse.core.runtime.*;
18
import org.eclipse.core.runtime.*;
17
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
19
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
18
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
22
import org.eclipse.equinox.p2.metadata.query.IQuery;
19
23
20
public class CachingArtifactRepository implements IArtifactRepository, IFileArtifactRepository {
24
public class CachingArtifactRepository implements IArtifactRepository, IFileArtifactRepository {
21
25
Lines 238-241 Link Here
238
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
242
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
239
		return innerRepo.createArtifactDescriptor(key);
243
		return innerRepo.createArtifactDescriptor(key);
240
	}
244
	}
245
246
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
247
		if (monitor != null && monitor.isCanceled())
248
			return collector;
249
250
		boolean acceptKeys = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_KEYS));
251
		boolean acceptDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_DESCRIPTORS));
252
		ArtifactIterator iterator = new ArtifactIterator(this, acceptKeys, acceptDescriptors);
253
		return query.perform(iterator, collector);
254
	}
241
}
255
}
(-)src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationArtifactRepository.java (-1 / +8 lines)
Lines 18-24 Link Here
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
21
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
22
import org.eclipse.equinox.internal.provisional.spi.p2.repository.AbstractRepository;
23
import org.eclipse.equinox.p2.metadata.query.IQuery;
22
import org.eclipse.osgi.util.NLS;
24
import org.eclipse.osgi.util.NLS;
23
import org.osgi.framework.BundleContext;
25
import org.osgi.framework.BundleContext;
24
26
Lines 231-236 Link Here
231
	}
233
	}
232
234
233
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
235
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
234
		return new ArtifactDescriptor(key);
236
		return artifactRepository.createArtifactDescriptor(key);
237
	}
238
239
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
240
		ensureInitialized();
241
		return artifactRepository.query(query, collector, monitor);
235
	}
242
	}
236
}
243
}
(-)src/org/eclipse/equinox/p2/tests/AbstractWrappedArtifactRepository.java (+6 lines)
Lines 18-23 Link Here
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
22
import org.eclipse.equinox.p2.metadata.query.IQuery;
21
23
22
public class AbstractWrappedArtifactRepository implements IArtifactRepository {
24
public class AbstractWrappedArtifactRepository implements IArtifactRepository {
23
25
Lines 134-137 Link Here
134
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
136
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
135
		return delegate.createArtifactDescriptor(key);
137
		return delegate.createArtifactDescriptor(key);
136
	}
138
	}
139
140
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
141
		return delegate.query(query, collector, monitor);
142
	}
137
}
143
}
(-)src/org/eclipse/equinox/p2/tests/publisher/TestArtifactRepository.java (+14 lines)
Lines 9-14 Link Here
9
 ******************************************************************************/
9
 ******************************************************************************/
10
package org.eclipse.equinox.p2.tests.publisher;
10
package org.eclipse.equinox.p2.tests.publisher;
11
11
12
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.ArtifactIterator;
13
12
import java.io.*;
14
import java.io.*;
13
import java.net.URI;
15
import java.net.URI;
14
import java.util.*;
16
import java.util.*;
Lines 21-27 Link Here
21
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
23
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler;
22
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
24
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
23
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
25
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
26
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
24
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
27
import org.eclipse.equinox.internal.provisional.p2.repository.IStateful;
28
import org.eclipse.equinox.p2.metadata.query.IQuery;
25
import org.eclipse.equinox.p2.tests.TestActivator;
29
import org.eclipse.equinox.p2.tests.TestActivator;
26
import org.eclipse.osgi.util.NLS;
30
import org.eclipse.osgi.util.NLS;
27
31
Lines 296-299 Link Here
296
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
300
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
297
		return new ArtifactDescriptor(key);
301
		return new ArtifactDescriptor(key);
298
	}
302
	}
303
304
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
305
		if (monitor != null && monitor.isCanceled())
306
			return collector;
307
308
		boolean acceptKeys = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_KEYS));
309
		boolean acceptDescriptors = Boolean.TRUE.equals(query.getProperty(IArtifactQuery.ACCEPT_DESCRIPTORS));
310
		ArtifactIterator iterator = new ArtifactIterator(this, acceptKeys, acceptDescriptors);
311
		return query.perform(iterator, collector);
312
	}
299
}
313
}
(-)src/org/eclipse/equinox/internal/p2/updatesite/artifact/UpdateSiteArtifactRepository.java (+6 lines)
Lines 18-23 Link Here
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
18
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
19
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
20
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
21
import org.eclipse.equinox.internal.provisional.p2.metadata.query.Collector;
22
import org.eclipse.equinox.p2.metadata.query.IQuery;
21
23
22
public class UpdateSiteArtifactRepository implements IArtifactRepository {
24
public class UpdateSiteArtifactRepository implements IArtifactRepository {
23
25
Lines 140-143 Link Here
140
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
142
	public IArtifactDescriptor createArtifactDescriptor(IArtifactKey key) {
141
		return delegate.createArtifactDescriptor(key);
143
		return delegate.createArtifactDescriptor(key);
142
	}
144
	}
145
146
	public Collector query(IQuery query, Collector collector, IProgressMonitor monitor) {
147
		return delegate.query(query, collector, monitor);
148
	}
143
}
149
}

Return to bug 256434