FELIX-2106, FELIX-692: Control which repositories are used for a given resolver
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@915288 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Repository.java b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Repository.java
index 30adeb9..172c5f2 100644
--- a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Repository.java
+++ b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Repository.java
@@ -42,7 +42,7 @@
Resource[] getResources();
/**
- * Return the name of this reposotory.
+ * Return the name of this repository.
*
* @return a non-null name
*/
@@ -50,4 +50,14 @@
long getLastModified();
+ /**
+ * Returns whether this repository is a local one
+ * or not.
+ *
+ * Local repositories contains resources that are already available
+ * in the OSGi framework and thus will be preferred over other
+ * resources.
+ */
+ boolean isLocal();
+
}
\ No newline at end of file
diff --git a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/RepositoryAdmin.java b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
index dc822d0..8b6b520 100644
--- a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
+++ b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/RepositoryAdmin.java
@@ -35,11 +35,11 @@
* <li>Capabilities - Capabilities provide a named aspect: a bundle, a display,
* memory, etc.</li>
* <li>Requirements - A named filter expression. The filter must be satisfied
- * by one or more Capabilties with the given name. These capabilities can come
+ * by one or more Capabilities with the given name. These capabilities can come
* from other resources or from the platform. If multiple resources provide the
* requested capability, one is selected. (### what algorithm? ###)</li>
* <li>Requests - Requests are like requirements, except that a request can be
- * fullfilled by 0..n resources. This feature can be used to link to resources
+ * fulfilled by 0..n resources. This feature can be used to link to resources
* that are compatible with the given resource and provide extra functionality.
* For example, a bundle could request all its known fragments. The UI
* associated with the repository could list these as optional downloads.</li>
@@ -85,12 +85,20 @@
/**
* Create a resolver.
- *
+ *
* @return
*/
Resolver resolver();
/**
+ * Create a resolver on the given repositories.
+ *
+ * @param repositories the list of repositories to use for the resolution
+ * @return
+ */
+ Resolver resolver(Repository[] repositories);
+
+ /**
* Add a new repository to the federation.
*
* The url must point to a repository XML file.
@@ -101,6 +109,14 @@
*/
Repository addRepository(URL repository) throws Exception;
+ /**
+ * Remove a repository from the federation
+ *
+ * The url must point to a repository XML file.
+ *
+ * @param repository
+ * @return
+ */
boolean removeRepository(URL repository);
/**
@@ -110,6 +126,20 @@
*/
Repository[] listRepositories();
+ /**
+ * Return the repository containing the system bundle
+ *
+ * @return
+ */
+ Repository getSystemRepository();
+
+ /**
+ * Return the repository containing locally installed resources
+ *
+ * @return
+ */
+ Repository getLocalRepository();
+
Resource getResource(String repositoryId);
/**
@@ -128,4 +158,12 @@
*/
Filter filter(String filter) throws InvalidSyntaxException;
+ /**
+ * Create a repository from the specified URL.
+ *
+ * @param repository
+ * @return
+ */
+ Repository repository(URL repository) throws Exception;
+
}
\ No newline at end of file
diff --git a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resource.java b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resource.java
index 7064b75..274b533 100644
--- a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resource.java
+++ b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resource.java
@@ -85,4 +85,5 @@
String[] getCategories();
Repository getRepository();
+
}
\ No newline at end of file