class ObjectReferentialRepository {

    public void updateStorageLocation(String containerName, String objectName, String storageId,
        TapeLibraryTarObjectStorageLocation tapeLibraryTarStorageLocation)
        throws ObjectReferentialException {

        try {
            collection.updateOne(
                Filters.and(
                    Filters.eq(TapeObjectReferentialEntity.ID,
                        toBson(new TapeLibraryObjectReferentialId(containerName, objectName))),
                    Filters.eq(TapeObjectReferentialEntity.STORAGE_ID, storageId)
                ),
                Updates.combine(
                    Updates.set(TapeObjectReferentialEntity.LOCATION,
                        toBson(tapeLibraryTarStorageLocation)),
                    Updates.set(TapeObjectReferentialEntity.LAST_UPDATE_DATE,
                        LocalDateUtil.now().toString())
                ),
                new UpdateOptions().upsert(false)
            );
        } catch (MongoException ex) {
            throw new ObjectReferentialException("Could not update storage location for " +
                containerName + "/" + objectName, ex);
        }
    }

    public  ObjectReferentialRepository(MongoCollection<Document> collection);

}