Class AbstractSubscriptionBean
- java.lang.Object
-
- org.silverpeas.core.web.subscription.bean.AbstractSubscriptionBean
-
- All Implemented Interfaces:
Subscription
- Direct Known Subclasses:
CalendarSubscriptionBean
,ComponentSubscriptionBean
,NodeSubscriptionBean
,PublicationSubscriptionBean
public abstract class AbstractSubscriptionBean extends Object implements Subscription
Abstract class that defines all the common properties of the different concrete type of a subscription.- Author:
- Yohann Chastagnier Date: 25/02/13
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractSubscriptionBean(Subscription subscription, SilverpeasComponentInstance component, String language)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SilverpeasComponentInstance
getComponent()
Gets the component data.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.protected Group
getGroup()
Gets the group data.String
getLanguage()
String
getLink()
Gets the link to access the resource.String
getPath()
Gets the path.SubscriptionResource
getResource()
Gets the resource on which the subscription is.SpaceInstLight
getSpace()
Gets the space data.SubscriptionSubscriber
getSubscriber()
Gets the subscriber.String
getSubscriberName()
Gets the full name of the subscriber.SubscriptionMethod
getSubscriptionMethod()
What is the method used to subscribe to the resource?protected UserDetail
getUser()
Gets the user data.protected boolean
isGroupCanAccess(String groupId, SubscriptionResource resource)
boolean
isReadOnly()
Indicates if the subscription is read only.protected boolean
isUserCanAccess(String userId, SubscriptionResource resource)
boolean
isValid()
Is this subscription valid?
-
-
-
Constructor Detail
-
AbstractSubscriptionBean
protected AbstractSubscriptionBean(Subscription subscription, SilverpeasComponentInstance component, String language)
-
-
Method Detail
-
getLanguage
public String getLanguage()
-
getResource
public SubscriptionResource 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.
-
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.
-
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.
-
isReadOnly
public boolean isReadOnly()
Indicates if the subscription is read only.- Returns:
- true if the subscriber is a group of users. In such a case, a user of the group has no modification rights on the subscription.
-
isValid
public boolean isValid()
Is this subscription valid? A subscription is valid if and only if the user or the group of users can access the subscribed resource.- Returns:
- true if the subscriber can access the resource. False otherwise.
-
isUserCanAccess
protected boolean isUserCanAccess(String userId, SubscriptionResource resource)
-
isGroupCanAccess
protected boolean isGroupCanAccess(String groupId, SubscriptionResource resource)
-
getPath
public String getPath()
Gets the path.- Returns:
-
getLink
public String getLink()
Gets the link to access the resource.- Returns:
-
getSubscriberName
public String getSubscriberName()
Gets the full name of the subscriber.- Returns:
-
getUser
protected UserDetail getUser()
Gets the user data.- Returns:
-
getGroup
protected Group getGroup()
Gets the group data.- Returns:
-
getComponent
public SilverpeasComponentInstance getComponent()
Gets the component data.- Returns:
- a
SilverpeasComponentInstance
instance.
-
getSpace
public SpaceInstLight getSpace()
Gets the space data.- Returns:
-
-