public interface FeatureStoreCore
extends java.io.Closeable
FeatureStore
, to be used in conjunction with CachingStoreWrapper
. This allows
developers of custom FeatureStore implementations to avoid repeating logic that would
commonly be needed in any such implementation, such as caching. Instead, they can implement
only FeatureStoreCore and then create a CachingStoreWrapper.
Note that these methods do not take any generic type parameters; all storeable entities are
treated as implementations of the VersionedData
interface, and a VersionedDataKind
instance is used to specify what kind of entity is being referenced. If entities will be
marshaled and unmarshaled, this must be done by reflection, using the type specified by
VersionedDataKind.getItemClass()
; the methods in FeatureStoreHelpers
may be
useful for this.
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,VersionedData> |
getAllInternal(VersionedDataKind<?> kind)
Returns a
Map of all associated objects of a given kind. |
VersionedData |
getInternal(VersionedDataKind<?> kind,
java.lang.String key)
Returns the object to which the specified key is mapped, or null if no such item exists.
|
boolean |
initializedInternal()
Returns true if this store has been initialized.
|
void |
initInternal(java.util.Map<VersionedDataKind<?>,java.util.Map<java.lang.String,VersionedData>> allData)
Initializes (or re-initializes) the store with the specified set of objects.
|
VersionedData |
upsertInternal(VersionedDataKind<?> kind,
VersionedData item)
Updates or inserts the object associated with the specified key.
|
VersionedData getInternal(VersionedDataKind<?> kind, java.lang.String key)
kind
- the kind of object to getkey
- the key whose associated object is to be returnedjava.util.Map<java.lang.String,VersionedData> getAllInternal(VersionedDataKind<?> kind)
Map
of all associated objects of a given kind. The method
should not attempt to filter out any items based on their isDeleted() property, nor to
cache any items.kind
- the kind of objects to getvoid initInternal(java.util.Map<VersionedDataKind<?>,java.util.Map<java.lang.String,VersionedData>> allData)
If possible, the store should update the entire data set atomically. If that is not possible, it should iterate through the outer map and then the inner map in the order provided (the SDK will use a Map subclass that has a defined ordering), storing each item, and then delete any leftover items at the very end.
allData
- all objects to be storedVersionedData upsertInternal(VersionedDataKind<?> kind, VersionedData item)
kind
- the kind of object to updateitem
- the object to update or insertboolean initializedInternal()