Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


oracle.webcenter.notification
Interface SubscriptionManager


public interface SubscriptionManager

Interface for creating and managing user subscriptions.

Based on these subscriptions, the notification service generates appropriate notifications for the activities occurring in the application. Notifications Service integrates with WebCenter Activity Streaming Service to generate notifications for services that contains activities supporting notifications.

Subscriptions can be created or enabled at application level, scope level and object level to control to receive notifications at the desired granularity.

In general, subscriptions can be created only for services and resources that support the specific level of subscriptions.

See Also:
Subscription, SubscriptionPreference, NotificationServiceFactory

Method Summary
 void addSubcriptionPreference(java.lang.String serviceId)
          Enables the application level subscription preference for the current user for the given service.
 java.util.List<SubscriptionPreference> getSubscriptionPreferences()
          Returns the application level subscription preferences for the current user.
 java.util.List<SubscriptionPreference> getSubscriptionPreferences(java.lang.String scopeGuid)
          Returns the scope level subscription preferences for the current user.
 java.util.List<Subscription> getSubscriptions(SortOption sortOption, FilterOption filterOption, int startIndex, int fetchSize)
          Returns the list of active subscriptions for the current user based on the specified criteria.
 boolean isSubscribed(java.lang.String scopeGuid, java.lang.String serviceId, java.lang.String objectId)
          Checks if the current user has subscribed to the specific resource in the given scope.
 void removeSubcriptionPreference(java.lang.String serviceId)
          Disables the application level subscription preference for the current user for the given service, if exists.
 Subscription subscribe(java.lang.String scopeGuid, java.lang.String serviceId)
          Creates a scope level subscription for the current user for the specified service in the given scope.
 Subscription subscribe(java.lang.String scopeGuid, java.lang.String serviceId, java.lang.String objectType, java.lang.String objectId, java.lang.String objectName)
          Subscribes the current user for the given object.
 void unsubscribe(java.lang.String scopeGuid, java.lang.String serviceId)
          Removes the scope level subscription for the current user for the specified service in the given scope, if exists.
 void unsubscribe(java.lang.String scopeGuid, java.lang.String serviceId, java.lang.String objectId)
          Unsubscribes the current user from the given object.

 

Method Detail

isSubscribed

boolean isSubscribed(java.lang.String scopeGuid,
                     java.lang.String serviceId,
                     java.lang.String objectId)
                     throws NotificationServiceException
Checks if the current user has subscribed to the specific resource in the given scope.
Parameters:
scopeGuid - - the guid of the scope in which to check subscription.
serviceId - - the service identifier for the resource.
objectId - - the unique ID of the object to check the subscription for.
Returns:
- true, if the current user has subscribed to the given object, false otherwise.
Throws:
NotificationServiceException - - if the notification servie encounters any error.

getSubscriptionPreferences

java.util.List<SubscriptionPreference> getSubscriptionPreferences()
                                                                  throws NotificationServiceException
Returns the application level subscription preferences for the current user. This method returns a list of SubscriptionPreference for the current user for services that expose application level subscriptions. This method is also useful in retrieving the list of services that support application level subscriptions.
Returns:
list of SubscriptionPreference for the current user.
Throws:
NotificationServiceException - - if the notification servie encounters any error.

getSubscriptionPreferences

java.util.List<SubscriptionPreference> getSubscriptionPreferences(java.lang.String scopeGuid)
                                                                  throws NotificationServiceException
Returns the scope level subscription preferences for the current user. This method returns a list of SubscriptionPreference for the current user for services that expose application level subscriptions and are provisioned in a given scope.
Parameters:
scopeGuid - - the GUID of the scope for which to return the user's subscription preferences.
Returns:
list of SubscriptionPreference for the current user in the given scope.
Throws:
NotificationServiceException - - if the notification servie encounters any error.

addSubcriptionPreference

void addSubcriptionPreference(java.lang.String serviceId)
                              throws NotificationServiceException
Enables the application level subscription preference for the current user for the given service. The service specified must support such subscription.
Parameters:
serviceId - - the sevrice identifier for which the current user's subscription will be enabled.
Throws:
NotificationServiceException - - if the notification service encounters any exception or if the specified service doesn't support application level subscriptions.

removeSubcriptionPreference

void removeSubcriptionPreference(java.lang.String serviceId)
                                 throws NotificationServiceException
Disables the application level subscription preference for the current user for the given service, if exists.
Parameters:
serviceId - - the service identifier for which the current user's subscription will be disabled.
Throws:
NotificationServiceException - - if the notification servie encounters any error.

getSubscriptions

java.util.List<Subscription> getSubscriptions(SortOption sortOption,
                                              FilterOption filterOption,
                                              int startIndex,
                                              int fetchSize)
                                              throws NotificationServiceException
Returns the list of active subscriptions for the current user based on the specified criteria.

The list returned does not contain user's application level subscription preferences. It returns all the scope level and object level subscriptions for the current users.

Parameters:
filterOption - - defines the filter criteria to fetch the subscriptions for the current user.
sortOption - - the sort criteria for the list of returned subscriptions.
startIndex - - the starting index for fetching the results.
fetchSize - - the number of rows to be returned in the single fetch.
Returns:
list of Subscription objects for the current user matching the criteria specified.
Throws:
NotificationServiceException - - if the notification servie encounters any error.

subscribe

Subscription subscribe(java.lang.String scopeGuid,
                       java.lang.String serviceId)
                       throws NotificationServiceException
Creates a scope level subscription for the current user for the specified service in the given scope. The specified service must support scope level subscriptions.
Parameters:
scopeGuid - - GUID of the scope in which to create the subscription.
serviceId - - the service identifier for which to create the subscription.
Returns:
- the newly created Subscription object.
Throws:
NotificationServiceException - - if the notification service encounters any exception.

subscribe

Subscription subscribe(java.lang.String scopeGuid,
                       java.lang.String serviceId,
                       java.lang.String objectType,
                       java.lang.String objectId,
                       java.lang.String objectName)
                       throws NotificationServiceException
Subscribes the current user for the given object.
Parameters:
scopeGuid - - GUID of the scope in which the object exists.
serviceId - - indentifier of the service containing the object.
objectType - - the type of the object to be subscribed to.
objectId - - the unique identifier of the object as generated by the service.
objectName - - the name of the object.
Returns:
- the newly created Subscription object.
Throws:
NotificationServiceException - - if the notification service encounters any exception.

unsubscribe

void unsubscribe(java.lang.String scopeGuid,
                 java.lang.String serviceId)
                 throws NotificationServiceException
Removes the scope level subscription for the current user for the specified service in the given scope, if exists.
Parameters:
scopeGuid - - GUID of the scope in which to create the subscription.
serviceId - - the service identifier for which to delete the subscription.
Throws:
NotificationServiceException - - if the notification service encounters any exception.

unsubscribe

void unsubscribe(java.lang.String scopeGuid,
                 java.lang.String serviceId,
                 java.lang.String objectId)
                 throws NotificationServiceException
Unsubscribes the current user from the given object.
Parameters:
scopeGuid - - GUID of the scope in which the object exists.
serviceId - - indentifier of the service containing the object.
objectId - - the unique identifier of the object as generated by the service.
Throws:
NotificationServiceException - - if the notification service encounters any exception.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter
11g Release 1 (11.1.1.4.0)
E15995-03


Copyright © 2009, 2011, Oracle and/or its affiliates. All rights reserved.