@Override public void start() { collector.flushFollowModes(); session.addActivityProducer(this); session.addActivityConsumer(consumer); session.addListener(sessionListener); editor.addSharedEditorListener(followModeListener); }
@Override public void stop() { session.removeActivityProducer(this); session.removeActivityConsumer(consumer); session.removeListener(sessionListener); editor.removeSharedEditorListener(followModeListener); collector.flushFollowModes(); }
@Override public void receive(StopFollowingActivity activity) { User source = activity.getSource(); if (LOG.isDebugEnabled()) LOG.debug("user " + source + " stopped follow mode"); collector.setUserFollowing(source, null); notifyListeners(); }
@Override public void receive(StartFollowingActivity activity) { final User source = activity.getSource(); final User target = activity.getFollowedUser(); if (LOG.isDebugEnabled()) LOG.debug("received new follow mode from: " + source + " , followed: " + target); collector.setUserFollowing(source, target); notifyListeners(); }
@Override public void userLeft(final User user) { collector.setUserFollowing(user, null); notifyListeners(); }