com.bea.apps.groupspace.rss.feed
Class FeedOps

java.lang.Object
  extended by com.bea.apps.groupspace.rss.feed.FeedOps

public class FeedOps
extends Object

Frontend class for operations on feeds. This class coordinates caching, retrieval of feeds from the live source and persistence to the CM system.


Field Summary
protected  FeedCache cache
          Object for caching feeds
protected  FeedCm cm
          Object which controls feed persistence
protected  FeedEntriesControlBean feedEntriesControl
          FeedFoldersControl needed for feed folders persistence
protected  FeedFoldersControlBean feedFoldersControl
          FeedEntriesControl needed for feed entries persistence
 
Constructor Summary
FeedOps(String communityUri, FeedFoldersControlBean foldersBean, FeedEntriesControlBean entriesBean)
          Constructs a FeedOps object for management of Feeds
 
Method Summary
 List<Feed> getAllFeeds()
          Get all persisted feeds
 List<FeedEntryItem> getEntries(FeedFolder feedFolder)
          Return a list of entries for a specific Feed Folder
 List<FeedEntryItem> getEntries(URL feedUrl)
          Retrieves the entries for a specified feed URL and assumes a default FeedFolderControl visibility
 List<FeedEntryItem> getEntries(URL feedUrl, CommunityContent.Visibility visibility)
          Retrieves the entries for a specified feed URL and Visibility.
 FeedEntryItem getEntry(String uid)
          Retrieve a specific feed entry by feed entry unique id and assumes a default FeedFolderControl visibility
 FeedEntryItem getEntry(String uid, CommunityContent.Visibility visibility)
          Retrieve a specific feed entry by feed entry unique id and visibility
 Feed getFeedInfo(URL feedUrl, CommunityContent.Visibility visibility)
          Retrieves the request feed base on URL and Visibility.
 boolean isFeedSubscribed(URL feedUrl)
          Determines if this feed has already been subscribed to for the default FeedFolderControl visibility
 boolean isFeedSubscribed(URL feedUrl, CommunityContent.Visibility visibility)
          Determines if this feed has already been subscribed to for the provided visibility
 boolean setArchiveStatus(FeedEntry feedEntry, FeedFolder feedFolder, boolean status)
          Sets the status of a FeedEntry so that it will/will not be archived.
 boolean setFeedFolderVisibility(Feed feed, CommunityContent.Visibility visibility)
          Set visibility of Feed Folder(support private to community visibility change)
 boolean subscribe(URL feedUrl, CommunityContent.Visibility visibility)
          Subscribe to a feed and create the GroupSpace FeedFolder that will represent this feed locally
 boolean unsubscribeFeed(URL feedUrl, CommunityContent.Visibility visibility, boolean force)
          Unsubscribe from a feed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

feedFoldersControl

protected FeedFoldersControlBean feedFoldersControl
FeedEntriesControl needed for feed entries persistence


feedEntriesControl

protected FeedEntriesControlBean feedEntriesControl
FeedFoldersControl needed for feed folders persistence


cache

protected FeedCache cache
Object for caching feeds


cm

protected FeedCm cm
Object which controls feed persistence

Constructor Detail

FeedOps

public FeedOps(String communityUri,
               FeedFoldersControlBean foldersBean,
               FeedEntriesControlBean entriesBean)
        throws Exception
Constructs a FeedOps object for management of Feeds

Parameters
communityUri - the Community Uri string
foldersBean - FeedFoldersControl
entriesBean - FeedEntriesControl
Throws
Exception
Method Detail

getAllFeeds

public List<Feed> getAllFeeds()
                       throws Exception
Get all persisted feeds

Returns
list of Feeds that have been persisted
Throws
Exception

getFeedInfo

public Feed getFeedInfo(URL feedUrl,
                        CommunityContent.Visibility visibility)
Retrieves the request feed base on URL and Visibility. - Will first check the cache. - If cache is expired or not cached it retrieve it from the live source

Parameters
feedUrl - Url of the feed to fetch
Returns
Feed the requested feed
Throws
NullUrlException - if the URL passed in was null
com.sun.syndication.io.FeedException - if the feed can't be acquired or parsed from the live source for some reason

getEntries

public List<FeedEntryItem> getEntries(FeedFolder feedFolder)
                               throws NullUrlException,
                                      NullFeedException
Return a list of entries for a specific Feed Folder

Parameters
feedFolder - The GroupSpace feed folder
Returns
a list of feed entries from the provided feed folder
Throws
NullUrlException
NullFeedException

getEntries

public List<FeedEntryItem> getEntries(URL feedUrl)
                               throws NullUrlException,
                                      NullFeedException
Retrieves the entries for a specified feed URL and assumes a default FeedFolderControl visibility

Parameters
feedUrl - URL for a feed
Returns
a list of feed entries for the provided URL
Throws
NullUrlException
NullFeedException

getEntries

public List<FeedEntryItem> getEntries(URL feedUrl,
                                      CommunityContent.Visibility visibility)
                               throws NullUrlException,
                                      NullFeedException
Retrieves the entries for a specified feed URL and Visibility. This method also manages: - caching of feed entries and attempts to retrieve them from the cache if possible - initial persistence of feed entries - removal of feed entries from the persistent store when they are no longer valid in the live source

Parameters
feedUrl - URL for a feed
visibility - Visibility context for the feed
Returns
a list of feed entries
Throws
NullUrlException
NullFeedException

getEntry

public FeedEntryItem getEntry(String uid)
Retrieve a specific feed entry by feed entry unique id and assumes a default FeedFolderControl visibility

Parameters
uid - unique id for a feed entry
Returns
a feed entry

getEntry

public FeedEntryItem getEntry(String uid,
                              CommunityContent.Visibility visibility)
Retrieve a specific feed entry by feed entry unique id and visibility

Parameters
uid - unique id of feed entry
visibility - Visibility context of feed entry
Returns

unsubscribeFeed

public boolean unsubscribeFeed(URL feedUrl,
                               CommunityContent.Visibility visibility,
                               boolean force)
Unsubscribe from a feed. This has the side effect of deleting the assosiacted FeedFolder from CM. If there are FeedEntries in the FeedFolder that have their archive flag set to true then this will return false. You can force the unsubscribe operation to go through even if there are archived entries by specifying force=true

Parameters
feedUrl - URL of the feed to unsubscribe
visibility - Visibility context for the feed to unsubscribe
force - Should the feed be unsubscribed even if there are archived entries for the feed
Returns
Returns true if the unsubscribe operation was successful false if there were archived entries and force==false or the unsubscribe was unsuccessul for some other reason
Throws
AuthorizationException - If the user does not have permission to unsubscribe from the feed

isFeedSubscribed

public boolean isFeedSubscribed(URL feedUrl)
Determines if this feed has already been subscribed to for the default FeedFolderControl visibility

Parameters
feedUrl - URL of feed
Returns
determines if feed has already been subscribed to

isFeedSubscribed

public boolean isFeedSubscribed(URL feedUrl,
                                CommunityContent.Visibility visibility)
Determines if this feed has already been subscribed to for the provided visibility

Parameters
feedUrl - URL of feed
visibility - Visibility context of feed
Returns
determines if feed has already been subscribed to

subscribe

public boolean subscribe(URL feedUrl,
                         CommunityContent.Visibility visibility)
                  throws Exception
Subscribe to a feed and create the GroupSpace FeedFolder that will represent this feed locally

Parameters
feedUrl - URL of the feed
visibility - Visibility context of the feed
Returns
determine if subscription sucessful
Throws
Exception

setArchiveStatus

public boolean setArchiveStatus(FeedEntry feedEntry,
                                FeedFolder feedFolder,
                                boolean status)
                         throws AuthorizationException,
                                NoSuchNodeException
Sets the status of a FeedEntry so that it will/will not be archived. If an entry is marked as being archived it should not be purged from CM.

Parameters
uid - Identifies the entry within visibility scope
searchPath - Where to start looking for the FeedEntry
status - Archive status to set
Returns
determine if archive status change successful
Throws
AuthorizationException
NoSuchNodeException

setFeedFolderVisibility

public boolean setFeedFolderVisibility(Feed feed,
                                       CommunityContent.Visibility visibility)
Set visibility of Feed Folder(support private to community visibility change)

Parameters
feed - feed for which to modify visibility
visibility - Visibility context for feed
Returns
determines if visibility change was successful


Copyright © 2006 BEA Systems, Inc. All Rights Reserved