class VitamMongoRepository implements VitamRepository {

    @Override
    public Optional<Document> findByIdentifier(String identifier) throws DatabaseException {
        ParametersChecker.checkParameter(ALL_PARAMS_REQUIRED, identifier);
        try {
            FindIterable<Document> result = collection.find(eq("Identifier", identifier));
            if (result.iterator().hasNext()) {
                return Optional.of(result.first());
            } else {
                return Optional.empty();
            }
        } catch (Exception e) {
            LOGGER.error(String
                    .format("Error while findByIdentifierAndTenant > identifier : %s",
                        identifier),
                e);
            throw new DatabaseException(String
                .format("Error while findByIdentifierAndTenant > identifier : %s",
                    identifier),
                e);
        }
    }

    public  VitamMongoRepository(MongoCollection<Document> collection);

}