[jboss-svn-commits] JBL Code SVN: r5180 - in labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags: . service
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 19 11:57:34 EDT 2006
Author: szimano
Date: 2006-07-19 11:57:33 -0400 (Wed, 19 Jul 2006)
New Revision: 5180
Modified:
labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java
labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
Log:
getAllSubscribers for a user
Modified: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java
===================================================================
--- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java 2006-07-19 15:00:48 UTC (rev 5179)
+++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/TagService.java 2006-07-19 15:57:33 UTC (rev 5180)
@@ -154,4 +154,10 @@
*/
public void increaseFeedCounters(FeedType feedType, String data,
String ipAddress);
+
+ /**Gets number of subscribers for all feeds to this author
+ * @param author Author's login
+ * @return Number of subscribers (visits)
+ */
+ public Integer getAllSubscribers(String author) throws TagGetException;
}
Modified: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java 2006-07-19 15:00:48 UTC (rev 5179)
+++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java 2006-07-19 15:57:33 UTC (rev 5180)
@@ -648,4 +648,19 @@
}
}
}
+
+ public Integer getAllSubscribers(String author) throws TagGetException {
+ Integer visits = 0;
+
+ List<Tag> tagsByAuthor = getTagsByAuthor(author);
+
+ for (Tag tag : tagsByAuthor) {
+ visits += tag.getFeedVisits();
+ }
+
+ visits += getFeedVisits(FeedType.AUTHOR_ALL, author);
+ visits += getFeedVisits(FeedType.AUTHOR_UNIQUE, author);
+
+ return visits;
+ }
}
More information about the jboss-svn-commits
mailing list