From 2e0b83f4fee56c5c80f1c88ad05a977a43869923 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Thu, 24 Feb 2022 09:54:59 -0500 Subject: [PATCH] Updated the upload function for support RIM. The store happened before the linkage and nothing was being saved. --- .../controllers/ReferenceManifestPageController.java | 6 ++++++ .../java/hirs/data/persist/ReferenceDigestValue.java | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java index 1858f2b9..59165131 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java @@ -257,9 +257,15 @@ public class ReferenceManifestPageController for (SwidResource swid : bRim.parseResource()) { if (support.getHexDecHash().equals(swid.getHashValue())) { updateSupportRimInfo(bRim, support); + referenceManifestManager.update(support); } } if (support.isUpdated()) { + for (ReferenceDigestValue rdv : referenceEventManager + .getValuesByRimId(support)) { + rdv.updateInfo(support); + referenceEventManager.updateRecord(rdv); + } break; } } diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java index 7b25b38a..9eb217c2 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java @@ -257,6 +257,18 @@ public class ReferenceDigestValue extends ArchivableEntity { } } + /** + * Helper method to update the attributes of this object. + * @param support the associated RIM. + */ + public void updateInfo(final SupportReferenceManifest support) { + if (support != null && support.getId().equals(getSupportRimId())) { + setBaseRimId(support.getAssociatedRim()); + setManufacturer(support.getPlatformManufacturer()); + setModel(support.getPlatformModel()); + } + } + @Override public boolean equals(final Object obj) { if (this == obj) {