Changed the look up for support rim hash from base [no ci]

This commit is contained in:
Cyrus 2023-05-25 09:07:58 -04:00
parent 8ee74ca135
commit 2526808e5c
2 changed files with 18 additions and 2 deletions

View File

@ -251,8 +251,10 @@ public class ReferenceManifestPageController
.getRIMs());
allSupports.stream().forEach((support) -> {
if (!support.isUpdated() && payloadHashMap.containsKey(support.getHexDecHash())) {
BaseReferenceManifest dbBaseRim = payloadHashMap.get(support.getHexDecHash());
BaseReferenceManifest dbBaseRim = BaseReferenceManifest
.select(referenceManifestManager)
.byRimLink(support.getHexDecHash()).getRIM();
if (dbBaseRim != null) {
support.setSwidTagVersion(dbBaseRim.getSwidTagVersion());
support.setPlatformManufacturer(dbBaseRim.getPlatformManufacturer());
support.setPlatformModel(dbBaseRim.getPlatformModel());

View File

@ -43,6 +43,10 @@ public class BaseReferenceManifest extends ReferenceManifest {
* Holds the name of the 'base64Hash' field.
*/
public static final String BASE_64_HASH_FIELD = "base64Hash";
/**
* Holds the name of the 'base64Hash' field.
*/
public static final String RIM_LINK_FIELD = "rimLinkHash";
private static JAXBContext jaxbContext;
@ -171,6 +175,16 @@ public class BaseReferenceManifest extends ReferenceManifest {
return this;
}
/**
* Specify the RIM hash associated with the base RIM.
* @param rimLinkHash the hash of the file associated with the rim
* @return this instance
*/
public Selector byRimLink(final String rimLinkHash) {
setFieldValue(RIM_LINK_FIELD, rimLinkHash);
return this;
}
/**
* Specify the RIM hash associated with the base RIM.
* @param hexDecHash the hash of the file associated with the rim