class TPMBaselineGenerator {

    public final String generateNameForKernelUpdateBaseline(final IntegrityReport report)
        throws NullPointerException, TPMBaselineGeneratorException {
        LOGGER.debug("retrieving Device Info data to create kernel update baseline name");
        if (report == null) {
            LOGGER.error("null argument: report");
            throw new NullPointerException("report");
        }

        if (report.contains(DeviceInfoReport.class)) {
            final DeviceInfoReport diReport = report.extractReport(DeviceInfoReport.class);

            final OSInfo osInfo = diReport.getOSInfo();
            return String.format(KERNEL_UPDATE_BASELINE_NAME,
                osInfo.getOSName(), osInfo.getOSVersion());
        }

        final String msg = "The integrity report did not contain a device info report."
                + " Investigate how the appraiser got this far.";
        throw new TPMBaselineGeneratorException(msg);
    }

}