| Modifier and Type | Field and Description |
|---|---|
protected String |
feedSlug |
protected StreamRepository |
streamRepository |
protected String |
userId |
| Constructor and Description |
|---|
BaseFeed(StreamRepository streamRepository,
String feedSlug,
String userId)
Create a new feed using the given slug and user id.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deleteActivity(String activityId)
Removes an activity from the feed.
|
void |
deleteActivityByForeignId(String foreignId)
Removes an activity from the feed.
|
void |
follow(String feedSlug,
String userId)
Follows the given target feed.
|
void |
follow(String feedSlug,
String userId,
int activityCopyLimit)
Follows the given target feed.
|
void |
followMany(FollowMany follows)
Follow many feed in one shot.
|
void |
followMany(FollowMany follows,
int activityCopyLimit)
Follow many feed in one shot.
|
String |
getFeedId() |
String |
getFeedSlug() |
List<FeedFollow> |
getFollowers()
Lists the followers of the feed.
|
List<FeedFollow> |
getFollowers(FeedFilter filter)
Lists the followers of the feed using the given filter.
|
List<FeedFollow> |
getFollowing()
List the feeds which this feed is following.
|
List<FeedFollow> |
getFollowing(FeedFilter filter)
List the feeds which this feed is following using the give filter.
|
String |
getId()
Get the feed ID.
|
String |
getReadOnlyToken()
Generate a JWT token to perform readonly operations
|
String |
getToken()
Get the feed token.
|
String |
getUserId() |
<T extends BaseActivity> |
newAggregatedActivityService(Class<T> clazz)
Get mediator service to handle aggregated activities.
|
<T extends BaseActivity> |
newFlatActivityService(Class<T> clazz)
Get mediator service to handle aggregated activities.
|
<T extends BaseActivity> |
newNotificationActivityService(Class<T> clazz)
Get mediator service to handle aggregated activities.
|
<T extends BaseActivity> |
newUserActivityService(Class<T> clazz)
Get mediator service to handle aggregated activities.
|
void |
unfollow(String feedSlug,
String userId)
Unfollow the given target feed.
|
void |
unfollow(String feedSlug,
String userId,
boolean keepHistory)
Unfollow the given target feed.
|
protected final StreamRepository streamRepository
protected final String feedSlug
protected final String userId
public BaseFeed(StreamRepository streamRepository, String feedSlug, String userId)
streamRepository - Provide data repository to perform actual operation on a given feed.
It must implement StreamRepository.feedSlug - Feed sluguserId - User IDpublic String getReadOnlyToken()
FeedgetReadOnlyToken in interface Feedpublic void follow(String feedSlug, String userId) throws IOException, StreamClientException
Feedfollow in interface FeedfeedSlug - the slug of the target feed.userId - user idIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void follow(String feedSlug, String userId, int activityCopyLimit) throws IOException, StreamClientException
Feedfollow in interface FeedfeedSlug - the slug of the target feed.userId - user idactivityCopyLimit - How many activities should be copied from the target feedIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void followMany(FollowMany follows, int activityCopyLimit) throws IOException, StreamClientException
FeedfollowMany in interface Feedfollows - A FollowMany object which contains a list of sources and targetsactivityCopyLimit - the maximum number of activities from a
source feed that must be copied to a target feedIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void followMany(FollowMany follows) throws IOException, StreamClientException
FeedfollowMany in interface Feedfollows - A FollowMany object which contains a list of sources and targetsIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void unfollow(String feedSlug, String userId) throws IOException, StreamClientException
Feedunfollow in interface FeedfeedSlug - the slug of the target feed.userId - user idIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void unfollow(String feedSlug, String userId, boolean keepHistory) throws IOException, StreamClientException
Feedunfollow in interface FeedfeedSlug - the slug of the target feed.userId - user idkeepHistory - Whether the activities from the unfollowed feed should be removedIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic List<FeedFollow> getFollowers() throws IOException, StreamClientException
FeedgetFollowers in interface FeedIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic List<FeedFollow> getFollowers(FeedFilter filter) throws IOException, StreamClientException
FeedgetFollowers in interface Feedfilter - Filter out the followers.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic List<FeedFollow> getFollowing() throws IOException, StreamClientException
FeedgetFollowing in interface FeedIOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic List<FeedFollow> getFollowing(FeedFilter filter) throws IOException, StreamClientException
FeedgetFollowing in interface Feedfilter - Filter out the list of following feeds.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void deleteActivity(String activityId) throws IOException, StreamClientException
FeeddeleteActivity in interface FeedactivityId - the activity id to remove from this feed.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic void deleteActivityByForeignId(String foreignId) throws IOException, StreamClientException
FeeddeleteActivityByForeignId in interface FeedforeignId - the activity id to remove from this feed.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic <T extends BaseActivity> AggregatedActivityServiceImpl<T> newAggregatedActivityService(Class<T> clazz)
FeednewAggregatedActivityService in interface FeedT - Subtype of BaseActivity representing the activity type to handle.clazz - Subtype of BaseActivity representing the activity type to handle.public <T extends BaseActivity> FlatActivityServiceImpl<T> newFlatActivityService(Class<T> clazz)
FeednewFlatActivityService in interface FeedT - Subtype of BaseActivity representing the activity type to handle.clazz - Subtype of BaseActivity representing the activity type to handle.public <T extends BaseActivity> UserActivityServiceImpl<T> newUserActivityService(Class<T> clazz)
FeednewUserActivityService in interface FeedT - Subtype of BaseActivity representing the activity type to handle.clazz - Subtype of BaseActivity representing the activity type to handle.public <T extends BaseActivity> NotificationActivityServiceImpl<T> newNotificationActivityService(Class<T> clazz)
FeednewNotificationActivityService in interface FeedT - Subtype of BaseActivity representing the activity type to handle.clazz - Subtype of BaseActivity representing the activity type to handle.public String getFeedSlug()
public String getFeedId()
public String getUserId()
Copyright © 2017. All rights reserved.