FELIX-2110: The resolver should be able to resolve for some requirements in addition to resources

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@912353 13f79535-47bb-0310-9956-ffa450edef68
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 7468871..29fad00 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
@@ -23,6 +23,9 @@
 
 import java.net.URL;
 
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+
 /**
  * Provides centralized access to the distributed repository.
  * 
@@ -75,7 +78,6 @@
     /**
      * Create a resolver.
      * 
-     * @param resource
      * @return
      */
     Resolver resolver();
@@ -100,5 +102,22 @@
      */
     Repository[] listRepositories();
 
-    Resource getResource(String respositoryId);
+    Resource getResource(String repositoryId);
+
+    /**
+     * Create a simple requirement to be used for selection
+     * @param name
+     * @param filter
+     * @return
+     */
+    Requirement requirement(String name, String filter) throws InvalidSyntaxException;
+
+    /**
+     * Create an extender filter supporting the SUBSET, SUPERSET and other extensions
+     *
+     * @param filter the string filter
+     * @return
+     */
+    Filter filter(String filter) throws InvalidSyntaxException;
+
 }
\ No newline at end of file
diff --git a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resolver.java b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resolver.java
index 629159b..a8a552d 100644
--- a/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resolver.java
+++ b/org.osgi.service.obr/src/main/java/org/osgi/service/obr/Resolver.java
@@ -24,8 +24,42 @@
 public interface Resolver
 {
 
+    /**
+     * Add the following resource to the resolution.
+     *
+     * The resource will be part of the output and all its requirements
+     * will be satisfied.
+     *
+     * It has the same effect has adding a requirement that will match
+     * this resource by symbolicname and version.
+     *
+     * The current resolution will be lost after adding a resource.
+     *
+     * @param resource the resource to add
+     */
     void add(Resource resource);
 
+    /**
+     * Returns the list of resources that have been added to the resolution
+     * @return
+     */
+    Resource[] getAddedResources();
+
+    /**
+     * Add the following requirement to the resolution
+     *
+     * The current resolution will be lost after adding a requirement.
+     *
+     * @param requirement the requirement to add
+     */
+    void add(Requirement requirement);
+
+    /**
+     * Returns the list of requirements that have been added to the resolution
+     * @return
+     */
+    Requirement[] getAddedRequirements();
+
     Requirement[] getUnsatisfiedRequirements();
 
     Resource[] getOptionalResources();
@@ -36,8 +70,6 @@
 
     Resource[] getRequiredResources();
 
-    Resource[] getAddedResources();
-
     boolean resolve();
 
     void deploy(boolean start);