Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ public class AruPatch implements Comparable<AruPatch> {
private String downloadPath;
private String fileName;
private String access;
private String lifecycle;

public String patchId() {
return patchId;
Expand Down Expand Up @@ -149,15 +148,6 @@ public boolean isOpenAccess() {
return "Open access".equals(access);
}

public AruPatch lifecycle(String value) {
lifecycle = value;
return this;
}

public boolean isRecommended() {
return "Recommended".equals(lifecycle);
}

public boolean notStackPatchBundle() {
return !isStackPatchBundle();
}
Expand All @@ -166,6 +156,10 @@ public boolean isStackPatchBundle() {
return description != null && description.contains("STACK PATCH BUNDLE");
}

private boolean isCoherenceFeaturePack() {
return description != null && description.contains("Coherence 14.1.1 Feature Pack");
}

/**
* Given an XML document with a list of patches, extract each patch into the AruPatch bean and return the list.
* @param patchList an XML document with a list of patches from ARU
Expand Down Expand Up @@ -199,7 +193,6 @@ public static List<AruPatch> getPatches(Document patchList, String patchSelector
.product(XPathUtil.string(nodeList.item(i), "./product/@id"))
.psuBundle(XPathUtil.string(nodeList.item(i), "./psu_bundle"))
.access(XPathUtil.string(nodeList.item(i), "./access"))
.lifecycle(XPathUtil.string(nodeList.item(i), "./life_cycle"))
.downloadHost(XPathUtil.string(nodeList.item(i), "./files/file/download_url/@host"))
.downloadPath(XPathUtil.string(nodeList.item(i), "./files/file/download_url/text()"));

Expand All @@ -224,7 +217,7 @@ public static List<AruPatch> getPatches(Document patchList, String patchSelector
}

/**
* Select a an ARU patch from the list based on a version number.
* Select an ARU patch from the list based on a version number.
* Version preference is: provided version, PSU version, and then installer version.
* If there is only one patch in the list, no version checking is done, and that patch is returned.
* @param patches list of patches to search
Expand Down Expand Up @@ -310,6 +303,10 @@ public static List<AruPatch> removeStackPatchBundle(List<AruPatch> patches) {
return patches.stream().filter(AruPatch::notStackPatchBundle).collect(Collectors.toList());
}

public static List<AruPatch> removeCoherenceFeaturePackPatch(List<AruPatch> patches) {
return patches.stream().filter(p -> !p.isCoherenceFeaturePack()).collect(Collectors.toList());
}

@Override
public String toString() {
return patchId + " - " + description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ List<AruPatch> getRecommendedPatches(AruProduct product, String version, String

patches = AruPatch.removeStackPatchBundle(AruPatch.getPatches(psuOverrides));
}
// TODO: Need an option for the user to request the Coherence additional feature pack.
patches = AruPatch.removeCoherenceFeaturePackPatch(patches);
patches.forEach(p -> logger.info("IMG-0068", product.description(), p.patchId(), p.description()));
logger.exiting(patches);
return patches;
Expand Down