diff --git a/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java b/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java
index e3e94ae255d..6d28caa2fc9 100755
--- a/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java
+++ b/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java
@@ -963,9 +963,8 @@ public Collectionnull
+ * @param missingProductInformation all the product information requirements that could not be found. Can be empty but must not be null
* @param allRequirementsResourcesNotFound The {@link MissingRequirement} objects that were not found. Must not be null
.
- * @param featureConflicts the details of any feature conflicts which occurred during feature resolution, as returned from {@link Result#getConflicts()}
+ * @param featureConflicts the details of any feature conflicts which occurred during feature resolution, as returned from {@link Result#getConflicts()}
*/
public RepositoryResolutionException(ResolutionException cause, Collectionnull
.
+ * @param featureConflicts the details of any feature conflicts which occurred during feature resolution, as returned from {@link Result#getConflicts()}
+ * @param resolvedPlatforms
+ * @param missingPlatforms Unknown platform names
+ * @param missingBasePlatforms unresolved versionless features needing platforms defined
+ */
+ public RepositoryResolutionException(ResolutionException cause, Collectionnull
to match to all products
- * @param version The version to find the minimum missing version for by matching the first three parts so if you supply "9.0.0.0" and this item applies to version "8.5.5.3"
- * and "9.0.0.1" then "9.0.0.1" will be returned. Supply null
to match all versions
- * @param edition The edition to find the minimum missing version for or null
to match to all products
+ * @param version The version to find the minimum missing version for by matching the first three parts so if you supply "9.0.0.0" and this item applies to version "8.5.5.3"
+ * and "9.0.0.1" then "9.0.0.1" will be returned. Supply null
to match all versions
+ * @param edition The edition to find the minimum missing version for or null
to match to all products
* @return The minimum missing version or null
if there were no relevant matches
*/
public String getMinimumVersionForMissingProduct(String productId, String version, String edition) {
@@ -152,7 +184,7 @@ private Collectionnull
to match to all products
- * @param edition The edition to find the version for or null
to match to all editions
+ * @param edition The edition to find the version for or null
to match to all editions
*
* @return the version ranges which apply to the given product ID and edition
*/
@@ -185,9 +217,9 @@ private Collection
null
to match to all products
- * @param version The version to find the maximum missing version for by matching the first three parts so if you supply "8.5.5.2" and this item applies to version "8.5.5.3"
- * and "9.0.0.1" then "8.5.5.3" will be returned. Supply null
to match all versions
- * @param edition The edition to find the maximum missing version for or null
to match to all products
+ * @param version The version to find the maximum missing version for by matching the first three parts so if you supply "8.5.5.2" and this item applies to version "8.5.5.3"
+ * and "9.0.0.1" then "8.5.5.3" will be returned. Supply null
to match all versions
+ * @param edition The edition to find the maximum missing version for or null
to match to all products
* @return The maximum missing version or null
if there were no relevant matches or the maximum version is unbounded
*/
public String getMaximumVersionForMissingProduct(String productId, String version, String edition) {
@@ -251,6 +283,16 @@ public Map
@@ -131,6 +141,14 @@ public class RepositoryResolver {
* List of all the missing requirements we've found so far
*/
List
@@ -308,7 +326,7 @@ void indexSamples() {
* @throws RepositoryResolutionException If the resource cannot be resolved
*/
public Collection Where the
+ * This method uses the same resolution logic that is used by the kernel at server startup to decide which features to start. Therefore calling this method with a list of
+ * feature names and installing the resources returned will guarantee that a server which has the same list of feature names in its server.xml will start.
+ *
+ * The caller must provide the full set of features from the server.xml, including those that are already installed, so that tolerated dependencies and auto-features can be
+ * resolved correctly.
+ *
+ * This method will fail if there's no valid set of dependencies for the required features that doesn't include conflicting versions of singleton features.
+ *
+ * For example, {@code resolve(Arrays.asList("javaee-7.0", "javaee-8.0"))} would work but {@code resolveAsSet(Arrays.asList("javaee-7.0", "javaee-8.0"))} would fail because
+ * javaee-7.0 and javaee-8.0 contain features which conflict with each other (and other versions are not tolerated).
+ *
+ * This method guarantees that it will return all the features required to start the requested features but will not ensure that the requested features will work with features
+ * which were already installed but were not requested in the call to this method.
+ *
+ * For example, if {@code ejbLite-3.2} is already installed and {@code resolve(Arrays.asList("cdi-2.0"))} is called, it will not return the autofeature which would be required
+ * for {@code cdi-2.0} and {@code ejbLite-3.2} to work together.
+ *
+ * @param toResolve A collection of the identifiers of the resources to resolve. It should be in the form:
+ * Where the A collection of ordered lists of {@link RepositoryResource}s to install. Each list represents a collection of resources that must be installed together or not
+ * at all. They should be installed in the iteration order of the list(s). Note that if a resource is required by multiple different resources then it will appear in
+ * multiple lists. For instance if you have requested to install A and B and A requires N which requires M and O whereas B requires Z that requires O then the returned
+ * collection will be (represented in JSON): This will not return Every auto-feature will have it's own list in the collection, this is to stop the failure to install either an auto feature or one of it's dependencies from
+ * stopping everything from installing. Therefore if you have features A and B that are required to provision auto feature C and you ask to resolve A and B then this
+ * method will return:
+ * The version is presumed to start after the last dash character in the name.
+ *
+ * E.g. {@code getFeatureBaseName("com.example.featureA-1.0")} returns {@code "com.example.featureA-"}
+ *
+ * @param nameAndVersion the feature symbolic name
+ * @return the feature symbolic name with any version stripped
+ */
+ public String getFeatureBaseName(String nameAndVersion) {
+ int dashPosition = nameAndVersion.lastIndexOf('-');
+ if (dashPosition != -1) {
+ return nameAndVersion.substring(0, dashPosition + 1);
+ } else {
+ return nameAndVersion;
+ }
+ }
+
/**
* Get a feature by name, but without going and checking the remote repository if we don't know about it
*
> resolve(Collection
> resolve(String toResolve) throws Rep
* For example, if {@code ejbLite-3.2} is already installed and {@code resolve(Arrays.asList("cdi-2.0"))} is called, it will not return the autofeature which would be required
* for {@code cdi-2.0} and {@code ejbLite-3.2} to work together.
*
+ * @deprecated - calling this method should be replaced by passing the platform list, required to support versionless features.
+ *
* @param toResolve A collection of the identifiers of the resources to resolve. It should be in the form:
*
{name}/{version}
* {name}
can be either the symbolic name, short name or lower case short name of the resource and /{version}
is
@@ -369,15 +389,80 @@ public Collection> resolve(String toResolve) throws Rep
*
* @throws RepositoryResolutionException If the resource cannot be resolved
*/
+ @Deprecated
public Collection
> resolveAsSet(Collection
> resolve(Collection
{name}/{version}
+ * {name}
can be either the symbolic name, short name or lower case short name of the resource and /{version}
is
+ * optional. The collection may contain a mixture of symbolic names and short names. Must not be null
or empty.
+ * [[M, O, N, A],[O, Z, B]]
+ *
+ * null
although it may return an empty collection if there isn't anything to install (i.e. it resolves to resources that are
+ * already installed)
+ * [[A],[B],[A,B,C]]
+ *
+ *
+ * @throws RepositoryResolutionException If the resource cannot be resolved
+ */
+ public Collection> resolveAsSet(Collection
> resolve(Collection
+ *
+ * @return True or false telling if this is a versionless feature.
+ */
@Override
public boolean isVersionless() {
- return false; // TODO
+ if (!getVisibility().equals(Visibility.PUBLIC) || (getPlatformName() != null)) {
+ return false;
+ }
+
+ String shortName = getIbmShortName();
+ if ((shortName == null) || !shortName.equals(getFeatureName())) {
+ return false;
+ }
+
+ if (getSymbolicName().contains(".versionless.")
+ && !getSymbolicName().contains(".internal.")) {
+ return true;
+ } else {
+ return false;
+ }
}
@Override
@@ -248,8 +277,23 @@ public boolean isConvenience() {
return false; // TODO
}
+ /**
+ * Tell if this is a compatibility feature.
+ *
+ *
+ *
+ * @return True or false telling if this is a versionless feature.
+ */
@Override
public boolean isCompatibility() {
- return false; // TODO
+ if (!getVisibility().equals(Visibility.PRIVATE)) {
+ return false;
+ } else if (getIbmShortName() != null) {
+ return false;
+ }
+ return (getPlatformName() != null);
}
}
diff --git a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java
index 911d9d42b8b..422c245bdd3 100644
--- a/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java
+++ b/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/kernel/KernelResolverRepository.java
@@ -24,7 +24,9 @@
import org.osgi.framework.Version;
import com.ibm.ws.kernel.feature.Visibility;
+import com.ibm.ws.kernel.feature.provisioning.FeatureResource;
import com.ibm.ws.kernel.feature.provisioning.ProvisioningFeatureDefinition;
+import com.ibm.ws.kernel.feature.provisioning.SubsystemContentType;
import com.ibm.ws.kernel.feature.resolver.FeatureResolver;
import com.ibm.ws.repository.common.enums.FilterableAttribute;
import com.ibm.ws.repository.common.enums.ResourceType;
@@ -244,6 +246,75 @@ public ProvisioningFeatureDefinition getFeature(String featureName) {
return feature;
}
+ /**
+ * Answer the list of public versioned features derived from the passed versionless feature or empty List if doesn't exist.
+ *
+ * @return List