Dekoh platform API

dekoh.portal.syndication.aggregator.managed
Class DekohSubscriptionListManager

java.lang.Object
  extended by dekoh.portal.syndication.aggregator.managed.DekohSubscriptionListManager

public class DekohSubscriptionListManager
extends Object

DekohSubscriptionListManager is the prefered way to create or reload PersistentSubscriptionList instances for Dekoh applications. The workingDirectory where the files backing up the PersistentSubscriptionList are stored is derived as the user-data directory.

For windows this class will create subscriptionlist files at C:/Dekoh/user-data<app-name>/<Dekoh User Name>/subscriptions. While loading this class will look up for the Subscription list files in the same directory.

Since:
Nov 23, 2007
See Also:
DekohSubscriptionListManager.createSubscriptionList(), DekohSubscriptionListManager.loadPersistentSubscriptionList(String)

Method Summary
 PersistentSubscriptionList createSubscriptionList()
          Creates a new instance of PersistentSubscriptionList backed by a XML file.
 PersistentSubscriptionList createSubscriptionList(PasswordStore passwordStore)
           
static DekohSubscriptionListManager getSubscriptionListManager(DesktopUser desktopUser, PortalApplicationContext applicationContext)
           
 PersistentSubscriptionList loadPersistentSubscriptionList(String subscriptionId)
           
 PersistentSubscriptionList loadPersistentSubscriptionList(String subscriptionId, PasswordStore passwordStore)
          Looks up the cache if the Subscriptionlist with the given id was earlier loaded, if not it will create a new instance of Subscriptionlist and load the data from the persistent store
 List loadPersistentSubscriptionLists()
          Loads all the saved PersistentSubscriptionLists in this user's user-data directory.
 List loadPersistentSubscriptionLists(PasswordStore passwordStore)
          Loads all the saved PersistentSubscriptionLists in this user's user-data directory.
 void remove(String subscriptionId)
          Removes the persistent store which is backing the subscription list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSubscriptionListManager

public static DekohSubscriptionListManager getSubscriptionListManager(DesktopUser desktopUser,
                                                                      PortalApplicationContext applicationContext)
Parameters:
desktopUser - a desktop user instance, currently logged in
applicationContext - the caller applications context
Returns:
instance of this class
See Also:
SessionUtil.getLoggedInDesktopUser(javax.servlet.http.HttpServletRequest), PortalApplicationContext.getCurrentContext()

createSubscriptionList

public PersistentSubscriptionList createSubscriptionList()
Creates a new instance of PersistentSubscriptionList backed by a XML file. Every modification like addition of new SubscriptionItem is saved to the file.

Callers are expected to save the id of the returned SubscriptionList instance so this instance can be recreated when Dekoh process restarts. Usually this id can be saved as a user-preference using the PortalApplicationContext.setUserPreference method.

Returns:
created instance of PersistentSubscriptionList.
See Also:
API to save a user preference, API to retrive a saved user preference

createSubscriptionList

public PersistentSubscriptionList createSubscriptionList(PasswordStore passwordStore)

loadPersistentSubscriptionList

public PersistentSubscriptionList loadPersistentSubscriptionList(String subscriptionId)
                                                          throws NoSuchSubscriptionListException,
                                                                 PersistentSubscriptionListOperationsException
Parameters:
subscriptionId - id of the previously saved PersistentSubscriptionList
Returns:
loaded Subscriptionlist
Throws:
NoSuchSubscriptionListException - when No SubscriptionList exits in the store with given id
PersistentSubscriptionListOperationsException - irrecoverable exception when reading the persistent store to recreated the subscription list.
See Also:
PortalApplicationContext.getUserPreference(javax.servlet.http.HttpServletRequest, String), PortalApplicationContext.setUserPreference(javax.servlet.http.HttpServletRequest, String, String)

loadPersistentSubscriptionList

public PersistentSubscriptionList loadPersistentSubscriptionList(String subscriptionId,
                                                                 PasswordStore passwordStore)
                                                          throws NoSuchSubscriptionListException,
                                                                 PersistentSubscriptionListOperationsException,
                                                                 InvalidKeyException
Looks up the cache if the Subscriptionlist with the given id was earlier loaded, if not it will create a new instance of Subscriptionlist and load the data from the persistent store

Parameters:
subscriptionId - id of the previously saved PersistentSubscriptionList
passwordStore, - if a password store was using when this subscription list was created, same implementation should be passed here.
Returns:
PersistentSubscriptionList
Throws:
NoSuchSubscriptionListException - if no PersistentSubscriptionList with the givven id exists in the store
PersistentSubscriptionListOperationsException - if an exception occurs while loading the PersistentSubscriptionList from the store
com.pramati.bfly.das.password.exception.InvalidKeyException - subscription list file exists but caller is using wrong password store.
InvalidKeyException

loadPersistentSubscriptionLists

public List loadPersistentSubscriptionLists()
Loads all the saved PersistentSubscriptionLists in this user's user-data directory.

Returns:
loaded list of subscription lists, empty if none existed.

loadPersistentSubscriptionLists

public List loadPersistentSubscriptionLists(PasswordStore passwordStore)
                                     throws InvalidKeyException
Loads all the saved PersistentSubscriptionLists in this user's user-data directory.

Parameters:
passwordStore - should the same password store, which was used to encrypt passwords in the constituent SubscriptionItems.
Returns:
loaded list of subscription lists, empty if none existed.
Throws:
InvalidKeyException - subscription list file exists but caller is using wrong password store.

remove

public void remove(String subscriptionId)
            throws PersistentSubscriptionListOperationsException
Removes the persistent store which is backing the subscription list.

Parameters:
subscriptionId - id of Subscriptionlist which will be removed
Throws:
PersistentSubscriptionListOperationsException - fail to remove SubscriptionList

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers