public interface ISubscription
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 ISubscriptionManager
manages 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.
ISubscription subscription = subscriptionManager.createSubscription(context,
name,
condition,
resources,
channel,
recipients,
attributes);
public boolean isUserSubscribed(IRecipient user) {
return subscription.isUnsubscribed(user);
}
Copyright (c) SAP AGModifier and Type | Method and Description |
---|---|
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. |
String |
getID()
Gets the ID of the subscription.
|
Date |
getLastCheckDate()
Gets the last date the subscription was checked for changes.
|
Date |
getLastModifiedDate()
Gets the date of the last modification of the subscription.
|
ISubscriptionManager |
getManager()
Gets the subscription manager for this subscription.
|
String |
getName()
Gets the name of the subscription that is displayed.
|
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(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.
|
ISubscriptionManager getManager()
ISubscriptionManager
that manages this
subscriptionString getID()
String
with the unique ID for this
subscription and managerString getName() throws WcmException
String
with a (displayable) name for this
subscription.WcmException
- if the operation failsvoid setName(String newName) throws WcmException
newName
- The new name of the subscription.WcmException
- if the operation failsString getOwner() throws WcmException
ISubscriptionManager
s createSubscription(...)
method while
creating this subscription.String
with the ID of the user who owns (created)
this subscriptionWcmException
- if the operation fails.Date getLastModifiedDate() throws WcmException
Date
with the timestamp of the last modification
of the subscriptionWcmException
- if the operation fails.Date getLastCheckDate() throws WcmException
Date
with the timestamp of the last check for
the subscriptionWcmException
- if the operation failsISubscription 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 failsISubscription 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 failsISubscription 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 failsISubscription 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 notificationsrecipients
- 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 failsISubscriptionAttributes getAttributes() throws WcmException
ISubscriptionAttributes
, as the set of customizable
attributes for this subscriptionWcmException
- if the operation failsvoid setAttributes(ISubscriptionAttributes attributes) throws WcmException
attributes
- the ISubscriptionAttributes
to use for
this subscriptionWcmException
- if the operation failsISubscriptionCondition getCondition() throws WcmException
ISubscriptionCondition
with the conditions used
by this subscriptionWcmException
- if the operation failsboolean 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 failsvoid 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 failsIUriList 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.IUriList
s with the URIs of the resources assigned
to this subscriptionWcmException
- if the operation failsIRidList getRIDs() throws WcmException
null
values for the
RIDs belonging to a resource that was subscribed to but is now deleted or hidden.IRidList
s with the RIDs of the resources assigned
to this subscriptionWcmException
- if the operation failsIResourceList getResources() throws WcmException
null
values for
resources that are subscribed to but have been deleted or are invisible.IResourceList
s with the resources assigned
to this subscriptionWcmException
- if the operation failsvoid setResources(IResourceList resourceList) throws WcmException
resourceList
- an IResourceList
s of resources to be
assigned to this subscriptionWcmException
- if the operation failsvoid setResource(IResource resource) throws WcmException
resource
- an IResources
to be assigned to this
subscriptionWcmException
- if the operation failsvoid 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
resourceboolean 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.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 null
WcmException
- if the operation failedIChannel getChannel() throws WcmException
IChannel
that is used for sending notifications on this subscriptionWcmException
- if the operation failsboolean 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 failsvoid 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 failsIRecipientList getRecipients() throws WcmException
IRecipientList
of active recipients for this subscriptionWcmException
- if the operation failsIRecipientList getSubscribedRecipients() throws WcmException
IRecipientList
of recipients assigned to this subscriptionWcmException
- if the operation failsIRecipientList getUnsubscribedRecipients() throws WcmException
IRecipientList
with recipients who are no longer assigned to this subscriptionWcmException
- if the operation failsvoid 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 failsvoid setRecipient(IRecipient recipient) throws WcmException
recipient
- an IRecipient
to send subscription
notifications toWcmException
- if the operation failsvoid 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.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 failsvoid 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.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 failsboolean 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 failsboolean isUnsubscribed() throws WcmException
boolean
true
if all recipients of this
subscription are already unsubscribedWcmException
- if the operation failsboolean 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 failsvoid 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.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 deletedboolean setOwner(IRecipient newOwner) throws WcmException
newOwner
- an IRecipient
who is the new owner of this subscriptionWcmException
- if the operation failsAccess Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2018 SAP AG Complete Copyright Notice