Package org.xwiki.livedata
Interface LiveDataEntryStore
-
@Role public interface LiveDataEntryStoreThe interface used to store and retrieve live data entries.- Since:
- 12.10
- Version:
- $Id: 5588e9fccfd218691962c1998225a59abfb21fe9 $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Optional<Map<String,Object>>get(Object entryId)default Optional<Object>get(Object entryId, String property)LiveDataget(LiveDataQuery query)Executes a query on the live data.default Optional<Map<String,Object>>remove(Object entryId)Removes an existing entry.default Optional<Object>save(Map<String,Object> entry)Creates a new entry or updates an existing one.default Optional<Object>update(Object entryId, String property, Object value)Updates a property of a live data entry.
-
-
-
Method Detail
-
get
Optional<Map<String,Object>> get(Object entryId) throws LiveDataException
- Parameters:
entryId- identifies the entry to return- Returns:
- the specified entry
- Throws:
LiveDataException- if retrieving the specified entry fails
-
get
default Optional<Object> get(Object entryId, String property) throws LiveDataException
- Parameters:
entryId- identifies the entry whose property value to returnproperty- the property whose value to return- Returns:
- the value of the specified property from the specified live data entry
- Throws:
LiveDataException- if retrieving the specified property fails
-
get
LiveData get(LiveDataQuery query) throws LiveDataException
Executes a query on the live data.- Parameters:
query- the query used to filter and sort the live data entries- Returns:
- the live data entries that match the given query
- Throws:
LiveDataException- if the live data query execution fails
-
save
default Optional<Object> save(Map<String,Object> entry) throws LiveDataException
Creates a new entry or updates an existing one.- Parameters:
entry- the entry to save- Returns:
- the identifier of the saved entry
- Throws:
LiveDataException- if saving the given entry fails- Since:
- 12.10.4, 13.0
-
update
default Optional<Object> update(Object entryId, String property, Object value) throws LiveDataException
Updates a property of a live data entry.- Parameters:
entryId- the entry to updateproperty- the property to updatevalue- the new property value- Returns:
- the previous property value
- Throws:
LiveDataException- if updating the specified property fails
-
remove
default Optional<Map<String,Object>> remove(Object entryId) throws LiveDataException
Removes an existing entry.- Parameters:
entryId- identifies the entry to remove- Returns:
trueif the entry was removed,falseotherwise- Throws:
LiveDataException- if removing the specified entry fails
-
-