Class AbstractSubscription<R extends SubscriptionResource>

    • 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 subscriber
        resource - id, type and pk of the resource aimed by the subscription
        creatorId - 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 subscriber
        resource - id, type and pk of the resource aimed by the subscription
        subscriptionMethod - the way the subscriber has subscribed (for now, himself or forced)
        creatorId - the user id that has handled the subscription
        creationDate - 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 interface Subscription
        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 interface Subscription
        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 interface Subscription
        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 interface Subscription
        Returns:
        a date.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object