org.varienaja.comments
Class CommentService

java.lang.Object
  extended by org.varienaja.comments.CommentService

public class CommentService
extends java.lang.Object

Service that is used for getting/processing Comments for Bands, Playlists, etc..

Version:
$Id: CommentService.java,v 1.1 2010/03/16 18:55:42 varienaja Exp $
Author:
Varienaja

Constructor Summary
CommentService()
           
 
Method Summary
protected  void enhanceComment(Comment review, Playlist playlist)
          Uses the information of the Playlist to enhance its Reviews.
 java.util.Set<Comment> getComments(Band band)
          Gets the Comments for a certain Band.
 java.util.Set<Comment> getComments(Playlist playlist)
          Gets the Comments for a certain Playlist.
 Dao getDao()
           
 boolean refreshComments(Playlist playlist)
          Refreshes the Comments for a Playlist.
 void setDao(Dao dao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommentService

public CommentService()
Method Detail

setDao

public void setDao(Dao dao)

getDao

public Dao getDao()

getComments

public java.util.Set<Comment> getComments(Playlist playlist)
Gets the Comments for a certain Playlist. If there could be no Comments found, on local storage a try is made to download them from online sources. Hereafter, the new Comments will be stored on local storage for faster future use.

Parameters:
playlist - The Playlist to get Comments for.
Returns:
The Comments in an ordered Set (ordered by date of revies, latest first)

getComments

public java.util.Set<Comment> getComments(Band band)
Gets the Comments for a certain Band. If there could be no Comments found, on local storage a try is made to download them from online sources. Hereafter, the new Comments will be stored on local storage for faster future use.

Parameters:
band - The Band to get Comments for.
Returns:
The info as a Set of one Review.

refreshComments

public boolean refreshComments(Playlist playlist)
Refreshes the Comments for a Playlist. It re-downloads Comments from online sources, and merges them with the existing ones.

Parameters:
playlist - The Playlist to refresh the Comments for.
Returns:
Whether the Comments were changed.

enhanceComment

protected void enhanceComment(Comment review,
                              Playlist playlist)
Uses the information of the Playlist to enhance its Reviews. Plain text is hereby transformed into hyperlinked text.

Parameters:
review - A Review
playlist - The playist we're enhancing reviews for.


Copyright © 2010 A.J.V.. All Rights Reserved.