@ProviderType public interface ActivityManager
Modifier and Type | Method and Description |
---|---|
ActivityCollection |
getActivities(ResourceResolver resolver,
java.lang.String userId)
Returns the activity collection for the given user.
|
ActivityCollection |
getActivities(ResourceResolver resolver,
java.lang.String userId,
AggregateOptions options)
Returns the activity collection for the given user.
|
Activity |
getActivity(ResourceResolver resolver,
java.lang.String id)
Returns the activity with the given id or
null if not exists. |
java.lang.Iterable<java.lang.String> |
getFollowers(Activity activity)
Returns an iterable over a list of users that see this activity in their default aggregate stream.
|
java.lang.Iterable<java.lang.String> |
getFollowers(ActivityStream stream)
Returns an iterable over a list of users that follow this stream stream.
|
ActivityStream |
getGroupStream(ResourceResolver resolver,
java.lang.String groupName,
java.lang.String streamName,
boolean create)
Gets the distinct activity stream for the given group.
|
ActivityStream |
getStream(Resource streamResource)
Returns the activity stream for the given resource.
|
ActivityStream |
getStream(ResourceResolver resolver,
Authorizable auth,
java.lang.String streamName,
boolean create)
Gets the distinct activity stream for the given authorizable.
|
ActivityStream |
getStream(Resource containerResource,
java.lang.String name,
boolean create)
Returns the activity stream for the given container resource, e.g.
|
ActivityStream |
getTopicStream(Resource topicResource,
java.lang.String streamName)
Deprecated.
since 0.0.8. use
getStream(org.apache.sling.api.resource.Resource, String, boolean) instead. |
ActivityStream |
getUserStream(ResourceResolver resolver,
java.lang.String userId,
java.lang.String streamName)
Deprecated.
since 0.0.8. use
getUserStream(org.apache.sling.api.resource.ResourceResolver, String, String, boolean) instead. |
ActivityStream |
getUserStream(ResourceResolver resolver,
java.lang.String userId,
java.lang.String streamName,
boolean create)
Gets the distinct activity stream for the given user.
|
ActivityStream |
getUserStream(ResourceResolver resolver,
User user,
java.lang.String streamName)
|
java.util.Collection<ActivityStream> |
listStreams(Resource containerResource)
Lists all streams of the given container resource (user, group, document);
|
java.util.Collection<ActivityStream> |
listStreams(ResourceResolver resolver,
java.lang.String userId,
AggregateOptions options)
Lists all streams for the given user that would be used to build the activity collection.
|
MutableActivity |
newActivity()
Creates a new mutable activity for populating with the input data.
|
MutableActivity |
newActivity(JSONObject jsonObject)
Creates a new mutable activity populated with input data of a JSON object.
|
MutableActivityObject |
newActivityObject()
Creates a new mutable activity object for populating with the input data.
|
MutableMediaLink |
newMediaLink()
Creates a new mutable media link for populating with the input data.
|
MutableActivity newActivity()
MutableActivity newActivity(JSONObject jsonObject)
jsonObject
- JSON object representing the activity.MutableActivityObject newActivityObject()
MutableMediaLink newMediaLink()
ActivityCollection getActivities(ResourceResolver resolver, java.lang.String userId) throws ActivityException
resolver
- resource resolver to resolve the pathuserId
- the userid of the user. If null
the user bound to the resource resolver is used.ActivityException
ActivityCollection getActivities(ResourceResolver resolver, java.lang.String userId, AggregateOptions options) throws ActivityException
resolver
- resource resolveruserId
- the userid of the user. If null
the user bound to the resource resolver is used.options
- the aggregate optionsActivityException
- if an error occursActivity getActivity(ResourceResolver resolver, java.lang.String id) throws ActivityException
null
if not exists.resolver
- resource resolver to resolve the idid
- the id of the activitynull
ActivityException
- if an error occurs.ActivityStream getUserStream(ResourceResolver resolver, java.lang.String userId, java.lang.String streamName, boolean create) throws ActivityException
resolver
- resource resolver to resolve the pathuserId
- the userid of the userstreamName
- the name of the stream or null
to use the default streamnull
if the user or his stream does not exist.ActivityException
- if an error occurs.ActivityStream getGroupStream(ResourceResolver resolver, java.lang.String groupName, java.lang.String streamName, boolean create) throws ActivityException
resolver
- resource resolver to resolve the pathgroupName
- the name of the groupstreamName
- the name of the stream or null
to use the default streamnull
if the user or his stream does not exist.ActivityException
- if an error occurs.ActivityStream getStream(ResourceResolver resolver, Authorizable auth, java.lang.String streamName, boolean create) throws ActivityException
resolver
- resource resolver to resolve the pathauth
- the jackrabbit authorizablestreamName
- the name of the stream or null
to use the default streamnull
if the user or his stream does not exist.ActivityException
- if an error occursActivityStream getStream(Resource streamResource) throws ActivityException
streamResource
- the stream resourceActivityException
- if an error occursActivityStream getStream(Resource containerResource, java.lang.String name, boolean create) throws ActivityException
create
is true
a new stream is created.containerResource
- the container resourcename
- the stream namenull
if no such stream existsActivityException
- if an error occursjava.util.Collection<ActivityStream> listStreams(Resource containerResource) throws ActivityException
containerResource
- the resource to list the streamsnull
if the resource is invalid.ActivityException
- if an error occursjava.util.Collection<ActivityStream> listStreams(ResourceResolver resolver, java.lang.String userId, AggregateOptions options) throws ActivityException
resolver
- resource resolveruserId
- the user idoptions
- the aggregate optionsnull
if the resource is invalid.ActivityException
- if an error occursjava.lang.Iterable<java.lang.String> getFollowers(Activity activity) throws ActivityException, java.lang.IllegalArgumentException
activity
- the activityActivityException
- if an error occursjava.lang.IllegalArgumentException
- if the activity is not persisted in the underlying repositoryjava.lang.Iterable<java.lang.String> getFollowers(ActivityStream stream) throws ActivityException, java.lang.IllegalArgumentException
stream
- the streamActivityException
- if an error occursjava.lang.IllegalArgumentException
- if the activity is not persisted in the underlying repository@Deprecated ActivityStream getUserStream(ResourceResolver resolver, java.lang.String userId, java.lang.String streamName) throws ActivityException
getUserStream(org.apache.sling.api.resource.ResourceResolver, String, String, boolean)
instead.resolver
- resource resolver to resolve the pathuserId
- the userid of the userstreamName
- the name of the stream or null
to use the default streamnull
if the user or his stream does not exist.ActivityException
- if an error occurs.@Deprecated ActivityStream getUserStream(ResourceResolver resolver, User user, java.lang.String streamName) throws ActivityException
getStream(org.apache.sling.api.resource.ResourceResolver, org.apache.jackrabbit.api.security.user.Authorizable, String, boolean)
resolver
- resource resolver to resolve the pathuser
- the jackrabbit userstreamName
- the name of the stream or null
to use the default streamnull
if the user or his stream does not exist.ActivityException
- if an error occurs@Deprecated ActivityStream getTopicStream(Resource topicResource, java.lang.String streamName) throws ActivityException
getStream(org.apache.sling.api.resource.Resource, String, boolean)
instead.topicResource
- the topic for which the stream is retrievedstreamName
- the name of the stream or null
to use the default streamActivityException
- if an error occursCopyright © 2010 - 2020 Adobe. All Rights Reserved