ActivityManager
instead.public interface ActivityService
ActivityService
is the main entry point for using the activity streams.
It provides functionality for creating, read and writting getting a
, Activity
and ActivityObject
ActivityTarget
Modifier and Type | Method and Description |
---|---|
boolean |
isAllowed(Session session,
Activity activity)
Deprecated.
Returns if provided session is allowed to write the provided activity.
|
Activity |
makeActivity()
Deprecated.
Returns an empty activity instance.
|
Activity |
makeActivity(String json)
Deprecated.
Returns an activity instance parsed from a JSON string.
|
ActivityObject |
makeActivityObject()
Deprecated.
Returns an empty activity object instance.
|
ActivityObject |
makeActivityObject(String json)
Deprecated.
Returns an activity object instance parsed from a JSON string.
|
ActivityTarget |
makeActivityTarget()
Deprecated.
Returns an empty activity target instance.
|
ActivityTarget |
makeActivityTarget(String json)
Deprecated.
Returns an activity target instance parsed from a JSON string.
|
Collection<Activity> |
readActivities(Resource userHome,
String stream)
Deprecated.
Reads all user activities.
|
Collection<Activity> |
readActivities(Resource userHome,
String stream,
long limit)
Deprecated.
Reads all user activities.
|
Collection<Activity> |
readActivities(Resource userHome,
String stream,
String predicateId)
Deprecated.
Reads user activities.
|
Collection<Activity> |
readActivities(Resource userHome,
String stream,
String predicateId,
long limit)
Deprecated.
Reads user activities.
|
Activity |
readActivity(Resource resource)
Deprecated.
Reads an activity.
|
void |
writeActivity(Activity activity)
Deprecated.
Writes an activity.
|
Activity makeActivity() throws ActivityException
ActivityException
- If an exception occurs during creationActivity makeActivity(String json) throws ActivityException
json
- The JSON string representing the activityActivityException
- If an exception occurs during parsing and creationActivityObject makeActivityObject() throws ActivityException
ActivityException
- If an exception occurs during creationActivityObject makeActivityObject(String json) throws ActivityException
json
- The JSON string representing the activity objectActivityException
- If an exception occurs during parsing and creationActivityTarget makeActivityTarget() throws ActivityException
ActivityException
- If an exception occurs during creationActivityTarget makeActivityTarget(String json) throws ActivityException
json
- The JSON string representing the activity targetActivityException
- If an exception occurs during parsing and creationActivity readActivity(Resource resource) throws ActivityException
resource
- The resource representing the activityActivityException
- If an exception occurs while reading the activity.Collection<Activity> readActivities(Resource userHome, String stream) throws ActivityException
userHome
- The user to read the activities from. Might point either to
the user home or the user's profile. Must not be
null
.stream
- The stream to read from. Can be null
to use the
default
.Activities
ActivityException
- If an exception occurs while reading the activities.IllegalArgumentException
- if the userHome
is null
.com.day.cq.activitystreams.api.ActivityService#readActivities(org.apache.sling.api.resource.Resource,
java.lang.String, java.lang.String)
,
PredicateProvider
Collection<Activity> readActivities(Resource userHome, String stream, long limit) throws ActivityException
userHome
- The user to read the activities from. Might point either to
the user home or the user's profile. Must not be
null
.stream
- The stream to read from. Can be null
to use the
default
.limit
- The max number of activities to readActivities
ActivityException
- If an exception occurs while reading the activities.IllegalArgumentException
- if the userHome
is null
.com.day.cq.activitystreams.api.ActivityService#readActivities(org.apache.sling.api.resource.Resource,
java.lang.String, java.lang.String)
,
PredicateProvider
Collection<Activity> readActivities(Resource userHome, String stream, String predicateId) throws ActivityException
userHome
- The user to read the activities from. Might point either to
the user home or the user's profile. Must not be
null
.stream
- The stream to read from. Can be null
to use the
default
.predicateId
- The predicate id to filter the activities. Uses the
PredicateProvider
to resolve the predicate to use. Can be
null
to omit the use of a predicate.Activities
ActivityException
- If an exception occurs while reading the activities.IllegalArgumentException
- if the userHome
is null
.com.day.cq.activitystreams.api.ActivityService#readActivities(org.apache.sling.api.resource.Resource,
java.lang.String, java.lang.String)
,
PredicateProvider
Collection<Activity> readActivities(Resource userHome, String stream, String predicateId, long limit) throws ActivityException
userHome
- The user to read the activities from. Might point either to
the user home or the user's profile. Must not be
null
.stream
- The stream to read from. Can be null
to use the
default
.predicateId
- The predicate id to filter the activities. Uses the
PredicateProvider
to resolve the predicate to use. Can be
null
to omit the use of a predicate.limit
- The max number of activities to readActivities
ActivityException
- If an exception occurs while reading the activities.IllegalArgumentException
- if the userHome
is null
.com.day.cq.activitystreams.api.ActivityService#readActivities(org.apache.sling.api.resource.Resource,
java.lang.String, java.lang.String)
,
PredicateProvider
void writeActivity(Activity activity) throws ActivityException
activity
- The activity to writeActivityException
- If an exception occurs while writing the activity.boolean isAllowed(Session session, Activity activity)
session
- The session to checkactivity
- The activity to write"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"