public int getNotificationsCount(@NotNull String recipientId, boolean unreadOnly) {
        if (unreadOnly) {
            LOGGER.debug("Getting unread notifications count for {0}", recipientId);
            return notificationRepository.countNotificationsByUserId(recipientId, List.of(NotificationStatus.OPEN));
        } else {
            LOGGER.debug("Getting all notifications count for {0}", recipientId);
            return notificationRepository.countNotificationsByUserId(recipientId, List.of(NotificationStatus.values()));
        }
    }
Get the number of notifications for a given user.

@param recipientId the user's ID
@param unreadOnly true if only unread notifications should be counted
@return the count of notifications
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/NotificationService.java