|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Represents a single subscription and provides methods to
define, modify and access the details of a subscription.
Important details of a subscription are the:
- resources that are subscribed to
- recipients who get notifications
- channel that is used to communicate with recipients
- attributes that define a notification text, notification interval,
expiry date and next send date for a notification
- condition that specifies the events carried out on a resource that are
relevant for the subscription, for example,
deletion. It also sets an interval at which resources are checked
and notifications are sent. In the case of a collection, it also
specifies how many levels of the hierarchy (recursion level) are
relevant for the subscription.
The ISubscriptionManageradministrates all existing
subscriptions.
Only the owner of a subscription or an administrator can change
or delete a subscription. The owner is the user taken from the IResourceContext
that is specified when the createSubscription or getSubscription
methods of the ISubscriptionManager are
called.
The code sample creates a subscription and finds out whether a
user has subscribed:
ISubscription subscription = subscriptionManager.createSubscription(context,
name,
condition,
resources,
channel,
recipients,
attributes);
public boolean isUserSubscribed(IRecipient user) {
return subscription.isUnsubscribed(user);
}
Copyright (c) SAP AG
ISubscriptionManager,
IRecipient,
IChannel,
IResource,
ISubscriptionCondition,
ISubscriptionAttributes| Method Summary | |
void |
addRecipient(IRecipient recipient)
Adds a recipient to the subscription. |
void |
addResource(IResource resource)
Adds a resource to the subscription. |
void |
delete()
Deletes the subscription. |
ISubscriptionAttributes |
getAttributes()
Gets the customizable attributes (like expiration date) of the subscription. |
IChannel |
getChannel()
Gets the channel that is used for sending notifications to the recipients. |
ISubscriptionCondition |
getCondition()
Gets the conditions (subscribed event, follow link, interval, RID tracking and recursion level) which leads to a notification for the subscription. |
java.lang.String |
getID()
Gets the ID of the subscription. |
java.util.Date |
getLastCheckDate()
Gets the last date the subscription was checked for changes. |
java.util.Date |
getLastModifiedDate()
Gets the date of the last modification of the subscription. |
ISubscriptionManager |
getManager()
Gets the subscription manager for this subscription. |
java.lang.String |
getName()
Gets the name of the subscription that is displayed. |
java.lang.String |
getOwner()
Gets the owner of the subscription. |
IRecipientList |
getRecipients()
Gets the recipients of the subscription notifications. |
IResourceList |
getResources()
Gets the resources assigned to the subscription. |
IRidList |
getRIDs()
Gets the RIDs of the resources assigned to the subscription. |
IRecipientList |
getSubscribedRecipients()
Gets the recipients of the subscription that have not unsubscribed. |
IRecipientList |
getUnsubscribedRecipients()
Gets the recipients of the subscription that have unsubscribed. |
IUriList |
getURIs()
Deprecated. As of EP 5.0 SP2, replaced by getRIDs() |
boolean |
isOnlyRecipient(IRecipient recipient)
Checks if a recipient is the only recipient of a subscription. |
boolean |
isOnlyResource(IResource resource)
Checks if a resource is the only resource of a subscription. |
boolean |
isUnsubscribed()
Checks whether all recipients are unsubscribed. |
boolean |
isUnsubscribed(IRecipient recipient)
Checks whether a recipient is unsubscribed. |
boolean |
isValidChannel(IChannel channel)
Checks if a given channel is valid for this subscription's recipients. |
boolean |
isValidCondition(ISubscriptionCondition condition)
Checks if a specified condition is valid for this subscription. |
boolean |
removeRecipient(IRecipient recipient)
Removes a recipient from the subscription. |
boolean |
removeResource(IResource resource)
Removes a resource from the subscription. |
void |
resetRecipient(IRecipient recipient)
Reactivates all unsubscribed recipients for this subscription. |
void |
resetRecipients(IRecipientList recipientList)
Resets recipients for the subscription notifications. |
ISubscription |
set(ISubscriptionCondition condition,
IResource resource,
IChannel channel,
IRecipient recipient,
ISubscriptionAttributes attributes)
Changes or sets multiple parameters for a subscription in one operation. |
ISubscription |
set(ISubscriptionCondition condition,
IResource resource,
IChannel channel,
IRecipientList recipients,
ISubscriptionAttributes attributes)
Changes or sets multiple parameters for a subscription in one operation. |
ISubscription |
set(ISubscriptionCondition condition,
IResourceList resources,
IChannel channel,
IRecipient recipient,
ISubscriptionAttributes attributes)
Changes or sets multiple parameters for a subscription in one operation. |
ISubscription |
set(ISubscriptionCondition condition,
IResourceList resources,
IChannel channel,
IRecipientList recipients,
ISubscriptionAttributes attributes)
Changes or sets multiple parameters for a subscription in one operation. |
void |
setAttributes(ISubscriptionAttributes attributes)
Sets the customizable attributes of a subscription. |
void |
setChannel(IChannel channel)
Sets the channel to use for sending notifications to the recipients. |
void |
setCondition(ISubscriptionCondition condition)
Sets the subscription conditions (subscribed event, follow link, interval, RID tracking and recursion level) for which the subscription sends notifications. |
void |
setName(java.lang.String newName)
Renames a subscription to a given new name. |
boolean |
setOwner(IRecipient newOwner)
Sets a new owner for this subscription. |
void |
setRecipient(IRecipient recipient)
Resets the subscription's recipient. |
void |
setRecipients(IRecipientList recipientList)
Resets the subscription's recipients. |
void |
setResource(IResource resource)
Resets the subscription's resource. |
void |
setResources(IResourceList resourceList)
Resets the subscription's resources. |
void |
unsubscribe(IRecipient recipient)
Unsubscribes a recipient and stops the subscription notifications for this recipient. |
| Method Detail |
public ISubscriptionManager getManager()
ISubscriptionManager that manages this
subscriptionpublic java.lang.String getID()
String with the unique ID for this
subscription and manager
public java.lang.String getName()
throws WcmException
String with a (displayable) name for this
subscription.WcmException - if the operation fails
public void setName(java.lang.String newName)
throws WcmException
newName - The new name of the subscription.WcmException - if the operation fails
public java.lang.String getOwner()
throws WcmException
ISubscriptionManagers createSubscription(...) method while
creating this subscription.String with the ID of the user who owns (created)
this subscriptionWcmException - if the operation fails.
public java.util.Date getLastModifiedDate()
throws WcmException
Date with the timestamp of the last modification
of the subscription
public java.util.Date getLastCheckDate()
throws WcmException
Date with the timestamp of the last check for
the subscriptionWcmException - if the operation fails
public ISubscription set(ISubscriptionCondition condition,
IResource resource,
IChannel channel,
IRecipient recipient,
ISubscriptionAttributes attributes)
throws WcmException
null is specified for a parameter, the subscription's current
values are used.condition - an ISubscriptionCondition with the condition
to use for this subscriptionresource - an IResource to be assigned to this
subscriptionchannel - an IChannel to use for sending notificationsrecipient - an IRecipient to send subscription
notifications toattributes - the ISubscriptionAttributes to use for
this subscriptionISubscription, with the new attributesWcmException - if the operation fails
public ISubscription set(ISubscriptionCondition condition,
IResourceList resources,
IChannel channel,
IRecipient recipient,
ISubscriptionAttributes attributes)
throws WcmException
null is specified for a parameter, the subscription's current
values are used.condition - an ISubscriptionCondition with the condition
to use for this subscriptionresources - an IResourceList with a list of resources
to be assigned to this subscriptionchannel - an IChannel to use for sending notificationsrecipient - an IRecipient to send subscription
notifications toattributes - the ISubscriptionAttributes to use for
this subscriptionISubscription, with the new attributesWcmException - if the operation fails
public ISubscription set(ISubscriptionCondition condition,
IResource resource,
IChannel channel,
IRecipientList recipients,
ISubscriptionAttributes attributes)
throws WcmException
null is specified for a parameter, the subscription's current
values are used.condition - an ISubscriptionCondition with the condition
to use for this subscriptionresource - an IResource to be assigned to this
subscriptionchannel - an IChannel to use for sending notificationsrecipients - an IRecipientList of recipients to
send subscription notifications toattributes - the ISubscriptionAttributes to use for
this subscriptionISubscription, with the new attributesWcmException - if the operation fails
public ISubscription set(ISubscriptionCondition condition,
IResourceList resources,
IChannel channel,
IRecipientList recipients,
ISubscriptionAttributes attributes)
throws WcmException
null is specified for a parameter, the subscription's current
values are used.condition - an ISubscriptionCondition with the conditions
to use for this subscriptionresources - an IResourcesList with a list of resources to
be assigned to this subscriptionchannel - an IChannel to use for sending notificationsrecipient - an IRecipientList with a list of recipients
to send subscription notifications toattributes - the ISubscriptionAttributes to use for
this subscriptionISubscription, with the new attributesWcmException - if the operation fails
public ISubscriptionAttributes getAttributes()
throws WcmException
ISubscriptionAttributes, as the set of customizable
attributes for this subscriptionWcmException - if the operation fails
public void setAttributes(ISubscriptionAttributes attributes)
throws WcmException
attributes - the ISubscriptionAttributes to use for
this subscriptionWcmException - if the operation fails
public ISubscriptionCondition getCondition()
throws WcmException
ISubscriptionCondition with the conditions used
by this subscriptionWcmException - if the operation fails
public boolean isValidCondition(ISubscriptionCondition condition)
throws WcmException
condition is null the default
ISubscriptionCondition values for the first subscribed resource are taken.condition - an ISubscriptionCondition to check against
this subscription's conditionsboolean true if the condition is
valid for this subscription,false if notWcmException - if the operation fails
public void setCondition(ISubscriptionCondition condition)
throws WcmException
condition is null the default
ISubscriptionCondition values of the first subscribed resource are usedcondition - an ISubscriptionCondition with the condition
to use for this subscriptionWcmException - if the operation fails
public boolean setOwner(IRecipient newOwner)
throws WcmException
newOwner - an IRecipient who is the new owner of this subscriptionWcmException - if the operation fails
public IUriList getURIs()
throws WcmException
getRIDs()
null values for the
URIs belonging to a resource that was subscribed to but is now deleted or hidden.getRIDs() instead.IUriLists with the URIs of the resources assigned
to this subscriptionWcmException - if the operation fails
public IRidList getRIDs()
throws WcmException
null values for the
RIDs belonging to a resource that was subscribed to but is now deleted or hidden.IRidLists with the RIDs of the resources assigned
to this subscriptionWcmException - if the operation fails
public IResourceList getResources()
throws WcmException
null values for
resources that are subscribed to but have been deleted or are invisible.IResourceLists with the resources assigned
to this subscriptionWcmException - if the operation fails
public void setResources(IResourceList resourceList)
throws WcmException
resourceList - an IResourceLists of resources to be
assigned to this subscriptionWcmException - if the operation fails
public void setResource(IResource resource)
throws WcmException
resource - an IResources to be assigned to this
subscriptionWcmException - if the operation fails
public void addResource(IResource resource)
throws WcmException
resource - an IResource to add
to the subscription's resourcesWcmException - if the operation failed or the parameter was null.SubscriptionException - with type
NOACCESS, if the user taken from the context does not
own the subscription,UNKNOWN_ID, if the subscription
has already been deleted,INVALID_CONDITION if the
condition of the subscription will become invalid due to this
resource
public boolean isOnlyResource(IResource resource)
throws WcmException
resource - an IResource that should be checked to see if it is
the only resource for the subscription in questionboolean true if the resource is the
only one assigned to the subscriptionWcmException - if the operation failed.
public boolean removeResource(IResource resource)
throws WcmException
resource is null, false is returnedresource - an IResource with the resource object to be
removed from the subscriptionboolean true if the entire
subscription was deleted, false if only the resource
was removed from the subscription or the parameter resource was nullWcmException - if the operation failed
public IChannel getChannel()
throws WcmException
IChannel that is used for sending notifications on this subscriptionWcmException - if the operation fails
public boolean isValidChannel(IChannel channel)
throws WcmException
channel is null, the channel of the subscription's
owner is used.channel - an IChannel to check against the recipients of
this subscriptionboolean true if the channel is
valid for this subscription's recipients,false if notWcmException - if the operation fails
public void setChannel(IChannel channel)
throws WcmException
channel is null the channel of the
subscription's owner is used.channel - an IChannel to use for sending notificationsWcmException - if the operation fails
public IRecipientList getRecipients()
throws WcmException
IRecipientList of active recipients for this subscriptionWcmException - if the operation fails
public IRecipientList getSubscribedRecipients()
throws WcmException
IRecipientList of recipients assigned to this subscriptionWcmException - if the operation fails
public IRecipientList getUnsubscribedRecipients()
throws WcmException
IRecipientList with recipients who are no longer assigned to this subscriptionWcmException - if the operation fails
public void setRecipients(IRecipientList recipientList)
throws WcmException
IRecipientList.IRecipientList and already belonged to this subscription
keep their unsubscribe flag, if they were unsubscribed.recipientList - an IRecipientList with recipients to send
the subscription notifications toWcmException - if the operation fails
public void setRecipient(IRecipient recipient)
throws WcmException
recipient - an IRecipient to send subscription
notifications toWcmException - if the operation fails
public void resetRecipients(IRecipientList recipientList)
throws WcmException
recipientList is null, the subscription owner is used.recipientList - an IRecipientList with recipients to send
the subscription notifications toWcmException - if the operation failsSubscriptionException - with
INVALID_CHANNEL if the channel of the
subscription is invalid for the reactivated recipients.
public void resetRecipient(IRecipient recipient)
throws WcmException
recipient is null, the subscription owner is used.recipient - an unsubscribed IRecipient that should now receive subscription
notifications againWcmException - if the operation fails
public void addRecipient(IRecipient recipient)
throws WcmException
recipient - an IRecipient to add to the recipient
list of this subscriptionWcmException - if the operation failsSubscriptionException - with typeNOACCESS, if the user taken from the context does not
own the subscription,UNKNOWN_ID, if the subscription
has already been deleted,INVALID_CHANNEL if the
channel of the subscription will become invalid due to this
recipient.
public boolean isOnlyRecipient(IRecipient recipient)
throws WcmException
recipient is null, the subscription
owner is checked.recipient - an IRecipient that should be checked to see if it's
the only recipient for the subscription in questionboolean true if the recipient is the
only one assigned to the subscriptionWcmException - if the operation fails
public boolean removeRecipient(IRecipient recipient)
throws WcmException
recipient is null the subscription
owner is used.recipient - an IRecipient that should be removed from this subscriptionboolean true if the entire
subscription is deleted,false if only the given recipient
is removed from the subscriptionWcmException - if the operation fails
public boolean isUnsubscribed()
throws WcmException
boolean true if all recipients of this
subscription are already unsubscribedWcmException - if the operation fails
public boolean isUnsubscribed(IRecipient recipient)
throws WcmException
recipient is null the
owner of the subscription is checked.recipient - an IRecipient with the recipient to be
checked to see if he is unsubscribedboolean true if the recipient is not
found in the list of the subscription's recipients or if the
recipient is marked as unsubscribed,false if the
recipient is still subscribed to this subscriptionWcmException - if the operation fails
public void unsubscribe(IRecipient recipient)
throws WcmException
IRecipient is possible with the
resetRecipient(IRecipient) method.recipient is null subscription owner is used.recipient - an IRecipient to be unsubscribedWcmException - if the operation fails.
public void delete()
throws WcmException
createSubscription()) or an adminstrative user.WcmException - if the deletion failsSubscriptionException - with type
NOACCESS, if the user taken from the context does not
own the subscription,UNKNOWN_ID, if the subscription
has already been deleted
|
SAP NetWeaver '04 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||