public class ElasticsearchActivityStore extends Object implements ActivityStore
| Constructor and Description |
|---|
ElasticsearchActivityStore()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the situation store.
|
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 ElasticsearchClient |
getClient()
This method returns the client.
|
void |
init()
Initialize the situation store.
|
protected void |
persist(BulkRequestBuilder localBulkRequestBuilder,
String id,
ActivityUnit activityUnit)
This method persists the activity unit in the Elasticsearch repository.
|
List<ActivityType> |
query(QuerySpec query)
Deprecated.
|
void |
store(List<ActivityUnit> activities)
This method stores the list of activity events.
|
public ElasticsearchActivityStore()
public void init()
protected void persist(BulkRequestBuilder localBulkRequestBuilder,
String id,
ActivityUnit activityUnit)
throws Exception
id - The idactivityUnit - The activity unitException - Failed to persistpublic void store(List<ActivityUnit> activities) throws Exception
ActivityStorestore in interface ActivityStoreactivities - The list of activity events to storeException - if any activities cannot be storedpublic ActivityUnit getActivityUnit(String id) throws Exception
ActivityStoregetActivityUnit in interface ActivityStoreid - The activity unit idException - when activity unit cannot be got from elastic search.public List<ActivityType> getActivityTypes(Context context) throws Exception
ActivityStoregetActivityTypes in interface ActivityStorecontext - The context valueException - in the event of a failurepublic List<ActivityType> getActivityTypes(Context context, long from, long to) throws Exception
ActivityStoregetActivityTypes in interface ActivityStorecontext - The optional context valuefrom - The 'from' timestampto - The 'to' timestampException - in the event of timeout.@Deprecated public List<ActivityType> query(QuerySpec query) throws Exception
query in interface ActivityStorequery - The query. Of type elastic search Query DSLException - UnsupportedOperationExceptionprotected ElasticsearchClient getClient()
public void close()
Copyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.