class ArchiveReferentialRepository {

    public void updateLocationToReadyOnDisk(String archiveId, long size, String digest) throws ArchiveReferentialException {
        try {
            UpdateResult updateResult = collection.updateOne(
                Filters.eq(TapeArchiveReferentialEntity.ID, archiveId),
                Updates.combine(
                    Updates.set(TapeArchiveReferentialEntity.LOCATION,
                        toBson(new TapeLibraryReadyOnDiskArchiveStorageLocation())),
                    Updates.set(TapeArchiveReferentialEntity.SIZE,
                        size),
                    Updates.set(TapeArchiveReferentialEntity.DIGEST,
                        digest),
                    Updates.set(TapeArchiveReferentialEntity.LAST_UPDATE_DATE,
                        LocalDateUtil.now().toString())
                ),
                new UpdateOptions().upsert(false)
            );

            if (updateResult.getMatchedCount() != 1) {
                throw new ArchiveReferentialException("Could not update storage location for " + archiveId + ". No such archiveId");
            }
        } catch (MongoException ex) {
            throw new ArchiveReferentialException("Could not update storage location for " + archiveId, ex);
        }
    }

    public  ArchiveReferentialRepository(MongoCollection<Document> collection);

}