diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/Device.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/Device.java index b01c0bbb..118cd3d7 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/Device.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/entity/userdefined/Device.java @@ -58,6 +58,16 @@ public class Device extends AbstractEntity { @Column(name = "summary_id") private String summaryId; + public Device(final DeviceInfoReport deviceInfoReport) { + super(); + if (deviceInfoReport != null) { + this.name = deviceInfoReport.getNetworkInfo().getHostname(); + this.deviceInfo = deviceInfoReport; + } else { + name = ""; + } + } + public String toString() { return String.format("Device Name: %s%nStatus: %s%nSummary: %s", name, healthStatus.getStatus(),