Copyright© 2008-2022 Sitevision AB, all rights reserved.
@Requireable(value="SubscriberUtil") public interface SubscriberUtil
Subscriber utility interface.
An instance of the Sitevision class implementing this interface can be obtained via
Utils.getSubscriberUtil().
See Utils for how to obtain an instance of the Utils interface.
To find an active subscription, use the property isActiveSubscription or the convenience method
SubscriptionUtil.getActiveSubscription(javax.jcr.Node). An active subscription is either sv:site, sv:page,
sv:archive or sv:article where the subscription functionality has been activated.
More information about subscriptions can be found in the Sitevision help pages.
A subscriber is either an e-mail or a phone number. Phone number is only available if the Sitevision licence contains the feature "sms".
The write methods are fully synchronized and will never throw ConcurrentModificationExceptions.
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSubscriber(Node anActiveSubscription,
String aSubscriber)
Method used to add an e-mail or phone number as a subscriber to the active subscription.
|
Set<String> |
getSubscribers(Node anActiveSubscription)
Access to a
Set of subscribers (i.e. e-mail and / or phone numbers) for an active subscription. |
boolean |
isSubscriber(Node anActiveSubscription,
String aSubscriber)
Finds out if an e-mail of phone number is already a subscriber to the active subscription.
|
boolean |
removeSubscriber(Node anActiveSubscription,
String aSubscriber)
Removes an e-mail or phone number from the subscribers of the active subscription.
|
Set<String> getSubscribers(Node anActiveSubscription)
Access to a Set of subscribers (i.e. e-mail and / or phone numbers) for an active subscription.
This method will never throw exceptions.
anActiveSubscription - the active subscription NodeSet of String with the subscribers. Will never return nullboolean addSubscriber(Node anActiveSubscription, String aSubscriber)
Method used to add an e-mail or phone number as a subscriber to the active subscription. If the subscriber is already a subscriber nothing will be done.
This method will not throw exceptions.
anActiveSubscription - the active subscription NodeaSubscriber - a String containing the e-mail or phone number of the subscriberboolean removeSubscriber(Node anActiveSubscription, String aSubscriber)
Removes an e-mail or phone number from the subscribers of the active subscription. If the subscriber is not a subscriber nothing will be done.
This method will not throw exceptions.
anActiveSubscription - the active subscription NodeaSubscriber - a String containing the e-mail or phone number of the subscriberboolean isSubscriber(Node anActiveSubscription, String aSubscriber)
Finds out if an e-mail of phone number is already a subscriber to the active subscription.
Note that this method is much faster than getSubscribers(anActiveSubscription).contains(aSubscriber)
This method will not throw exceptions.
anActiveSubscription - the active subscription NodeaSubscriber - a String containing the e-mail or phone number of the subscriberSitevision - Portal and Content Management Made Easy
Sitevision is an advanced Java enterprise portal product and a portlet container (JSR 286) that implements Java Content Repository (JSR 283).
Copyright© 2008-2022 Sitevision AB, all rights reserved.