class DbImaBlacklistBaselineRecordManager extends DBManager<ImaBlacklistRecord> implements ImaBlacklistBaselineRecordManager {

    @Override
    public ImaBlacklistRecord saveRecord(final ImaBlacklistRecord record)
            throws ImaBaselineRecordManagerException {
        LOGGER.debug("saving ima baseline record: {}", record);

        //When adding a record through the manager, the record should be associated with a baseline
        if (record == null || record.getBaseline() == null) {
            throw new ImaBaselineRecordManagerException("Record cannot be saved without setting"
                    + " baseline.");
        }

        try {
            //Checks to make sure a duplicate record does not already exist in the baseline.  This
            //is done in this fashion due to the inability to put constraints on the table.
            if (getRecord(record.getPath(), record.getHash(),
                    (ImaBlacklistBaseline) record.getBaseline()) != null) {
                throw new ImaBaselineRecordManagerException("Record already exists.");
            } else {
                return super.save(record);
            }
        } catch (DBManagerException e) {
            throw new ImaBaselineRecordManagerException(e);
        }
    }

    public  DbImaBlacklistBaselineRecordManager(final SessionFactory factory);

}