Class AbstractSubscription<R extends SubscriptionResource>
- java.lang.Object
-
- org.silverpeas.core.subscription.service.AbstractSubscription<R>
-
- All Implemented Interfaces:
Subscription
- Direct Known Subclasses:
ComponentSubscription
,NodeSubscription
,PKSubscription
public abstract class AbstractSubscription<R extends SubscriptionResource> extends Object implements Subscription
User: Yohann Chastagnier Date: 19/02/13
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSubscription(SubscriptionSubscriber subscriber, R resource, String creatorId)
Constructor which use by default SubscriptionMethod.SELF_CREATION and null creation date.protected
AbstractSubscription(SubscriptionSubscriber subscriber, R resource, SubscriptionMethod subscriptionMethod, String creatorId, Date creationDate)
The more complete constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
Date
getCreationDate()
Gets the date at which the subscription has been done.String
getCreatorId()
Gets the unique identifier of the user that did the subscription.R
getResource()
Gets the resource on which the subscription is.SubscriptionSubscriber
getSubscriber()
Gets the subscriber.SubscriptionMethod
getSubscriptionMethod()
What is the method used to subscribe to the resource?int
hashCode()
protected void
setCreationDate(Date creationDate)
protected void
setSubscriptionMethod(SubscriptionMethod subscriptionMethod)
-
-
-
Constructor Detail
-
AbstractSubscription
protected AbstractSubscription(SubscriptionSubscriber subscriber, R resource, String creatorId)
Constructor which use by default SubscriptionMethod.SELF_CREATION and null creation date.- Parameters:
subscriber
- id and type of the subscriberresource
- id, type and pk of the resource aimed by the subscriptioncreatorId
- the user id that has handled the subscription
-
AbstractSubscription
protected AbstractSubscription(SubscriptionSubscriber subscriber, R resource, SubscriptionMethod subscriptionMethod, String creatorId, Date creationDate)
The more complete constructor.- Parameters:
subscriber
- id and type of the subscriberresource
- id, type and pk of the resource aimed by the subscriptionsubscriptionMethod
- the way the subscriber has subscribed (for now, himself or forced)creatorId
- the user id that has handled the subscriptioncreationDate
- date of the subscription creation (date when saved)
-
-
Method Detail
-
setSubscriptionMethod
protected void setSubscriptionMethod(SubscriptionMethod subscriptionMethod)
-
setCreationDate
protected void setCreationDate(Date creationDate)
-
getSubscriber
public SubscriptionSubscriber getSubscriber()
Description copied from interface:Subscription
Gets the subscriber. It can be either a user or a group of users. In the case of a group of users, the subscription was done by a user with management rights on the resource.- Specified by:
getSubscriber
in interfaceSubscription
- Returns:
- a
SubscriptionSubscriber
instance representing either the user or the group of users that have subscribed to the given resource.
-
getResource
public R getResource()
Description copied from interface:Subscription
Gets the resource on which the subscription is.- Specified by:
getResource
in interfaceSubscription
- Returns:
- a
SubscriptionResource
instance representing a resource in Silverpeas.
-
getSubscriptionMethod
public SubscriptionMethod getSubscriptionMethod()
Description copied from interface:Subscription
What is the method used to subscribe to the resource? It can be either by the subscriber himself or it can be forced by another user with management rights.- Specified by:
getSubscriptionMethod
in interfaceSubscription
- Returns:
- a
SubscriptionMethod
instance representing the method used to create this subscription.
-
getCreatorId
public String getCreatorId()
Description copied from interface:Subscription
Gets the unique identifier of the user that did the subscription. It can be the identifier of the subscriber or, for forced subscription, it is the identifier of a user with management rights.- Specified by:
getCreatorId
in interfaceSubscription
- Returns:
- the unique identifier of a user.
-
getCreationDate
public Date getCreationDate()
Description copied from interface:Subscription
Gets the date at which the subscription has been done.- Specified by:
getCreationDate
in interfaceSubscription
- Returns:
- a date.
-
-