T - Subtype of BaseActivity representing the activity type to handle.public abstract class AbstractActivityService<T extends BaseActivity> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected BaseFeed |
feed |
protected StreamRepository |
streamRepository |
protected Class<T> |
type |
| Constructor and Description |
|---|
AbstractActivityService(BaseFeed feed,
Class type,
StreamRepository streamRepository) |
| Modifier and Type | Method and Description |
|---|---|
StreamActivitiesResponse<T> |
addActivities(List<T> activities)
Add a new activity of type
T. |
T |
addActivity(T activity)
Add a new activity of type
T. |
T |
addActivityToMany(List<String> targetIds,
T activity)
Add a new activity of type
T to multiple feeds. |
StreamActivitiesResponse<T> |
updateActivities(List<T> activities)
Add a new activity of type
T. |
protected Class<T extends BaseActivity> type
protected final BaseFeed feed
protected final StreamRepository streamRepository
public AbstractActivityService(BaseFeed feed, Class type, StreamRepository streamRepository)
public T addActivity(T activity) throws IOException, StreamClientException
T.activity - Activity to add.T coming from the server.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic StreamActivitiesResponse<T> addActivities(List<T> activities) throws IOException, StreamClientException
T.activities - List of Activities to add.T coming from the server.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic StreamActivitiesResponse<T> updateActivities(List<T> activities) throws IOException, StreamClientException
T.activities - List of activities to updateT coming from the server.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionpublic T addActivityToMany(List<String> targetIds, T activity) throws IOException, StreamClientException
T to multiple feeds.targetIds - Destination feeds. A target id is defined as $feedSlug:$feedId.activity - Activity to add.T coming from the server.IOException - in case of network/socket exceptionsStreamClientException - in case of functional or server-side exceptionCopyright © 2016. All rights reserved.