Class InMemoryUserSubscriptionService

java.lang.Object
com.flowable.engage.engine.impl.profile.subscription.InMemoryUserSubscriptionService
All Implemented Interfaces:
UserSubscriptionService

public class InMemoryUserSubscriptionService
extends java.lang.Object
implements UserSubscriptionService
An in memory user subscription service. This would only work on one node.
Author:
Filip Hrisafov
  • Constructor Summary

    Constructors 
    Constructor Description
    InMemoryUserSubscriptionService()  
  • Method Summary

    Modifier and Type Method Description
    java.util.Collection<java.lang.String> findSubscriptionsTo​(java.lang.String userId)
    Find all the user(s) that have the user with userId in their subscriptions
    void subscribe​(java.lang.String userId, java.lang.String sessionId, java.util.Collection<java.lang.String> userIds)
    Subscribe the user with userId in the session sessionId to the users with userIds.
    void unSubscribe​(java.lang.String userId, java.lang.String sessionId)
    Remove the subscription for the user with the given id and the given session.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • subscribe

      public void subscribe​(java.lang.String userId, java.lang.String sessionId, java.util.Collection<java.lang.String> userIds)
      Description copied from interface: UserSubscriptionService
      Subscribe the user with userId in the session sessionId to the users with userIds. If a subscription already exists then the existing user ids are replaced with the passed userIds
      Specified by:
      subscribe in interface UserSubscriptionService
      Parameters:
      userId - the id of the user to which the subscription belongs to
      sessionId - the id of the session in which the user is subscribed to
      userIds - the ids of all the users that the user is subscribed to
    • unSubscribe

      public void unSubscribe​(java.lang.String userId, java.lang.String sessionId)
      Description copied from interface: UserSubscriptionService
      Remove the subscription for the user with the given id and the given session.
      Specified by:
      unSubscribe in interface UserSubscriptionService
      Parameters:
      userId - the id of the user that is being un-subscribed
      sessionId - the id of the session that is being un-subscribed
    • findSubscriptionsTo

      public java.util.Collection<java.lang.String> findSubscriptionsTo​(java.lang.String userId)
      Description copied from interface: UserSubscriptionService
      Find all the user(s) that have the user with userId in their subscriptions
      Specified by:
      findSubscriptionsTo in interface UserSubscriptionService
      Parameters:
      userId - the id of the user
      Returns:
      all the user(s) that have the user with userId in their subscriptions