Oracle Discussions Java API Reference
10g Release 1 (10.1.2)

B25496-01

oracle.discussions.sdk
Interface TdSubscriptionManager


public interface TdSubscriptionManager

Represents a class which manages user subscriptions.

A subscription can be set and unset on a discussions element using subscription manager.

Oracle discussions elements names have been changed in the webui compared to that of sdk portion. The existing names to the new names mapping is as shown.

Sample code snippet illustrating the usage of TdSubscriptionManager

 //Retrieve the TdSubscriptionManager from TdStore
  TdSubscriptionManager tdSbtMgr = tdStore.getSubscriptionManager();
 //brdPath is the path from which board is being extrated.
  TdBoard tdb = tdStore.getBoard(brdPath);
 //Extract a thread from the board.
  TdThread tdt = tdb.getThread(Integer.parseInt(threadId)) ;
 //Remove the thread from favorites.
  tdt.removeFromFavorites();
 //Unsubscribe the thread.
 TdSubscription tdSbt = tdSbtMgr.getSubscription(tdt);
 if (tdSbt != null)
    tdSbtMgr.unsubscribe(tdSbt);
 
Since:
OCS 10.1.1
See Also:
TdSubscription

Method Summary
 TdSubscription getSubscription(TdContainer tdc)
          Returns the subscription of current user on the given container, null if the container is not subscribed.
 TdThreadSubscription getSubscription(TdThread tdt)
          Returns the subscription of current user on the given thread, null if the container is not subscribed.
 boolean isSubscribed(TdContainer tdc)
          Returns true if there is any subscription on the given container
 boolean isSubscribed(TdThread tdt)
          Returns true if there is any subscription on the given thread
 java.util.List listSubscriptions()
          Returns all subscriptions for the current user
 TdSubscription subscribe(TdContainer tdc, int iType)
          Creates a subscription of the given email and type on the given container
 TdSubscription subscribe(TdThread tdt, int iType)
          Creates a subscription of the given email and type on the given thread
 void unsubscribe(TdSubscription tds)
          Removes the given subscription
 void updateSubscription(TdSubscription tds)
          Updates the given subscription

 

Method Detail

getSubscription

public TdSubscription getSubscription(TdContainer tdc)
                               throws TdException
Returns the subscription of current user on the given container, null if the container is not subscribed.
Parameters:
tdc - the container on which subscription is beign requested
Returns:
subscription on the given container for current user
Throws:
TdException -  

getSubscription

public TdThreadSubscription getSubscription(TdThread tdt)
                                     throws TdException
Returns the subscription of current user on the given thread, null if the container is not subscribed.
Parameters:
tdt - the thread on which subscription is being requested
Returns:
subscription on the given thread for current user
Throws:
TdException -  

isSubscribed

public boolean isSubscribed(TdContainer tdc)
                     throws TdException
Returns true if there is any subscription on the given container
Parameters:
tdc - container which is being queried for subscription
Returns:
true if the given container is subscribed
Throws:
TdException -  

isSubscribed

public boolean isSubscribed(TdThread tdt)
                     throws TdException
Returns true if there is any subscription on the given thread
Parameters:
tdt - thread which is beign queried fro subscription
Returns:
true if the given thread is subscribed
Throws:
TdException -  

subscribe

public TdSubscription subscribe(TdContainer tdc,
                                int iType)
                         throws TdException
Creates a subscription of the given email and type on the given container
Parameters:
tdc - container for which subscription is being requested
iType - it can only be TdSubscription.EMAIL or TdSubscription.DIGEST
Returns:
TdSubscription
Throws:
TdException -  

subscribe

public TdSubscription subscribe(TdThread tdt,
                                int iType)
                         throws TdException
Creates a subscription of the given email and type on the given thread
Parameters:
tdt - thread for which subscription is being requested
iType - it can only be TdSubscription.EMAIL or TdSubscription.DIGEST
Returns:
TdSubscription
Throws:
TdException -  

unsubscribe

public void unsubscribe(TdSubscription tds)
                 throws TdException
Removes the given subscription
Parameters:
tds - subscription which is being unsubscribed
Throws:
TdException -  

updateSubscription

public void updateSubscription(TdSubscription tds)
                        throws TdException
Updates the given subscription
Parameters:
tds - subscription which is being updated
Throws:
TdException -  

listSubscriptions

public java.util.List listSubscriptions()
                                 throws TdException
Returns all subscriptions for the current user
Returns:
all subscriptions belonging to the current user
Throws:
TdException -  

Oracle Discussions Java API Reference
10g Release 1 (10.1.2)

B25496-01

Copyright © 2002, 2005, Oracle. All rights reserved.