@Singleton public class MemActivityStore extends Object implements ActivityStore
Constructor and Description |
---|
MemActivityStore() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
This method clears the activity store.
|
protected static boolean |
evaluate(ActivityType activity,
QuerySpec query)
This method evaluates whether the supplied activity
passes the supplied predicate.
|
List<ActivityType> |
getActivityTypes(Context context)
This method retrieves a set of activity events associated
with the supplied context value.
|
List<ActivityType> |
getActivityTypes(Context context,
long from,
long to)
This method retrieves a set of activity events associated
with the supplied context value and date/time range.
|
ActivityUnit |
getActivityUnit(String id)
This method queries the persistent store for an activity unit
with the supplied id.
|
protected static boolean |
isFormatSupported(QuerySpec query)
This method determines whether the query format is supported
by the activity store.
|
List<ActivityType> |
query(QuerySpec query)
This method queries the persistent store for activity events
that satisfy the supplied query.
|
void |
store(List<ActivityUnit> activities)
This method stores the list of activity events.
|
public void clear()
public void store(List<ActivityUnit> activities) throws Exception
store
in interface ActivityStore
activities
- The list of activity events to storeException
- Failed to store eventspublic ActivityUnit getActivityUnit(String id) throws Exception
getActivityUnit
in interface ActivityStore
id
- The activity unit idException
- Failed to query activity unitpublic List<ActivityType> getActivityTypes(Context context) throws Exception
getActivityTypes
in interface ActivityStore
context
- The context valueException
- Failed to retrieve the activitiespublic List<ActivityType> getActivityTypes(Context context, long from, long to) throws Exception
getActivityTypes
in interface ActivityStore
context
- The context valuefrom
- The 'from' timestampto
- The 'to' timestampException
- Failed to retrieve the activitiespublic List<ActivityType> query(QuerySpec query) throws Exception
query
in interface ActivityStore
query
- The queryException
- Failed to query eventsprotected static boolean isFormatSupported(QuerySpec query)
query
- The queryprotected static boolean evaluate(ActivityType activity, QuerySpec query)
activity
- The activityquery
- The query/predicateCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.