class OrientPyPiGroupFacet extends GroupFacetImpl {

  public boolean isStale(final String name, final Content content, final Map<Repository, Response> responses) {
    DateTime cacheModified = extractLastModified(content);
    if (cacheModified == null || isStale(content)) {
      return true;
    }

    for (Entry<Repository, Response> response : responses.entrySet()) {
      Response responseValue = response.getValue();
      if (responseValue.getStatus().getCode() == HttpStatus.OK) {
        Content responseContent = (Content) responseValue.getPayload();

        if (responseContent != null) {
          DateTime memberLastModified = responseContent.getAttributes().get(CONTENT_LAST_MODIFIED, DateTime.class);
          if (memberLastModified == null || memberLastModified.isAfter(cacheModified)) {
            log.debug("Found stale content while fetching {} from repository {}", name, response.getKey().getName());
            return true;
          }
        }
      }
    }
    return false;
  }

  @Inject public  OrientPyPiGroupFacet(final RepositoryManager repositoryManager,
                        final ConstraintViolationFactory constraintViolationFactory,
                        @Named(GroupType.NAME) final Type groupType);

}