SAP NetWeaver '04

com.sapportals.wcm.repository.service.subscription
Interface ISubscriptionManager

[contained in: com.sap.km.cm.repository.service.par - km.shared.repository.service.app.subscription_api.jar]
All Superinterfaces:
IRepositoryService

public interface ISubscriptionManager
extends IRepositoryService

Provides methods for creating, modifying, and accessing subscriptions that belong to this ISubscriptionManager.

It also defines methods to get information related to subscriptions like:
- events on a subscribed resource that are relevant to a subscription
- channel which is used to communicate with recipients
- conditions which define circumstances under which a subscription is triggered (follow link behaviour, recursion level and so on)
- attributes which set expiry date, next send date, intervals at which notifications are send
- permissions that restrict actions related to subscriptions

An important features of an ISubscriptionManager is to create a subscription and to return all subscriptions that it manages.

This code example creates a subscription:

 
 ISubscriptionCondition condition = subscriptionManager.createSubscriptionCondition();
 condition.setRidTracking(subscriptionManager.getDefaultConditionRidTracking(myResource));
 ISubscriptionAttributes attributes = manager.createSubscriptionAttributes();
 IChannel channel = ChannelFactory.getInstance().getChannel(ChannelFactory.EMAIL);
 IRecipient recipient  = RecipientFactory.getInstance().getRecipient(clientAreaListResource.getContext().getUser());

 manager.createSubscription(clientAreaListResource.getContext(), "mySubscription", condition, clientAreaListResource, channel, recipient, attributes);
 
 
Note that calling the subscription managers createSubscriptionAttributes() or
createSubscriptionCondition() method initializes the returned objects with default values.
The specified context defines the ownership for the subscription. The user taken from the specified context becomes the owner of the subscription with createSubscription().

Copyright (c) SAP AG

See Also:
ISubscription, ISubscriptionAttributes, ISubscriptionCondition, ISubscriptionConditionEvent, ISubscriptionConditionInterval, ISubscriptionConditionRecursionLevel, ISubscriptionList, ISubscriptionListIterator, SubscriptionException, WcmException, IChannel, IRecipient, IRecipientList, IResource, IResourceList, IResourceContext, IResourceEvent, IRepositoryService

Field Summary
static java.lang.String ACTIVE_PERMISSION
          Permission for a user to create a subscription or to unsubscribe a subscription for himself.
static java.lang.String FOLDER_PERMISSION
          Permission for a user to create a subscription or to unsubscribe a subscription for himself and for others on a hierarchy of folders.
static java.lang.String PASSIVE_PERMISSION
          Permission for a user to create a subscription or to unsubscribe a subscription for himself and for others.
static java.lang.String UNSUBSCRIBE_PERMISSION
          Permission to unsubscribe from a subscription.
 
Method Summary
 boolean checkPermission(IResourceContext context, java.lang.String permissionName, IResource resource)
          Checks subscription permission for the user from the specified context.
 boolean checkPermission(IResourceContext context, java.lang.String permissionName, IResourceList resources)
          Checks whether the user stored in the context has the specified subscription permission for the list of resources.
 IRidList checkResourcesForSubscription(IResourceContext context, java.lang.String owner, IResourceList resources)
          Checks if at least one subscription exists for each given resource.
 IRidList checkRIDsForSubscription(IResourceContext context, java.lang.String owner, IRidList RIDs)
          Checks if at least one subscription exists for each given RID.
 ISubscription createSubscription(IResourceContext context, java.lang.String name, ISubscriptionCondition condition, IResource resource, IChannel channel, IRecipient recipient, ISubscriptionAttributes attributes)
          Creates a new subscription with the specified attributes for one resource and recipient.
 ISubscription createSubscription(IResourceContext context, java.lang.String name, ISubscriptionCondition condition, IResource resource, IChannel channel, IRecipientList recipients, ISubscriptionAttributes attributes)
          Creates a new subscription with the specified attributes for one resource and several recipients.
 ISubscription createSubscription(IResourceContext context, java.lang.String name, ISubscriptionCondition condition, IResourceList resources, IChannel channel, IRecipientList recipients, ISubscriptionAttributes attributes)
          Creates a new subscription with the specified attributes for several resources and recipients.
 ISubscriptionAttributes createSubscriptionAttributes()
          Creates a default ISubscriptionAttributes.
 ISubscriptionCondition createSubscriptionCondition()
          Creates a default ISubscriptionCondition.
 ISubscriptionList createSubscriptionList()
          Creates an empty ISubscriptionList.
 ISubscriptionList deleteSubscriptionsForUser(IResourceContext context, IRecipient deletedUser, IRecipient newUser, boolean replaceOnlyOwnedSubscriptions)
          Deletes all subscriptions for a given user.
This method might be called if a user does no longer exist in the system, and his subscriptions should be clean up.
 java.util.Collection getActiveChannels()
          Gets all active channels, that may be used to create a subscription.
 java.util.Collection getConditionEvents(IResource resource)
          Gets all possible event types related to subscriptions that can occur for the specified resource.
 java.util.Collection getConditionIntervals(IResource resource)
          Gets all available interval types for subscription notification.
 java.util.Collection getConditionRecursionLevels(IResource resource)
          Gets all available subscription recursion levels for a specified resource.
 IChannel getDefaultChannel(IRecipientList recipientList)
          Gets the default channel over all recipients.

The returned channel is a channel that is valid for all recipients, if such a channel can be found.
 ISubscriptionConditionEvent getDefaultConditionEvent(IResource resource)
          Gets the default event type for a specified resource.
 int getDefaultConditionFollowLinks(IResource resource)
          Gets the default behavior for a subscribed link.
 ISubscriptionConditionInterval getDefaultConditionInterval(IResource resource)
          Gets the default interval type for a subscription notification.
 ISubscriptionConditionRecursionLevel getDefaultConditionRecursionLevel(IResource resource)
          Gets the default subscription recursion level for a specified resource.
 int getDefaultConditionRidTracking(IResource resource)
          Gets the RID tracking behavior that is the default for a specified resource.
 java.lang.String getInstanceID()
          Returns the ID of this instance of the manager.
 ISubscriptionList getInvalidChannelSubscriptions()
          Gets all subscriptions that use an inactive channel.

A channel is inactive if it isn't returned by the INotificatorService getChannels() method.
 IRecipientList getInvalidForChannel(IChannel channel, IRecipientList recipients)
          Checks whether a channel is valid for the specified recipients, and returns the recipients for which the channel is invalid.
 IResourceList getInvalidForCondition(ISubscriptionCondition condition, IResourceList resourceList)
          Checks whether a condition is valid for a specified list of resources and returns the resources for which the condition is invalid.
 ISubscriptionConditionRecursionLevel getMaxConditionRecursionLevel(IResource resource)
          Gets the maximum subscription recursion level that is possible for a specified resource.
 ISubscriptionConditionInterval getMinConditionInterval(IResource resource)
          Gets the shortest interval type available for subscription notifications.
 ISubscriptionList getPassiveSubscriptions(IResourceContext context, IRecipient recipient)
          Gets all passive subscriptions for a specified recipient.
 ISubscription getSubscription(IResourceContext context, java.lang.String id)
          Gets the subscription with the specified ID.
 ISubscriptionList getSubscriptions(IResourceContext context, IRecipient recipient, boolean resolveIncludedUsers)
          Returns all matching subscriptions for a specified recipient.
 ISubscriptionList getSubscriptions(IResourceContext context, RID rid, boolean includeSubfolders)
          Gets all subscriptions for a specified rid.
 ISubscriptionList getSubscriptions(IResourceContext context, java.lang.String owner)
          Returns all matching subscriptions for a specified owner.
 ISubscriptionList getSubscriptions(IResourceContext context, java.lang.String owner, IResource resource)
          Returns all matching subscriptions with a specified owner and resource.
 boolean isDefaultChannelActive()
          Checks whether a default channel is active or not.
 boolean isValidChannel(IChannel channel, IRecipient recipient)
          Checks whether a channel is valid for a specified recipient.
 boolean isValidChannel(IChannel channel, IRecipientList recipientList)
          Checks whether a channel is valid for a specified list of recipients.
 boolean isValidCondition(ISubscriptionCondition condition, IResource resource)
          Checks whether a condition is valid for a specified resource.
 boolean isValidCondition(ISubscriptionCondition condition, IResourceList resourceList)
          Checks whether a condition is valid for a specified list of resources.
 void raiseNotification(IResourceEvent event)
          Raises an event which then triggers a subscription notification.
 
Methods inherited from interface com.sapportals.wcm.repository.service.IRepositoryService
acceptServletCall, getDescription, getDescription, getID, getServiceType
 

Field Detail

UNSUBSCRIBE_PERMISSION

public static final java.lang.String UNSUBSCRIBE_PERMISSION
Permission to unsubscribe from a subscription.

ACTIVE_PERMISSION

public static final java.lang.String ACTIVE_PERMISSION
Permission for a user to create a subscription or to unsubscribe a subscription for himself.

PASSIVE_PERMISSION

public static final java.lang.String PASSIVE_PERMISSION
Permission for a user to create a subscription or to unsubscribe a subscription for himself and for others.

FOLDER_PERMISSION

public static final java.lang.String FOLDER_PERMISSION
Permission for a user to create a subscription or to unsubscribe a subscription for himself and for others on a hierarchy of folders.
Method Detail

createSubscription

public ISubscription createSubscription(IResourceContext context,
                                        java.lang.String name,
                                        ISubscriptionCondition condition,
                                        IResourceList resources,
                                        IChannel channel,
                                        IRecipientList recipients,
                                        ISubscriptionAttributes attributes)
                                 throws WcmException
Creates a new subscription with the specified attributes for several resources and recipients.

The subscription is created with the name specified and belongs to the owner that is provided by the context. The combination of name and owner must be unique. The subscription is not created if a subscription with the same owner and name already exists. 

Passing null as an argument for context, name or resourceList causes an exception.
If condition is null, the default conditions as returned by the methods getDefaultCondition...() are used.
If channel is null, the first recipient's default channel is used.
If recipients is null, the user provided by the context (the owner) is used as the recipient.
If attributes is null, the default attributes as returned by createSubscriptionAttributes() are used.
Parameters:
context - specifies the owner of the subscription
name - a String that specifies the name of the subscription
condition - an ISubscriptionCondition that defines the relationship between the subscription and the subscribed resources such as the polling interval, the event to subscribe to, and so on
resourceList - IResourceList names the resources to subscribe to
channel - an IChannel that specifies the medium to use for sending notifications, for example, e-mail. It defines the relationship between the subscription and the recipients.
recipients - an IRecipientList with the recipients of notifications related to the subscription
attributes - an ISubscriptionAttributes object that specifies the details of the subscription such as the expiration date 
Returns:
an ISubscription with the specified attributes
Throws:
SubscriptionException - of the type CREATE_EXISTSif a subscription with the name already exists
SubscriptionException - of the type NOACCESS if the user provided by the context does not have the permissions required
Note: The getType() method returns the type of SubscriptionException.
WcmException - if creation fails due to a problem saving the data to the database

The user provided by the context must have the following service acl entries for the subscribed resources:
ACTIVE_PERMISSIONto create a subscription for oneself
PASSIVE_PERMISSIONto create a subscription for other recipients
FOLDER_PERMISSIONto create a subscription for more than one level of a folder, that is, if getRecursionLevel().getLevel() > 1


deleteSubscriptionsForUser

public ISubscriptionList deleteSubscriptionsForUser(IResourceContext context,
                                                    IRecipient deletedUser,
                                                    IRecipient newUser,
                                                    boolean replaceOnlyOwnedSubscriptions)
                                             throws WcmException
Deletes all subscriptions for a given user.
This method might be called if a user does no longer exist in the system, and his subscriptions should be clean up. For security reasons it can only be called from a valid subscription administrator.
The method can behave in two different ways:
- If called with newUser parameter = null, it will simply delete all active subscriptions and passive subscriptions of the user given with parameter deletedUser. The returned list is always empty in this case.
- If called with a valid newUser parameter, it will assign all active subscriptions of the deletedUser to the given newUser. If the parameter replaceOnlyOwnedSubscriptions is true all passive subscriptions of the deletedUser will be deleted and not assigned to the newUser. If false is passed also the deletedUsers passive subscriptions will be assigned to newUser.
The returned list will contain all subscriptions that couldn't be assigned to the newUser.
Parameters:
context - an IResourceContext of an valid subscription administrator
deletedUser - The IRecipient of a deleted user.
newUser - The IRecipient of the replacement user for the deletedUser. The given new user must exist in the system.
This parameter can be null, if deletedUser's subscriptions should simple be deleted.
replaceOnlyOwnedSubscriptions - true indicates that all passive subscriptions of deletedUser should be deleted and not assigned to newUser. false will also assign the passive subscriptions to the newUser.
This parameter has absolutely no meaning if newUser is null
Returns:
A ISubscriptionList which is always empty if newUser is null.
If newUser is valid it contains all subscriptions that could not be assigned to the newUser.
A subscription cannot be automatically assigned to a newUser, if the newUser does already own a subscription with the same name. Subscriptions must have a unique name for every user.
You can call the ISubscription.setName(String) method to change a subscriptions name.
If parameter context or deletedUser is null the method will return null.
Throws:
WcmException - Throws SubscriptionException of type SubscriptionException.NOACCESS, if given context is not a valid administrator context.

createSubscription

public ISubscription createSubscription(IResourceContext context,
                                        java.lang.String name,
                                        ISubscriptionCondition condition,
                                        IResource resource,
                                        IChannel channel,
                                        IRecipientList recipients,
                                        ISubscriptionAttributes attributes)
                                 throws WcmException
Creates a new subscription with the specified attributes for one resource and several recipients.

The subscription is created with the name specified and belongs to the owner that is provided by the context. The combination of name and owner must be unique. The subscription is not created if a subscription with the same owner and name already exists. 

Passing null as an argument for context, name or resource causes an exception.
If condition is null, the default conditions as returned by the methods getDefaultCondition...() are used.
If channel is null, the first recipient's default channel is used.
If recipients is null, the user provided by the context (the owner) is used as the recipient.
If attributes is null, the default attributes as returned by createSubscriptionAttributes() are used.
Parameters:
context - specifies the owner of the subscription
name - a String that specifies the name of the subscription
condition - an ISubscriptionCondition that defines the relationship between the subscription and the subscribed resource, such as the polling interval, the event to subscribe to, and so on
resource - IResource names the resource to subscribe to
channel - an IChannel that specifies the medium to use for sending notifications, for example, e-mail. It defines the relationship between the subscription and the recipients.
recipients - an IRecipientList with the recipients of notifications related to the subscription
attributes - an ISubscriptionAttributes object that specifies the details of the subscription such as the expiration date 
Returns:
an ISubscription with the specified attributes
Throws:
SubscriptionException - of the type CREATE_EXISTSif a subscription with the same name already exists
SubscriptionException - of the type NOACCESS if the user provided by the context does not have the permissions required
Note: The getType() method returns the type of SubscriptionException.
WcmException - if creation fails due to a problem saving the data to the database

The user provided by the context must have the following service acl entries for the subscribed resource:
ACTIVE_PERMISSIONto create a subscription for oneself
PASSIVE_PERMISSIONto create a subscription for other recipients
FOLDER_PERMISSIONto create a subscription for more than one level of a folder, that is, if getRecursionLevel().getLevel() > 1


createSubscription

public ISubscription createSubscription(IResourceContext context,
                                        java.lang.String name,
                                        ISubscriptionCondition condition,
                                        IResource resource,
                                        IChannel channel,
                                        IRecipient recipient,
                                        ISubscriptionAttributes attributes)
                                 throws WcmException
Creates a new subscription with the specified attributes for one resource and recipient.

The subscription is created with the name specified and belongs to the owner that is provided by the context. The combination of name and owner must be unique. The subscription is not created if a subscription with the same owner and name already exists. 

Passing null as an argument for context, name or resource causes an exception.
If condition is null, the default conditions as returned by the methods getDefaultCondition...() are used.
If channel is null, the recipient's default channel is used.
If recipient is null, the user provided by the context (the owner) is used as the recipient.
If attributes is null, the default attributes as returned by createSubscriptionAttributes() are used.
Parameters:
context - specifies the owner of the subscription
name - a String that specifies the name of the subscription
condition - an ISubscriptionCondition that defines the relationship between the subscription and the subscribed resource, such as the polling interval, the event to subscribe to, and so on
resource - IResource names the resource to subscribe to
channel - an IChannel that specifies the medium to use for sending notifications, for example, e-mail. It defines the relationship between the subscription and the recipient.
recipient - an IRecipient with the recipient of notifications related to the subscription
attributes - an ISubscriptionAttributes object that specifies the details of the subscription such as the expiration date 
Returns:
an ISubscription with the specified attributes
Throws:
SubscriptionException - of the type CREATE_EXISTSif a subscription with the same name already exists
SubscriptionException - of the type NOACCESS if the user provided by the context does not have the permissions required
Note: The getType() method returns the type of SubscriptionException.
WcmException - if creation fails due to a problem saving the data to the database

The user provided by the context must have the following service acl entries for the subscribed resource:
ACTIVE_PERMISSIONto create a subscription for oneself
PASSIVE_PERMISSIONto create a subscription for other recipients
FOLDER_PERMISSIONto create a subscription for more than one level of a folder, that is, if getRecursionLevel().getLevel() > 1


checkRIDsForSubscription

public IRidList checkRIDsForSubscription(IResourceContext context,
                                         java.lang.String owner,
                                         IRidList RIDs)
                                  throws WcmException
Checks if at least one subscription exists for each given RID.

Parameters:
context - an IResourceContext containing information about the user searching for a subscriptions
owner - a String with the owner of the subscriptions to search for
RIDs - a IRidList with the RIDs of the resources to search for
Returns:
an IRidList RIDs a subscription was found for
Throws:
WcmException - if the operation fails

getInvalidChannelSubscriptions

public ISubscriptionList getInvalidChannelSubscriptions()
Gets all subscriptions that use an inactive channel.

A channel is inactive if it isn't returned by the INotificatorService getChannels() method. Inactive channels cannot be used for sending subscriptions, therefore they might be fixed using the changeChannelForSubscriptions(ISubscriptionList, IChannel, boolean) method or might be deleted anyway.

Returns:
A ISubscriptionList containing ISubscription objects that cannot work correctly as their channel is inactive.
See Also:
#changeChannelForSubscriptions(ISubscriptionList, IChannel, boolean), ISubscriptionList, INotificatorService, IChannel

getDefaultChannel

public IChannel getDefaultChannel(IRecipientList recipientList)
                           throws WcmException
Gets the default channel over all recipients.

The returned channel is a channel that is valid for all recipients, if such a channel can be found. Otherwise a SubscriptionException of type "INVALID_CHANNEL" is thrown.
Parameters:
recipientList - A list of recipients for which a common channel should be found, that is valid for each individual recipient.
Returns:
A channel that is valid for every individual recipient in that list
Throws:
WcmException - if a general error occured
SubscriptionException - of type SubscriptionException.INVALID_CHANNEL is thrown if no common channel could be found

getActiveChannels

public java.util.Collection getActiveChannels()
Gets all active channels, that may be used to create a subscription.

Active channels are all channels that are offered by the Notification Service.
Returns:
A collection of IChannel objects, that can be used to create a subscription.
See Also:
INotificatorService, IChannel

checkResourcesForSubscription

public IRidList checkResourcesForSubscription(IResourceContext context,
                                              java.lang.String owner,
                                              IResourceList resources)
                                       throws WcmException
Checks if at least one subscription exists for each given resource.

Parameters:
context - an IResourceContext containing information about the user searching for a subscriptions
owner - a String with the owner of the subscriptions to search for
resources - a IResourceList with the resources to search for
Returns:
an IRidList RIDs a subscription was found for
Throws:
WcmException - if the operation fails

getSubscription

public ISubscription getSubscription(IResourceContext context,
                                     java.lang.String id)
                              throws WcmException
Gets the subscription with the specified ID.

If a subscription with the specified ID can not be found for this manager, null is returned.
Parameters:
context - an IResourceContext containing information about the user searching for a subscription
id - a String with the ID of the subscription to search for
Returns:
an ISubscription with the subscription found or null if a subscription does not exist with the specified ID.
Throws:
WcmException - if the operation fails

getSubscriptions

public ISubscriptionList getSubscriptions(IResourceContext context,
                                          RID rid,
                                          boolean includeSubfolders)
                                   throws WcmException
Gets all subscriptions for a specified rid.

This method can only be called from a valid administrator context.
Parameters:
context - an IResourceContext of an valid subscription administrator
rid - The RID for which to get all subscriptions for.
includeSubfolders - boolean value. If true and rid belongs to a folder, all subscriptions on child resources will be returned as well. Use this flag with caution, as returned list might get very long, as there is no depth limitation.
Returns:
A list of all subscriptions for a resources rid.
Might return null if context or rid was null.
Throws:
WcmException - Throws SubscriptionException of type SubscriptionException.NOACCESS, if given context is not a valid administrator context.

getPassiveSubscriptions

public ISubscriptionList getPassiveSubscriptions(IResourceContext context,
                                                 IRecipient recipient)
                                          throws WcmException
Gets all passive subscriptions for a specified recipient.

This method can only be called from a valid administrator context.
Parameters:
context - an IResourceContext of an valid subscription administrator
recipient - The IRecipient for which to get all passive subscriptions for.
Throws:
WcmException - Throws SubscriptionException of type SubscriptionException.NOACCESS, if given context is not a valid administrator context.

getSubscriptions

public ISubscriptionList getSubscriptions(IResourceContext context,
                                          java.lang.String owner,
                                          IResource resource)
                                   throws WcmException
Returns all matching subscriptions with a specified owner and resource.

Parameters:
context - an IResourceContext containing information about the user searching for subscriptions
owner - a String with the ID of the owner to search for. If this parameter is null, the user taken from the context is used as owner.
resource - the subscribed IResource. If this parameter is null, all subscriptions for the owner are returned.
Returns:
an ISubscriptionList with the subscriptions found. The list is empty if no subscriptions were found.
Throws:
WcmException - if the operation fails

getSubscriptions

public ISubscriptionList getSubscriptions(IResourceContext context,
                                          java.lang.String owner)
                                   throws WcmException
Returns all matching subscriptions for a specified owner.

Same as getSubscriptions(context, owner, null)
Parameters:
context - an IResourceContext containing information about the user searching for subscriptions
owner - a String with the ID of the owner of the subscription. If this parameter is null, the user taken from the context is used as the owner.
Returns:
an ISubscriptionList with the subscriptions found. The list is empty if no subscriptions were found.
Throws:
WcmException - if the operation fails.

getSubscriptions

public ISubscriptionList getSubscriptions(IResourceContext context,
                                          IRecipient recipient,
                                          boolean resolveIncludedUsers)
                                   throws WcmException
Returns all matching subscriptions for a specified recipient.

Parameters:
context - an IResourceContext containing information about the user searching for subscriptions
recipient - an IRecipient with the recipient to search for
resolveIncludedUsers - a boolean true if groups should be recursively resolved when searching for the recipient, false to search only in the top level hierarchy of the recipients
Returns:
an ISubscriptionList with the subscription found. The list is empty if no subscriptions were found.
Throws:
WcmException - if the operation fails

getConditionEvents

public java.util.Collection getConditionEvents(IResource resource)
                                        throws WcmException
Gets all possible event types related to subscriptions that can occur for the specified resource.
The events returned depend on the type of Repository Manager and its services.

Parameters:
resource - the IResource to get the subscribable events for
Returns:
a Collection of ISubscriptionConditionEvents for the specified resource to which a user can subscribe
Throws:
WcmException - if the operation fails

getDefaultConditionEvent

public ISubscriptionConditionEvent getDefaultConditionEvent(IResource resource)
                                                     throws WcmException
Gets the default event type for a specified resource.

Parameters:
resource - the IResource to get the default event for
Returns:
an ISubscriptionConditionEvent with the default event for the specified resource
Throws:
WcmException - if the operation fails

getConditionIntervals

public java.util.Collection getConditionIntervals(IResource resource)
                                           throws WcmException
Gets all available interval types for subscription notification.

Parameters:
resource - the IResource to get the subscribable interval for
Returns:
a Collection of ISubscriptionConditionIntervals with the available interval types
Throws:
WcmException - if the operation fails

getDefaultConditionInterval

public ISubscriptionConditionInterval getDefaultConditionInterval(IResource resource)
                                                           throws WcmException
Gets the default interval type for a subscription notification.
Resources in different repository types allow different subscription intervals.

Parameters:
resource - the IResource for which to get available intervals for subscription notifications
Returns:
a ISubscriptionInterval with the default notification interval for the specified resource
Throws:
WcmException - if the operation fails

getMinConditionInterval

public ISubscriptionConditionInterval getMinConditionInterval(IResource resource)
                                                       throws WcmException
Gets the shortest interval type available for subscription notifications.

Parameters:
resource - the IResource to get the shortest interval for
Returns:
a ISubscriptionInterval with the shortest interval for the specified resource
Throws:
WcmException - if the operation fails

getConditionRecursionLevels

public java.util.Collection getConditionRecursionLevels(IResource resource)
                                                 throws WcmException
Gets all available subscription recursion levels for a specified resource.
The recursion level defines the allowed depth of a subscription in a folder hierarchy.
Parameters:
resource - the IResource to get the recursion levels for
Returns:
a Collection of ISubscriptionConditionRecursionLevels with the available recursion levels
Throws:
WcmException - if the operation fails

getDefaultConditionRecursionLevel

public ISubscriptionConditionRecursionLevel getDefaultConditionRecursionLevel(IResource resource)
                                                                       throws WcmException
Gets the default subscription recursion level for a specified resource.
The recursion level defines the allowed depth of a subscription in a folder hierarchy.
Parameters:
resource - the IResource to get the default recursion level for
Returns:
an ISubscriptionConditionRecursionLevel with the default recursion level
Throws:
WcmException - if the operation fails
See Also:
ISubscriptionConditionRecursionLevel

getDefaultConditionFollowLinks

public int getDefaultConditionFollowLinks(IResource resource)
                                   throws WcmException
Gets the default behavior for a subscribed link.

Three different types of behavior are possible:
- The subscription points to the resource that is the target of the link or a series of links.
It always points to the resource that is the target of the link at subscription creation time.
- The subscription points to the link and not to the resource that is the target of the link.
This means it only registers subscription events that occur on the subscribed link.
Changes to the target resource are not registered.
- The subscription points to the link itself and to the resource that is the target of the link.
The subscription registers changes to both the link and the target of the link.
If the target of the link changes, the new target of the link is subscribed.
Parameters:
resource - the IResource to get the default follow link behavior
Returns:
a int with the default follow link behavior

getDefaultConditionRidTracking

public int getDefaultConditionRidTracking(IResource resource)
                                   throws WcmException
Gets the RID tracking behavior that is the default for a specified resource.

The RID tracking value defines whether subscriptions point to a resource or a RID.
If the subscription points to a resource then a change in RID is irrelevant for the subscription.
Changes to the name or location do not affect the subscription.
If the subscription points to a RID, then a change in RID effects the subscription.
This means that a change to the name or location of the resource, which changes the RID, makes the subscription point to a RID that has no corresponding resource.
Parameters:
resource - the IResource to get the default RID tracking behavior
Returns:
a int with the default RID tracking behavior

getMaxConditionRecursionLevel

public ISubscriptionConditionRecursionLevel getMaxConditionRecursionLevel(IResource resource)
                                                                   throws WcmException
Gets the maximum subscription recursion level that is possible for a specified resource.

If the specified IResource is a resource, the maximum subscription recursion level is 0.
If the specified IResource is a collection, the maximum subscription recursion depends on the depth of the collection.
Parameters:
resource - the IResource to get the default recursion level for
Returns:
a ISubscriptionConditionRecursionLevel with the maximum recursion level
Throws:
WcmException - if the operation fails

isValidCondition

public boolean isValidCondition(ISubscriptionCondition condition,
                                IResourceList resourceList)
                         throws WcmException
Checks whether a condition is valid for a specified list of resources.

This is the same as isValidCondition(condition, resource) but it checks a list of resources and not a single resource.
Parameters:
condition - the ISubscriptionCondition to validate
resourceList - a IResourceList to check
Returns:
a boolean true if the condition is valid, false if not
Throws:
WcmException - if the operation fails

isValidCondition

public boolean isValidCondition(ISubscriptionCondition condition,
                                IResource resource)
                         throws WcmException
Checks whether a condition is valid for a specified resource.

A condition is invalid, for example, if the ALWAYS interval is set on a repository that does not support eventing, or if DELETE events are subscribed on a repository that does not support eventing and that does not have a delta manager.
Parameters:
condition - the ISubscriptionCondition to validate
resource - the IResource to check
Returns:
a boolean true if the condition is valid, false if not
Throws:
WcmException - if the operation fails

getInvalidForCondition

public IResourceList getInvalidForCondition(ISubscriptionCondition condition,
                                            IResourceList resourceList)
                                     throws WcmException
Checks whether a condition is valid for a specified list of resources and returns the resources for which the condition is invalid.

Parameters:
condition - the ISubscriptionCondition to check against resources
resourceList - an IResourceLists to check
Returns:
an IResourceList with the resources that are invalid for the specified condition, null if all resources are valid
Throws:
WcmException - if the operation fails

getInstanceID

public java.lang.String getInstanceID()
Returns the ID of this instance of the manager.

If an instance ID for this manager is specified, it is returned. If not, it returns the ID of the subscription service.
Returns:
a String with the name of this manager's instance ID (if specified). Default is this manager's service ID.

isValidChannel

public boolean isValidChannel(IChannel channel,
                              IRecipientList recipientList)
                       throws WcmException
Checks whether a channel is valid for a specified list of recipients.

This is the same as isValidChannel(condition, recipient) but it checks whether the channel is vaild for a list of recipients.
Parameters:
channel - the IChannel to validate
recipientList - an IRecipientList to check
Returns:
a boolean true if the channel is valid for all recipients, false if not
Throws:
WcmException - if the operation fails

isDefaultChannelActive

public boolean isDefaultChannelActive()
Checks whether a default channel is active or not.

This method informs whether an additional notification channel (i.e. RecentNotifications) is active at the service or not.
Returns:
a boolean true if a default channel is active, false if only notification services channels can be used.

isValidChannel

public boolean isValidChannel(IChannel channel,
                              IRecipient recipient)
                       throws WcmException
Checks whether a channel is valid for a specified recipient.

A channel is invalid if it is not available for a recipient.
Parameters:
channel - the IChannel to validate
recipient - the IRecipient for whom the channel is checked
Returns:
a boolean true if the channel is valid, false if not
Throws:
WcmException - if the operation fails

getInvalidForChannel

public IRecipientList getInvalidForChannel(IChannel channel,
                                           IRecipientList recipients)
                                    throws WcmException
Checks whether a channel is valid for the specified recipients, and returns the recipients for which the channel is invalid.

A channel is invalid if it is not available for a recipient.
Parameters:
channel - the IChannel to validate
recipients - the IRecipientList to check
Returns:
an IRecipientList with the recipients for which the specified channel is invalid, null if all recipients are valid
Throws:
WcmException - if the operation fails

raiseNotification

public void raiseNotification(IResourceEvent event)
                       throws WcmException
Raises an event which then triggers a subscription notification.

Parameters:
event - the IResourceEvent on a resource that triggers notification
Throws:
WcmException - if the operation fails

createSubscriptionList

public ISubscriptionList createSubscriptionList()
                                         throws WcmException
Creates an empty ISubscriptionList.

Returns:
an empty ISubscriptionList
Throws:
WcmException - if the list can not be created

createSubscriptionAttributes

public ISubscriptionAttributes createSubscriptionAttributes()
                                                     throws WcmException
Creates a default ISubscriptionAttributes.

The returned ISubscriptionAttributes is initialized with null values.
Returns:
certain default ISubscriptionAttributes.
Throws:
WcmException - if the attributes can not be created

createSubscriptionCondition

public ISubscriptionCondition createSubscriptionCondition()
                                                   throws WcmException
Creates a default ISubscriptionCondition.

The returned ISubscriptionCondition is initialized with default values.
The getDefaultCondition... methods of the ISubscriptionManager determine individual default values.
Returns:
a default ISubscriptionCondition.
Throws:
WcmException - if the condition can not be created

checkPermission

public boolean checkPermission(IResourceContext context,
                               java.lang.String permissionName,
                               IResourceList resources)
                        throws WcmException
Checks whether the user stored in the context has the specified subscription permission for the list of resources.
For a list of defined subscription permissions see the field definition for the ISubscriptionManager.
If one parameter is null, a WcmException is thrown.
Parameters:
context - the IResourceContext that stores the user
permissionName - a String with the subscription permission to check
resources - an IResourceList with the resources to check
Returns:
a boolean true if the user has the required permission, false if not
Throws:
WcmException - if the acl can not be retrieved, the IResourceList is empty, or the permission name is unknown

checkPermission

public boolean checkPermission(IResourceContext context,
                               java.lang.String permissionName,
                               IResource resource)
                        throws WcmException
Checks subscription permission for the user from the specified context.

If one parameter is null, a WcmException is thrown.
Parameters:
context - the IResourceContext to get the user from
permissionName - a String with the subscription permission to check
resource - an IResource to check
Returns:
a boolean true if the user has the required permission, false if not
Throws:
WcmException - if the acl can not be retrieved, the IResource is empty, or the permission name is unknown

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.