public class ActivityStreamServiceImpl extends DefaultComponent implements ActivityStreamService
ActivityStreamService
.Modifier and Type | Field and Description |
---|---|
static String |
ACTIVITIES_PROVIDER |
static String |
ACTIVITY_LINK_BUILDERS_EP |
static String |
ACTIVITY_STREAM_FILTER_EP |
static String |
ACTIVITY_STREAMS_EP |
static String |
ACTIVITY_UPGRADERS_EP |
static String |
ACTIVITY_VERBS_EP |
protected ActivityLinkBuilderRegistry |
activityLinkBuilderRegistry |
protected Map<String,ActivityStreamFilter> |
activityStreamFilters |
protected ActivityStreamRegistry |
activityStreamRegistry |
protected ActivityUpgraderRegistry |
activityUpgraderRegistry |
protected ActivityVerbRegistry |
activityVerbRegistry |
protected RepositoryInitializationHandler |
initializationHandler |
protected ThreadLocal<javax.persistence.EntityManager> |
localEntityManager |
protected PersistenceProvider |
persistenceProvider |
lastModified, name
ALL_ACTIVITIES
Constructor and Description |
---|
ActivityStreamServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
activate(ComponentContext context)
Activates the component.
|
protected void |
activatePersistenceProvider() |
Activity |
addActivity(Activity activity)
Add and store a new
Activity . |
protected void |
addActivity(javax.persistence.EntityManager em,
Activity activity) |
ActivityReply |
addActivityReply(Serializable activityId,
ActivityReply activityReply)
|
protected String |
computeNewReplyId(Activity activity) |
void |
deactivate(ComponentContext context)
Deactivates the component.
|
protected void |
deactivatePersistenceProvider() |
ActivitiesList |
getActivities(Collection<Serializable> activityIds) |
protected ActivitiesList |
getActivities(javax.persistence.EntityManager em,
Collection<Serializable> activityIds) |
protected Activity |
getActivity(javax.persistence.EntityManager em,
Serializable activityId) |
Activity |
getActivity(Serializable activityId) |
ActivityLinkBuilder |
getActivityLinkBuilder(String name)
Returns the
ActivityLinkBuilder with the given name . |
ActivityStream |
getActivityStream(String name)
|
javax.persistence.EntityManager |
getEntityManager() |
PersistenceProvider |
getOrCreatePersistenceProvider() |
protected ActivitiesList |
query(ActivityStreamFilter filter,
Map<String,Serializable> parameters,
long offset,
long limit) |
protected ActivitiesList |
query(javax.persistence.EntityManager em,
ActivityStreamFilter filter,
Map<String,Serializable> parameters,
long offset,
long limit) |
ActivitiesList |
query(String filterId,
Map<String,Serializable> parameters)
Returns the list of activities filtered by the given parameters using the
ActivityStreamFilter referenced
by filterId . |
ActivitiesList |
query(String filterId,
Map<String,Serializable> parameters,
long offset,
long limit)
Returns the list of activities filtered by the given parameters using the
ActivityStreamFilter referenced
by filterId . |
protected ActivitiesList |
queryAll(javax.persistence.EntityManager em,
long offset,
long limit) |
protected ActivitiesList |
queryAll(long offset,
long limit) |
void |
registerContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
void |
removeActivities(Collection<Activity> activities)
Remove the given
activities . |
protected void |
removeActivities(javax.persistence.EntityManager em,
Collection<Activity> activities) |
protected ActivityReply |
removeActivityReply(javax.persistence.EntityManager em,
Serializable activityId,
String activityReplyId) |
ActivityReply |
removeActivityReply(Serializable activityId,
String activityReplyId)
|
ActivityMessage |
toActivityMessage(Activity activity,
Locale locale)
|
ActivityMessage |
toActivityMessage(Activity activity,
Locale locale,
String activityLinkBuilderName)
|
ActivityReplyMessage |
toActivityReplyMessage(ActivityReply activityReply,
Locale locale)
|
ActivityReplyMessage |
toActivityReplyMessage(ActivityReply activityReply,
Locale locale,
String activityLinkBuilderName)
|
void |
unregisterContribution(Object contribution,
String extensionPoint,
ComponentInstance contributor) |
protected void |
updateActivity(Activity activity) |
void |
upgradeActivities() |
protected void |
upgradeActivities(javax.persistence.EntityManager em,
ActivityUpgrader upgrader) |
getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
applicationStarted, getApplicationStartedOrder
public static final String ACTIVITIES_PROVIDER
public static final String ACTIVITY_STREAM_FILTER_EP
public static final String ACTIVITY_STREAMS_EP
public static final String ACTIVITY_VERBS_EP
public static final String ACTIVITY_LINK_BUILDERS_EP
public static final String ACTIVITY_UPGRADERS_EP
protected final ThreadLocal<javax.persistence.EntityManager> localEntityManager
protected final Map<String,ActivityStreamFilter> activityStreamFilters
protected ActivityStreamRegistry activityStreamRegistry
protected ActivityVerbRegistry activityVerbRegistry
protected ActivityLinkBuilderRegistry activityLinkBuilderRegistry
protected ActivityUpgraderRegistry activityUpgraderRegistry
protected PersistenceProvider persistenceProvider
protected RepositoryInitializationHandler initializationHandler
public ActivityStreamServiceImpl()
public void upgradeActivities()
protected void upgradeActivities(javax.persistence.EntityManager em, ActivityUpgrader upgrader)
public ActivitiesList query(String filterId, Map<String,Serializable> parameters)
ActivityStreamService
ActivityStreamFilter
referenced
by filterId
.query
in interface ActivityStreamService
filterId
- the id of the ActivityStreamFilter
to use.parameters
- this query parameters.public ActivitiesList query(String filterId, Map<String,Serializable> parameters, long offset, long limit)
ActivityStreamService
ActivityStreamFilter
referenced
by filterId
.query
in interface ActivityStreamService
filterId
- the id of the ActivityStreamFilter
to use.parameters
- this query parameters.offset
- the offset (starting at 0) into the list of activities.limit
- the maximum number of activities to retrieve, or 0 for all of them.protected ActivitiesList query(ActivityStreamFilter filter, Map<String,Serializable> parameters, long offset, long limit)
protected ActivitiesList query(javax.persistence.EntityManager em, ActivityStreamFilter filter, Map<String,Serializable> parameters, long offset, long limit)
protected ActivitiesList queryAll(long offset, long limit)
protected ActivitiesList queryAll(javax.persistence.EntityManager em, long offset, long limit)
public Activity addActivity(Activity activity)
ActivityStreamService
Activity
.addActivity
in interface ActivityStreamService
protected void addActivity(javax.persistence.EntityManager em, Activity activity)
public void removeActivities(Collection<Activity> activities)
ActivityStreamService
activities
.removeActivities
in interface ActivityStreamService
protected void removeActivities(javax.persistence.EntityManager em, Collection<Activity> activities)
public ActivityMessage toActivityMessage(Activity activity, Locale locale)
ActivityStreamService
toActivityMessage
in interface ActivityStreamService
public ActivityMessage toActivityMessage(Activity activity, Locale locale, String activityLinkBuilderName)
ActivityStreamService
toActivityMessage
in interface ActivityStreamService
public ActivityLinkBuilder getActivityLinkBuilder(String name)
ActivityStreamService
ActivityLinkBuilder
with the given name
.
If name
is null
, or if the ActivityLinkBuilder
does not exist, fallback on the default
one if any.
getActivityLinkBuilder
in interface ActivityStreamService
public ActivityReplyMessage toActivityReplyMessage(ActivityReply activityReply, Locale locale)
ActivityStreamService
toActivityReplyMessage
in interface ActivityStreamService
public ActivityReplyMessage toActivityReplyMessage(ActivityReply activityReply, Locale locale, String activityLinkBuilderName)
ActivityStreamService
toActivityReplyMessage
in interface ActivityStreamService
public ActivityStream getActivityStream(String name)
ActivityStreamService
getActivityStream
in interface ActivityStreamService
public ActivityReply addActivityReply(Serializable activityId, ActivityReply activityReply)
ActivityStreamService
addActivityReply
in interface ActivityStreamService
activityReply
protected String computeNewReplyId(Activity activity)
public Activity getActivity(Serializable activityId)
getActivity
in interface ActivityStreamService
public ActivitiesList getActivities(Collection<Serializable> activityIds)
getActivities
in interface ActivityStreamService
public ActivityReply removeActivityReply(Serializable activityId, String activityReplyId)
ActivityStreamService
removeActivityReply
in interface ActivityStreamService
ActivityReply
if any, null
otherwiseprotected ActivityReply removeActivityReply(javax.persistence.EntityManager em, Serializable activityId, String activityReplyId)
protected Activity getActivity(javax.persistence.EntityManager em, Serializable activityId)
protected ActivitiesList getActivities(javax.persistence.EntityManager em, Collection<Serializable> activityIds)
protected void updateActivity(Activity activity)
public javax.persistence.EntityManager getEntityManager()
public PersistenceProvider getOrCreatePersistenceProvider()
protected void activatePersistenceProvider()
protected void deactivatePersistenceProvider()
public void activate(ComponentContext context)
Component
This method is called by the runtime when a component is activated.
activate
in interface Component
activate
in class DefaultComponent
context
- the runtime contextpublic void deactivate(ComponentContext context)
Component
This method is called by the runtime when a component is deactivated.
deactivate
in interface Component
deactivate
in class DefaultComponent
context
- the runtime contextpublic void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
registerContribution
in class DefaultComponent
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
unregisterContribution
in class DefaultComponent
Copyright © 2019 Nuxeo. All rights reserved.