Dekoh platform API

dekoh.portal.syndication.aggregator.core
Class PersistentSubscriptionList

java.lang.Object
  extended by dekoh.portal.syndication.aggregator.core.PersistentSubscriptionList
All Implemented Interfaces:
SubscriptionList
Direct Known Subclasses:
PersistentSubscriptionListWrapper, XmlBasedPersistentSubscriptionList

public abstract class PersistentSubscriptionList
extends Object
implements SubscriptionList

A PersistentSubscriptionList is list of RSS/Atom feed subscriptions of a user, which is saved to a persistent store. These saved subscriptions can be recreated on Dekoh process's restart.

An new instance of PersistentSubscriptionList can be obtained by using SubscriptionListManager.createSubscriptionList().

Saved subscriptions can be retrieved by calling SubscriptionListManager.loadPersistentSubscriptionList(String)

If a PersistentSubscriptionList is created with a PasswordStore the passwords on the constituent SubscriptionItems will be encrypted before saving to file, otherwise these passwords are written in plain text

Since:
Oct 8, 2007
See Also:
SubscriptionListManager

Field Summary
protected  InMemorySubscriptionList inMemorySubscriptionList
           
protected  PasswordStore passwordStore
           
 
Constructor Summary
PersistentSubscriptionList()
           
PersistentSubscriptionList(PasswordStore passwordStore)
           
 
Method Summary
 SubscriptionItem add(SubscriptionItem subscriptionItem)
           
 void add(URI feedUri)
           
 void addAll(List subscriptionItems)
           
 boolean addListener(SubscriptionListListener subscriptionListListener)
           
abstract  void delete()
           
 String getAuthor()
           
 String getDescripton()
           
 String getId()
           
 String getProperty(String name)
           
 Set getSubscribedItems()
          Gets the list Feed items from this subscription list
 String getTitle()
          Gets the current subscription list title
 long lastModifiedTime()
          Gets the last updated time for subscription list
abstract  void load()
           
 boolean remove(SubscriptionItem subscriptionItem)
           
 boolean remove(URI feedURI)
          Removes the given feed from the subscription List
 void removeAll(List subscriptionItems)
           
 boolean removeListener(SubscriptionListListener subscriptionListListener)
           
abstract  void save()
           
 void setAuthor(String author)
           
 void setDescripton(String description)
           
protected  void setId(String id)
           
 void setProperty(String name, String value)
           
 void setTitle(String title)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inMemorySubscriptionList

protected InMemorySubscriptionList inMemorySubscriptionList

passwordStore

protected PasswordStore passwordStore
Constructor Detail

PersistentSubscriptionList

public PersistentSubscriptionList()

PersistentSubscriptionList

public PersistentSubscriptionList(PasswordStore passwordStore)
Parameters:
passwordStore - will encrypt the passwords if any using this password store instance
Method Detail

lastModifiedTime

public long lastModifiedTime()
Description copied from interface: SubscriptionList
Gets the last updated time for subscription list

Specified by:
lastModifiedTime in interface SubscriptionList
Returns:
last updated time

save

public abstract void save()
                   throws PersistentSubscriptionListOperationsException
Throws:
PersistentSubscriptionListOperationsException

delete

public abstract void delete()
                     throws PersistentSubscriptionListOperationsException
Throws:
PersistentSubscriptionListOperationsException

load

public abstract void load()
                   throws PersistentSubscriptionListOperationsException,
                          NoSuchSubscriptionListException,
                          InvalidKeyException
Throws:
PersistentSubscriptionListOperationsException - wrapping problems in reading the persistent store and recreating elements of this list.
NoSuchSubscriptionListException - no record of this list in the persistent storage. For a file based persistent store, this exception may be wrapping a FileNotFoundExcepion
InvalidKeyException - if any of the encrypted password keys saved to persistent store, could not be decrypted using the password store instance provided to this list

setId

protected void setId(String id)

setAuthor

public void setAuthor(String author)
Specified by:
setAuthor in interface SubscriptionList

setDescripton

public void setDescripton(String description)
Specified by:
setDescripton in interface SubscriptionList

setTitle

public void setTitle(String title)
Specified by:
setTitle in interface SubscriptionList

getId

public String getId()

add

public void add(URI feedUri)
         throws MalformedURLException
Specified by:
add in interface SubscriptionList
Throws:
MalformedURLException

add

public SubscriptionItem add(SubscriptionItem subscriptionItem)
Specified by:
add in interface SubscriptionList

addAll

public void addAll(List subscriptionItems)
Specified by:
addAll in interface SubscriptionList

getSubscribedItems

public Set getSubscribedItems()
Description copied from interface: SubscriptionList
Gets the list Feed items from this subscription list

Specified by:
getSubscribedItems in interface SubscriptionList
Returns:
List of subscription items

getTitle

public String getTitle()
Description copied from interface: SubscriptionList
Gets the current subscription list title

Specified by:
getTitle in interface SubscriptionList
Returns:
subscription title

getDescripton

public String getDescripton()
Specified by:
getDescripton in interface SubscriptionList

getAuthor

public String getAuthor()
Specified by:
getAuthor in interface SubscriptionList

remove

public boolean remove(URI feedURI)
Description copied from interface: SubscriptionList
Removes the given feed from the subscription List

Specified by:
remove in interface SubscriptionList

remove

public boolean remove(SubscriptionItem subscriptionItem)
Specified by:
remove in interface SubscriptionList

removeAll

public void removeAll(List subscriptionItems)
Specified by:
removeAll in interface SubscriptionList

addListener

public boolean addListener(SubscriptionListListener subscriptionListListener)
Specified by:
addListener in interface SubscriptionList
Parameters:
subscriptionListListener - to be added cannot be null
Returns:
true of add was successful

removeListener

public boolean removeListener(SubscriptionListListener subscriptionListListener)
Specified by:
removeListener in interface SubscriptionList

getProperty

public String getProperty(String name)
Specified by:
getProperty in interface SubscriptionList

setProperty

public void setProperty(String name,
                        String value)
Specified by:
setProperty in interface SubscriptionList

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers