Examples of UnreadCount


Examples of com.commafeed.frontend.model.UnreadCount

    });

    for (FeedSubscription subscription : subscriptions) {
      if ((id == null && subscription.getCategory() == null)
          || (subscription.getCategory() != null && Objects.equals(subscription.getCategory().getId(), id))) {
        UnreadCount uc = unreadCount.get(subscription.getId());
        Subscription sub = Subscription.build(subscription, config.getApplicationSettings().getPublicUrl(), uc);
        category.getFeeds().add(sub);
      }
    }
    Collections.sort(category.getFeeds(), new Comparator<Subscription>() {
View Full Code Here

Examples of com.commafeed.frontend.model.UnreadCount

    Preconditions.checkNotNull(id);
    FeedSubscription sub = feedSubscriptionDAO.findById(user, id);
    if (sub == null) {
      return Response.status(Status.NOT_FOUND).build();
    }
    UnreadCount unreadCount = feedSubscriptionService.getUnreadCount(user).get(id);
    return Response.ok(Subscription.build(sub, config.getApplicationSettings().getPublicUrl(), unreadCount)).build();
  }
View Full Code Here

Examples of com.commafeed.frontend.model.UnreadCount

    }
    return statuses;
  }

  public UnreadCount getUnreadCount(User user, FeedSubscription subscription) {
    UnreadCount uc = null;
    HibernateQuery query = buildQuery(user, subscription, true, null, null, -1, -1, null, null, null);
    List<Tuple> tuples = query.list(entry.count(), entry.updated.max());
    for (Tuple tuple : tuples) {
      Long count = tuple.get(entry.count());
      Date updated = tuple.get(entry.updated.max());
      uc = new UnreadCount(subscription.getId(), count, updated);
    }
    return uc;
  }
View Full Code Here

Examples of com.commafeed.frontend.model.UnreadCount

    }
  }

  @Override
  public UnreadCount getUnreadCount(FeedSubscription sub) {
    UnreadCount count = null;
    try (Jedis jedis = pool.getResource()) {
      String key = buildRedisUnreadCountKey(sub);
      String json = jedis.get(key);
      if (json != null) {
        count = MAPPER.readValue(json, UnreadCount.class);
View Full Code Here

Examples of com.commafeed.frontend.model.UnreadCount

    }
    return map;
  }

  private UnreadCount getUnreadCount(User user, FeedSubscription sub) {
    UnreadCount count = cache.getUnreadCount(sub);
    if (count == null) {
      log.debug("unread count cache miss for {}", Models.getId(sub));
      count = feedEntryStatusDAO.getUnreadCount(user, sub);
      cache.setUnreadCount(sub, count);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.